open-downloader-cli 2.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- open_downloader_cli-2.2.1/LICENSE +21 -0
- open_downloader_cli-2.2.1/PKG-INFO +480 -0
- open_downloader_cli-2.2.1/README.md +446 -0
- open_downloader_cli-2.2.1/odl/__init__.py +8 -0
- open_downloader_cli-2.2.1/odl/__main__.py +9 -0
- open_downloader_cli-2.2.1/odl/cli.py +478 -0
- open_downloader_cli-2.2.1/odl/config.py +135 -0
- open_downloader_cli-2.2.1/odl/constants.py +73 -0
- open_downloader_cli-2.2.1/odl/cookies.py +646 -0
- open_downloader_cli-2.2.1/odl/diagnostics.py +171 -0
- open_downloader_cli-2.2.1/odl/downloader.py +358 -0
- open_downloader_cli-2.2.1/odl/errors.py +63 -0
- open_downloader_cli-2.2.1/odl/logging_setup.py +90 -0
- open_downloader_cli-2.2.1/odl/models.py +94 -0
- open_downloader_cli-2.2.1/odl/playlist.py +309 -0
- open_downloader_cli-2.2.1/odl/playlist_state.py +79 -0
- open_downloader_cli-2.2.1/odl/proxy_pool.py +260 -0
- open_downloader_cli-2.2.1/odl/state.py +21 -0
- open_downloader_cli-2.2.1/open_downloader_cli.egg-info/PKG-INFO +480 -0
- open_downloader_cli-2.2.1/open_downloader_cli.egg-info/SOURCES.txt +25 -0
- open_downloader_cli-2.2.1/open_downloader_cli.egg-info/dependency_links.txt +1 -0
- open_downloader_cli-2.2.1/open_downloader_cli.egg-info/entry_points.txt +2 -0
- open_downloader_cli-2.2.1/open_downloader_cli.egg-info/requires.txt +8 -0
- open_downloader_cli-2.2.1/open_downloader_cli.egg-info/top_level.txt +1 -0
- open_downloader_cli-2.2.1/pyproject.toml +86 -0
- open_downloader_cli-2.2.1/setup.cfg +4 -0
- open_downloader_cli-2.2.1/tests/test_odl.py +525 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 M.Soleimani
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: open-downloader-cli
|
|
3
|
+
Version: 2.2.1
|
|
4
|
+
Summary: A simple, secure, resumable YouTube downloader for the command line, built on yt-dlp
|
|
5
|
+
Author-email: "M.Soleimani" <msoleimaniphone@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/msoleimani62/open-downloader-cli
|
|
8
|
+
Project-URL: Repository, https://github.com/msoleimani62/open-downloader-cli
|
|
9
|
+
Project-URL: Issues, https://github.com/msoleimani62/open-downloader-cli/issues
|
|
10
|
+
Keywords: youtube,downloader,yt-dlp,cli,video
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Multimedia :: Video
|
|
22
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: yt-dlp
|
|
27
|
+
Requires-Dist: rich
|
|
28
|
+
Requires-Dist: cryptography
|
|
29
|
+
Provides-Extra: dev
|
|
30
|
+
Requires-Dist: pytest; extra == "dev"
|
|
31
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
32
|
+
Requires-Dist: ruff; extra == "dev"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# 📥 Open Downloader CLI
|
|
36
|
+
|
|
37
|
+
<div align="center">
|
|
38
|
+
|
|
39
|
+
**یک دانلودر یوتیوب ساده، امن و رزیومپذیر برای خط فرمان**
|
|
40
|
+
**A simple, secure, resumable YouTube downloader for the command line**
|
|
41
|
+
|
|
42
|
+
بر پایهی / Built on [yt-dlp](https://github.com/yt-dlp/yt-dlp) · دستور اجرا / Command: `odl`
|
|
43
|
+
|
|
44
|
+
[](https://github.com/msoleimani62/open-downloader-cli/actions/workflows/tests.yml)
|
|
45
|
+
[](LICENSE)
|
|
46
|
+
[](pyproject.toml)
|
|
47
|
+
|
|
48
|
+
**فارسی | [English ⬇](#-english)**
|
|
49
|
+
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## ⚡ شروع سریع
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install git+https://github.com/msoleimani62/open-downloader-cli.git
|
|
58
|
+
odl "لینک ویدیوی یوتیوب"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
همین. بار اول اگه `cookies.txt` نداشته باشی راهنمای export نشونت میده؛ اگه داشته باشی خودش با رمز اصلی رمزنگاریش میکنه و شروع به دانلود میکنه.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 📚 فهرست مطالب
|
|
66
|
+
|
|
67
|
+
- [شروع سریع](#-شروع-سریع)
|
|
68
|
+
- [ویژگیها](#-ویژگیها)
|
|
69
|
+
- [پیشنیازها](#-پیشنیازها)
|
|
70
|
+
- [نصب](#-نصب)
|
|
71
|
+
- [دریافت کوکی — راهنمای گامبهگام](#-دریافت-کوکی--راهنمای-گامبهگام)
|
|
72
|
+
- [استفاده](#-استفاده)
|
|
73
|
+
- [پیدا کردن خودکار پروکسی](#-پیدا-کردن-خودکار-پروکسی-برای-کسایی-که-پروکسی-بلد-نیستن)
|
|
74
|
+
- [همهی گزینههای خط فرمان](#-همهی-گزینههای-خط-فرمان)
|
|
75
|
+
- [عیبیابی](#-عیبیابی)
|
|
76
|
+
- [حذف کامل](#️-حذف-کامل)
|
|
77
|
+
- [نقشهی راه](#-نقشهی-راه)
|
|
78
|
+
- [لایسنس](#-لایسنس)
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## ✨ ویژگیها
|
|
83
|
+
|
|
84
|
+
| قابلیت | توضیح |
|
|
85
|
+
|---|---|
|
|
86
|
+
| 🎬 دانلود تکی / پلیلیست | با نوار پیشرفت زنده و رنگی، دانلود موازی برای پلیلیست |
|
|
87
|
+
| ⏸️ رزیوم خودکار | دانلود ناتمام (قطعی نت، خاموشی گوشی) خودکار از همونجا ادامه پیدا میکنه |
|
|
88
|
+
| 🍪 دریافت خودکار کوکی | متناسب با محیط اجرا — دسکتاپ، اندروید روتشده، یا اندروید معمولی |
|
|
89
|
+
| 🔐 رمزنگاری کوکی | AES (از طریق Fernet) + رمز اصلی که هیچجا ذخیره نمیشه |
|
|
90
|
+
| 🌐 پروکسی/Tor | پشتیبانی کامل از SOCKS5/HTTP |
|
|
91
|
+
| 🧭 استخر پروکسی خودکار | تست/کش/رتست خودکار از روی لیست پروکسی خودت — برای کسایی که پروکسی بلد نیستن |
|
|
92
|
+
| 🔁 Fallback هوشمند | تعویض خودکار کلاینت پخش یوتیوب هنگام تشخیص بات |
|
|
93
|
+
| 🏷️ دستهبندی خطا | Region Locked، Private، Bot Detection و... در خلاصهی نهایی |
|
|
94
|
+
| 🩺 `odl --doctor` | تشخیص کامل سلامت نصب در یک نگاه |
|
|
95
|
+
| ⬆️ `odl --update` | آپدیت و بررسی نسخهی yt-dlp |
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 📋 پیشنیازها
|
|
100
|
+
|
|
101
|
+
- Python 3.9 یا بالاتر
|
|
102
|
+
- کتابخانههای `yt-dlp` · `rich` · `cryptography`
|
|
103
|
+
- `ffmpeg` (برای merge صدا/تصویر و تبدیل زیرنویس)
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 📦 نصب
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# نصب کتابخانههای مورد نیاز
|
|
111
|
+
pip install yt-dlp rich cryptography --break-system-packages
|
|
112
|
+
|
|
113
|
+
# کپی کردن اسکریپت اصلی
|
|
114
|
+
mkdir -p ~/.local/bin
|
|
115
|
+
cp odl.py ~/.local/bin/odl
|
|
116
|
+
chmod +x ~/.local/bin/odl
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
اگه `~/.local/bin` توی PATH نیست:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
|
|
123
|
+
source ~/.zshrc
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
بررسی سلامت نصب:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
odl --doctor
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## 🍪 دریافت کوکی — راهنمای گامبهگام
|
|
135
|
+
|
|
136
|
+
> اکثر دانلودها (مخصوصاً پلیلیستها) به کوکی نیاز دارن تا یوتیوب درخواست رو بات تشخیص نده.
|
|
137
|
+
|
|
138
|
+
### 🖥️ روی لینوکس دسکتاپ
|
|
139
|
+
**کاری لازم نیست.** فقط یکبار با فایرفاکس یا کروم وارد youtube.com شو؛ اولین اجرای `odl` خودش کوکی رو مستقیم از مرورگرت میخونه و رمزنگاری میکنه.
|
|
140
|
+
|
|
141
|
+
### 🤖 روی اندروید با روت واقعی
|
|
142
|
+
**کاری لازم نیست.** فقط با فایرفاکس اندروید وارد youtube.com شو؛ `odl` مستقیم از دیتابیس فایرفاکس میخونه.
|
|
143
|
+
|
|
144
|
+
### 📱 روی اندروید بدون روت (دستی)
|
|
145
|
+
|
|
146
|
+
| مرحله | کار |
|
|
147
|
+
|---|---|
|
|
148
|
+
| ۱ | فایرفاکس رو باز کن و با یک اکانت گوگل (ترجیحاً فرعی) وارد youtube.com شو |
|
|
149
|
+
| ۲ | چند ویدیو ببین تا رفتار حساب طبیعی بهنظر برسه |
|
|
150
|
+
| ۳ | افزونهی **cookies.txt** رو از addons.mozilla.org نصب کن |
|
|
151
|
+
| ۴ | توی تب یوتیوب، آیکون افزونه رو بزن و کوکی رو export کن (فایلی مثل `cookies.txt` توی Download ذخیره میشه) |
|
|
152
|
+
| ۵ | همین! دفعهی بعد `odl` رو با هر لینکی بزنی، خودش فایل رو پیدا میکنه، رمز اصلی میپرسه، رمزنگاری میکنه و دانلود رو ادامه میده |
|
|
153
|
+
|
|
154
|
+
### 🔑 اگر رمز اصلی رو فراموش کردی
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
odl --reset-cookies
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
فایل رمزنگاریشده حذف میشه؛ فقط یک کوکی جدید export کن و دوباره اجرا کن.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## 🚀 استفاده
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
odl "لینک ویدیو" # دانلود تکی، کیفیت پیشفرض 480p
|
|
168
|
+
odl -q 1080 "لینک" # انتخاب کیفیت
|
|
169
|
+
odl -a "لینک" # فقط صدا (mp3)
|
|
170
|
+
odl -s -fs "لینک" # زیرنویس انگلیسی + فارسی
|
|
171
|
+
odl -p -q 720 "لینک پلیلیست" # دانلود کل پلیلیست
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 🌐 پیدا کردن خودکار پروکسی (برای کسایی که پروکسی بلد نیستن)
|
|
177
|
+
|
|
178
|
+
اگه پروکسی سرت نمیشه یا نمیدونی کدوم پروکسی هنوز زندهست، لازم نیست دستی امتحان کنی. یک فایل متنی (یا لینک یک فایل متنی) با یک پروکسی در هر خط بده، بقیهش خودکاره:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# proxies.txt — هر خط یک پروکسی؛ خط خالی و خط # نادیده گرفته میشه
|
|
182
|
+
# http://1.2.3.4:8080
|
|
183
|
+
# socks5://5.6.7.8:1080
|
|
184
|
+
|
|
185
|
+
odl --proxy-pool ~/proxies.txt "لینک ویدیو"
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
odl خودش یکییکی پروکسیها رو با یک تست واقعی (نه فقط پینگ) امتحان میکنه، اولین پروکسی سالم رو ذخیره میکنه، و دفعهی بعد قبل از هر دانلود اول همون رو دوباره تست میکنه؛ اگه هنوز زنده بود، دیگه سراغ بقیهی لیست نمیره. اگه مرده بود، خودش دوباره از اول لیست میگرده.
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# فقط تست کن ببین کدوم پروکسیها الان زندهن، بدون دانلود
|
|
192
|
+
odl --test-proxies --proxy-pool ~/proxies.txt
|
|
193
|
+
|
|
194
|
+
# اگه نمیخوای هر بار --proxy-pool رو تایپ کنی، یکبار پیشفرضش کن
|
|
195
|
+
odl --set proxy_pool_source=~/proxies.txt
|
|
196
|
+
odl "لینک ویدیو" # از این به بعد خودکار از همین لیست استفاده میکنه
|
|
197
|
+
|
|
198
|
+
# مجبورش کن نادیده بگیره پروکسی کششده رو و کل لیست رو دوباره اسکن کنه
|
|
199
|
+
odl --proxy-pool-refresh "لینک ویدیو"
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
⚠️ **نکتهی امنیتی مهم:** پروکسیهای رایگان عمومی از منابع نامعتبر میتونن ترافیک شبکهت رو ببینن یا حتی دستکاری کنن. odl فقط از منبعی استفاده میکنه که خودت بهش دادی — هیچجا خودش دنبال پروکسی روی اینترنت نمیگرده. فقط از منبعی استفاده کن که بهش اعتماد داری.
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## ⚙️ همهی گزینههای خط فرمان
|
|
207
|
+
|
|
208
|
+
| گزینه | توضیح |
|
|
209
|
+
|---|---|
|
|
210
|
+
| `-p, --playlist` | حالت پلیلیست |
|
|
211
|
+
| `-q, --quality` | کیفیت: 144/240/360/480/720/1080/1440/2160 |
|
|
212
|
+
| `-s, --sub-en` | زیرنویس انگلیسی |
|
|
213
|
+
| `-fs, --sub-fa` | زیرنویس فارسی (در صورت وجود) |
|
|
214
|
+
| `-a, --audio-only` | فقط صدا (mp3) |
|
|
215
|
+
| `-o, --output` | مسیر ذخیرهسازی سفارشی |
|
|
216
|
+
| `-b, --batch` | تعداد دانلود همزمان در پلیلیست |
|
|
217
|
+
| `-x, --proxy` | آدرس پروکسی، مثلاً `socks5h://127.0.0.1:9050` |
|
|
218
|
+
| `--proxy-pool` | فایل/لینک لیست پروکسی؛ تست و کش و چرخش خودکار |
|
|
219
|
+
| `--proxy-pool-refresh` | نادیده گرفتن کش و اسکن کامل دوبارهی لیست پروکسی |
|
|
220
|
+
| `--test-proxies` | فقط تست کن کدوم پروکسیها زندهن، بدون دانلود |
|
|
221
|
+
| `--player-client` | اجبار کلاینت پخش خاص (مثلاً `android`) |
|
|
222
|
+
| `--bypass` | استخراج سبکتر/سریعتر |
|
|
223
|
+
| `--secure-cookies` | رمزنگاری دستی کوکی فعلی |
|
|
224
|
+
| `--reset-cookies` | حذف کوکی رمزنگاریشده (فراموشی رمز) |
|
|
225
|
+
| `--import-cookies` | وادار کردن به import مجدد کوکی |
|
|
226
|
+
| `--cookie-status` | نمایش وضعیت فعلی کوکی |
|
|
227
|
+
| `--no-estimate` | رد شدن از تخمین حجم (پلیلیست بزرگ) |
|
|
228
|
+
| `--debug` | اطلاعات کامل دیباگ + traceback |
|
|
229
|
+
| `--doctor` | بررسی سلامت نصب |
|
|
230
|
+
| `--check-update` | بررسی آپدیت yt-dlp بدون نصب |
|
|
231
|
+
| `--update` | آپدیت yt-dlp |
|
|
232
|
+
| `--version` | نمایش نسخه |
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 🔧 عیبیابی
|
|
237
|
+
|
|
238
|
+
| مشکل | راهحل |
|
|
239
|
+
|---|---|
|
|
240
|
+
| `Sign in to confirm you're not a bot` | کوکی معتبر نیست/منقضی شده → `odl --import-cookies` |
|
|
241
|
+
| خطای Region/جغرافیایی | از `-x` یا `--proxy-pool` با یه پروکسی/Tor در کشور مجاز استفاده کن |
|
|
242
|
+
| رمز اصلی یادت رفته | `odl --reset-cookies` و export مجدد |
|
|
243
|
+
| نمیدونی کدوم پروکسی زندهست | `odl --test-proxies --proxy-pool ~/proxies.txt` |
|
|
244
|
+
| تشخیص محیط (`odl --doctor`) اشتباهه | `ODL_FORCE_ENVIRONMENT=kali_nethunter odl --doctor` (مقادیر مجاز: `android_termux`، `kali_nethunter`، `desktop_linux`، `wsl`، `other`) |
|
|
245
|
+
| نمیدونی مشکل از کجاست | `odl --doctor` و `odl --debug "لینک"` |
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
## 🗑️ حذف کامل
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
rm -f ~/.local/bin/odl
|
|
253
|
+
rm -rf ~/.config/opendl
|
|
254
|
+
rm -f ~/cookies.txt
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## 🧭 نقشهی راه
|
|
260
|
+
|
|
261
|
+
آپدیت خودکار در پسزمینه · پروفایلهای چندگانهی کوکی · تاریخچهی دانلود · حالت تعاملی · محدودیت سرعت · زمانبندی دانلود · حذف موارد تکراری · اعلان بعد از اتمام · خروجی JSON · تستهای خودکار (pytest)
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## 📄 لایسنس
|
|
266
|
+
|
|
267
|
+
MIT — فایل [LICENSE](LICENSE) رو ببین.
|
|
268
|
+
|
|
269
|
+
<br>
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
<a name="-english"></a>
|
|
274
|
+
# 🇬🇧 English
|
|
275
|
+
|
|
276
|
+
<div align="center">
|
|
277
|
+
|
|
278
|
+
**A simple, secure, resumable YouTube downloader for the command line**
|
|
279
|
+
|
|
280
|
+
Built on [yt-dlp](https://github.com/yt-dlp/yt-dlp) · Command: `odl`
|
|
281
|
+
|
|
282
|
+
</div>
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## ⚡ Quick Start
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
pip install git+https://github.com/msoleimani62/open-downloader-cli.git
|
|
290
|
+
odl "YouTube video URL"
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
That's it. On first run, if you don't have a `cookies.txt`, it shows you the export guide; if you do, it encrypts it with a master password and starts downloading.
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## ✨ Features
|
|
298
|
+
|
|
299
|
+
| Feature | Description |
|
|
300
|
+
|---|---|
|
|
301
|
+
| 🎬 Single / playlist downloads | Live colored progress bars, concurrent playlist downloads |
|
|
302
|
+
| ⏸️ Automatic resume | Interrupted downloads (network drops, phone reboots) continue automatically |
|
|
303
|
+
| 🍪 Automatic cookie retrieval | Adapts to the environment — desktop, rooted Android, or plain Android |
|
|
304
|
+
| 🔐 Cookie encryption | AES (via Fernet) + a master password that is never stored anywhere |
|
|
305
|
+
| 🌐 Proxy/Tor support | Full SOCKS5/HTTP support |
|
|
306
|
+
| 🧭 Automatic proxy pool | Auto test/cache/retest from your own proxy list — for people who don't know proxies |
|
|
307
|
+
| 🔁 Smart fallback | Automatic YouTube playback-client switching on bot detection |
|
|
308
|
+
| 🏷️ Error categorization | Region Locked, Private, Bot Detection, etc. in the final summary |
|
|
309
|
+
| 🩺 `odl --doctor` | Full installation health check at a glance |
|
|
310
|
+
| ⬆️ `odl --update` | Update and check the yt-dlp version |
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## 📋 Requirements
|
|
315
|
+
|
|
316
|
+
- Python 3.9+
|
|
317
|
+
- `yt-dlp` · `rich` · `cryptography`
|
|
318
|
+
- `ffmpeg` (for merging audio/video and converting subtitles)
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## 📦 Installation
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
pip install yt-dlp rich cryptography --break-system-packages
|
|
326
|
+
|
|
327
|
+
mkdir -p ~/.local/bin
|
|
328
|
+
cp odl.py ~/.local/bin/odl
|
|
329
|
+
chmod +x ~/.local/bin/odl
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
If `~/.local/bin` isn't in your PATH:
|
|
333
|
+
|
|
334
|
+
```bash
|
|
335
|
+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
|
|
336
|
+
source ~/.zshrc
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
Check installation health:
|
|
340
|
+
|
|
341
|
+
```bash
|
|
342
|
+
odl --doctor
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
---
|
|
346
|
+
|
|
347
|
+
## 🍪 Getting Cookies — Step by Step
|
|
348
|
+
|
|
349
|
+
> Most downloads (especially playlists) need cookies so YouTube doesn't flag the request as a bot.
|
|
350
|
+
|
|
351
|
+
### 🖥️ Desktop Linux
|
|
352
|
+
**Nothing to do.** Just sign in to youtube.com once with Firefox or Chrome; the first `odl` run reads cookies directly from your browser and encrypts them.
|
|
353
|
+
|
|
354
|
+
### 🤖 Rooted Android
|
|
355
|
+
**Nothing to do.** Just sign in to youtube.com with Firefox for Android; `odl` reads directly from the Firefox database.
|
|
356
|
+
|
|
357
|
+
### 📱 Non-rooted Android (manual)
|
|
358
|
+
|
|
359
|
+
| Step | Action |
|
|
360
|
+
|---|---|
|
|
361
|
+
| 1 | Open Firefox and sign in to youtube.com with a Google account (a secondary one is recommended) |
|
|
362
|
+
| 2 | Watch a couple of videos so the account looks naturally active |
|
|
363
|
+
| 3 | Install the **cookies.txt** add-on from addons.mozilla.org |
|
|
364
|
+
| 4 | On the YouTube tab, tap the add-on icon and export the cookies (saved as `cookies.txt` in Downloads) |
|
|
365
|
+
| 5 | Done! Next `odl` run finds the file, asks for a master password, encrypts it, and continues your download |
|
|
366
|
+
|
|
367
|
+
### 🔑 If you forget the master password
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
odl --reset-cookies
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
The encrypted file is deleted; export a fresh cookie file and run `odl` again.
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## 🚀 Usage
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
odl "video URL" # single download, default 480p
|
|
381
|
+
odl -q 1080 "URL" # choose quality
|
|
382
|
+
odl -a "URL" # audio only (mp3)
|
|
383
|
+
odl -s -fs "URL" # English + Persian subtitles
|
|
384
|
+
odl -p -q 720 "playlist URL" # download an entire playlist
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
## 🌐 Automatic Proxy Discovery (for people who don't know proxies)
|
|
390
|
+
|
|
391
|
+
If you don't understand proxies or don't know which one is still alive, you don't have to test them by hand. Give odl a text file (or a URL to one) with one proxy per line, and it handles the rest:
|
|
392
|
+
|
|
393
|
+
```bash
|
|
394
|
+
# proxies.txt — one proxy per line; blank lines and # lines are ignored
|
|
395
|
+
# http://1.2.3.4:8080
|
|
396
|
+
# socks5://5.6.7.8:1080
|
|
397
|
+
|
|
398
|
+
odl --proxy-pool ~/proxies.txt "video URL"
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
odl tests each proxy with a real check (not just a ping), caches the first working one, and before every later download re-tests that same cached proxy first; if it's still alive, it skips the rest of the list entirely. If it died, it automatically scans the list again from the top.
|
|
402
|
+
|
|
403
|
+
```bash
|
|
404
|
+
# just check which proxies are alive right now, without downloading
|
|
405
|
+
odl --test-proxies --proxy-pool ~/proxies.txt
|
|
406
|
+
|
|
407
|
+
# set a default so you don't have to type --proxy-pool every time
|
|
408
|
+
odl --set proxy_pool_source=~/proxies.txt
|
|
409
|
+
odl "video URL" # automatically uses that list from now on
|
|
410
|
+
|
|
411
|
+
# force it to ignore the cached proxy and re-scan the whole list
|
|
412
|
+
odl --proxy-pool-refresh "video URL"
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
⚠️ **Security note:** proxies from untrusted public sources can see, or even tamper with, your network traffic. odl only ever uses the source *you* give it — it never searches the internet for proxies on its own. Only point it at a source you trust.
|
|
416
|
+
|
|
417
|
+
---
|
|
418
|
+
|
|
419
|
+
## ⚙️ All CLI Options
|
|
420
|
+
|
|
421
|
+
| Option | Description |
|
|
422
|
+
|---|---|
|
|
423
|
+
| `-p, --playlist` | playlist mode |
|
|
424
|
+
| `-q, --quality` | 144/240/360/480/720/1080/1440/2160 |
|
|
425
|
+
| `-s, --sub-en` | English subtitles |
|
|
426
|
+
| `-fs, --sub-fa` | Persian subtitles (if available) |
|
|
427
|
+
| `-a, --audio-only` | audio only (mp3) |
|
|
428
|
+
| `-o, --output` | custom output directory |
|
|
429
|
+
| `-b, --batch` | concurrent downloads in playlist mode |
|
|
430
|
+
| `-x, --proxy` | proxy address, e.g. `socks5h://127.0.0.1:9050` |
|
|
431
|
+
| `--proxy-pool` | proxy list file/URL; automatic test, cache, and rotation |
|
|
432
|
+
| `--proxy-pool-refresh` | ignore the cache and re-scan the whole proxy list |
|
|
433
|
+
| `--test-proxies` | just check which proxies are alive, without downloading |
|
|
434
|
+
| `--player-client` | force a specific playback client (e.g. `android`) |
|
|
435
|
+
| `--bypass` | lighter/faster extraction |
|
|
436
|
+
| `--secure-cookies` | manually encrypt the current cookie file |
|
|
437
|
+
| `--reset-cookies` | delete the encrypted cookie file (forgot password) |
|
|
438
|
+
| `--import-cookies` | force a fresh cookie import |
|
|
439
|
+
| `--cookie-status` | show current cookie status |
|
|
440
|
+
| `--no-estimate` | skip size estimation (large playlists) |
|
|
441
|
+
| `--debug` | full debug info + traceback |
|
|
442
|
+
| `--doctor` | check installation health |
|
|
443
|
+
| `--check-update` | check for a yt-dlp update without installing |
|
|
444
|
+
| `--update` | update yt-dlp |
|
|
445
|
+
| `--version` | show version |
|
|
446
|
+
|
|
447
|
+
---
|
|
448
|
+
|
|
449
|
+
## 🔧 Troubleshooting
|
|
450
|
+
|
|
451
|
+
| Problem | Solution |
|
|
452
|
+
|---|---|
|
|
453
|
+
| `Sign in to confirm you're not a bot` | Cookie invalid/expired → `odl --import-cookies` |
|
|
454
|
+
| Region/geo error | Use `-x` or `--proxy-pool` with a proxy/Tor exit in an allowed country |
|
|
455
|
+
| Forgot master password | `odl --reset-cookies` and re-export |
|
|
456
|
+
| Not sure which proxy is alive | `odl --test-proxies --proxy-pool ~/proxies.txt` |
|
|
457
|
+
| Environment detection (`odl --doctor`) is wrong | `ODL_FORCE_ENVIRONMENT=kali_nethunter odl --doctor` (allowed values: `android_termux`, `kali_nethunter`, `desktop_linux`, `wsl`, `other`) |
|
|
458
|
+
| Not sure what's wrong | `odl --doctor` and `odl --debug "URL"` |
|
|
459
|
+
|
|
460
|
+
---
|
|
461
|
+
|
|
462
|
+
## 🗑️ Uninstallation
|
|
463
|
+
|
|
464
|
+
```bash
|
|
465
|
+
rm -f ~/.local/bin/odl
|
|
466
|
+
rm -rf ~/.config/opendl
|
|
467
|
+
rm -f ~/cookies.txt
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
---
|
|
471
|
+
|
|
472
|
+
## 🧭 Roadmap
|
|
473
|
+
|
|
474
|
+
Background auto-update · multiple cookie profiles · download history · interactive mode · speed limiting · scheduled downloads · duplicate detection · completion notifications · JSON output · automated tests (pytest)
|
|
475
|
+
|
|
476
|
+
---
|
|
477
|
+
|
|
478
|
+
## 📄 License
|
|
479
|
+
|
|
480
|
+
MIT — see [LICENSE](LICENSE).
|