tgturbo 1.0.0__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.
- tgturbo-1.0.0/LICENSE +21 -0
- tgturbo-1.0.0/PKG-INFO +154 -0
- tgturbo-1.0.0/README.md +122 -0
- tgturbo-1.0.0/pyproject.toml +55 -0
- tgturbo-1.0.0/setup.cfg +4 -0
- tgturbo-1.0.0/src/tgturbo/__init__.py +3 -0
- tgturbo-1.0.0/src/tgturbo/__main__.py +6 -0
- tgturbo-1.0.0/src/tgturbo/app.py +824 -0
- tgturbo-1.0.0/src/tgturbo/cli.py +277 -0
- tgturbo-1.0.0/src/tgturbo/config.py +73 -0
- tgturbo-1.0.0/src/tgturbo.egg-info/PKG-INFO +154 -0
- tgturbo-1.0.0/src/tgturbo.egg-info/SOURCES.txt +14 -0
- tgturbo-1.0.0/src/tgturbo.egg-info/dependency_links.txt +1 -0
- tgturbo-1.0.0/src/tgturbo.egg-info/entry_points.txt +2 -0
- tgturbo-1.0.0/src/tgturbo.egg-info/requires.txt +8 -0
- tgturbo-1.0.0/src/tgturbo.egg-info/top_level.txt +1 -0
tgturbo-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 YOUR NAME
|
|
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.
|
tgturbo-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tgturbo
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Fast Telegram media downloader: PDFs, videos, audio, photos. Channel browser, post-link and range mode, rich terminal UI.
|
|
5
|
+
Author-email: YOUR NAME <YOU@EMAIL.COM>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/YOURGITHUB/tgturbo
|
|
8
|
+
Project-URL: Issues, https://github.com/YOURGITHUB/tgturbo/issues
|
|
9
|
+
Keywords: telegram,downloader,pyrogram,kurigram,cli,termux
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
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 :: Communications :: Chat
|
|
22
|
+
Classifier: Topic :: Utilities
|
|
23
|
+
Requires-Python: >=3.9
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: kurigram>=2.1
|
|
27
|
+
Requires-Dist: rich>=13
|
|
28
|
+
Provides-Extra: fast
|
|
29
|
+
Requires-Dist: tgcrypto>=1.2.5; extra == "fast"
|
|
30
|
+
Requires-Dist: uvloop>=0.19; sys_platform != "win32" and extra == "fast"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# ⚡ tgturbo
|
|
34
|
+
|
|
35
|
+
Fast Telegram media downloader with a colourful terminal UI.
|
|
36
|
+
|
|
37
|
+
- Download **PDFs, videos, audio, photos, any document**
|
|
38
|
+
- Browse **any channel** or pick from **channels you've joined**
|
|
39
|
+
- Paste **one post link**, or a **start + end link** to grab every post in between (inclusive)
|
|
40
|
+
- Video files are **named from their caption** (e.g. `Maths - Probability - 14. Geometrical Probability.mp4`)
|
|
41
|
+
- Parallel downloads, live speed/ETA bars, automatic retries, shared FloodWait pause
|
|
42
|
+
- **Asks where to save every time**, remembers your last folder
|
|
43
|
+
- Works on Linux, macOS, Windows and **Termux (Android)**
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install tgturbo
|
|
49
|
+
pip install "tgturbo[fast]" # recommended: TgCrypto + uvloop = much faster downloads
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
> If you previously installed the original `pyrogram`, remove it first (both provide the
|
|
53
|
+
> `pyrogram` module): `pip uninstall -y pyrogram`
|
|
54
|
+
|
|
55
|
+
**Termux:** `pkg install python clang make libffi openssl` then the commands above.
|
|
56
|
+
If `tgturbo[fast]` fails to build, plain `pip install tgturbo` still works (just slower).
|
|
57
|
+
|
|
58
|
+
## First-time setup
|
|
59
|
+
|
|
60
|
+
1. Get a free **API ID** and **API hash**: https://my.telegram.org → *API development tools*.
|
|
61
|
+
2. Run:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
tgturbo setup
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
It asks for your API ID, API hash and a default folder, then starts. On first start Telegram
|
|
68
|
+
sends a login code to your account. After that you stay logged in.
|
|
69
|
+
|
|
70
|
+
> A *bot token* will **not** work: bots cannot read channel history. tgturbo logs in as **you**
|
|
71
|
+
> using the API ID/hash.
|
|
72
|
+
|
|
73
|
+
## Giving credentials — pick any way
|
|
74
|
+
|
|
75
|
+
| Way | Example |
|
|
76
|
+
|---|---|
|
|
77
|
+
| Interactive | `tgturbo setup` |
|
|
78
|
+
| Save once with arguments | `tgturbo config --api-id 123456 --api-hash abcdef...` |
|
|
79
|
+
| One-off (nothing saved) | `tgturbo --api-id 123456 --api-hash abcdef...` |
|
|
80
|
+
| Environment variables | `export TG_API_ID=123456 TG_API_HASH=abcdef...` |
|
|
81
|
+
|
|
82
|
+
Priority: **argument > environment variable > saved config**.
|
|
83
|
+
Saved settings live in a private file (`tgturbo config --path` shows where, permissions `600`).
|
|
84
|
+
|
|
85
|
+
## Commands
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
tgturbo start the downloader
|
|
89
|
+
tgturbo setup interactive first-time setup
|
|
90
|
+
tgturbo config --show show saved settings (hash is masked)
|
|
91
|
+
tgturbo config --reset delete saved settings
|
|
92
|
+
tgturbo logout delete the saved Telegram login
|
|
93
|
+
tgturbo --version
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Arguments (work on `tgturbo`, `tgturbo config`, `tgturbo setup`)
|
|
97
|
+
|
|
98
|
+
| Argument | Env var | Meaning |
|
|
99
|
+
|---|---|---|
|
|
100
|
+
| `--api-id ID` | `TG_API_ID` | Telegram API ID |
|
|
101
|
+
| `--api-hash HASH` | `TG_API_HASH` | Telegram API hash |
|
|
102
|
+
| `--phone +NUMBER` | `TG_PHONE` | skip the phone prompt on first login |
|
|
103
|
+
| `--channel @NAME` | `TG_CHANNEL` | default channel in the menu |
|
|
104
|
+
| `--download-dir DIR` | `TGTURBO_DOWNLOAD_DIR` | folder offered first when asking where to save |
|
|
105
|
+
| `--concurrent N` | `TGTURBO_CONCURRENT` | files at once, 1-10 (default 4) |
|
|
106
|
+
| `--transmissions N` | `TGTURBO_TRANSMISSIONS` | parallel chunk streams, 1-16 (default 8) |
|
|
107
|
+
| `--retries N` | `TGTURBO_RETRIES` | retries per file (default 4) |
|
|
108
|
+
| `--session NAME` | – | session name (default `tgturbo`) |
|
|
109
|
+
| `--workdir DIR` | – | folder for the session file |
|
|
110
|
+
| – | `TGTURBO_HOME` | move the whole config folder |
|
|
111
|
+
|
|
112
|
+
Examples:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
tgturbo config --concurrent 2 --download-dir ~/Videos # gentler on rate limits
|
|
116
|
+
tgturbo --download-dir /sdcard/Download/Lectures # this run only
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Using the menu
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
1) Open a channel by @name / link
|
|
123
|
+
2) My joined channels
|
|
124
|
+
3) Download from post link(s) 1 link = post · 2 links = start→end range
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Selection: `all` · `1,3,5` · `2-10` · `/keyword` to filter · `n` next page · `p` previous · `q` quit.
|
|
128
|
+
After choosing files you pick the save folder (Enter = last used).
|
|
129
|
+
|
|
130
|
+
## Rate limits
|
|
131
|
+
|
|
132
|
+
Telegram doesn't publish exact limits. When you ask for too much too fast it replies with a
|
|
133
|
+
**FloodWait** (a temporary wait, not a ban). tgturbo pauses all downloads together and resumes
|
|
134
|
+
automatically. For batches of 50+ files use `--concurrent 2` or `3`.
|
|
135
|
+
|
|
136
|
+
## Troubleshooting
|
|
137
|
+
|
|
138
|
+
| Problem | Fix |
|
|
139
|
+
|---|---|
|
|
140
|
+
| `database is locked` | another tgturbo is running: `pkill -f tgturbo`, then retry |
|
|
141
|
+
| `TgCrypto is missing` warning | `pip install "tgturbo[fast]"` (speed only, not an error) |
|
|
142
|
+
| `There is no current event loop` | `pip uninstall -y pyrogram && pip install -U kurigram` |
|
|
143
|
+
| Want to reuse an old `my_session.session` | `tgturbo --workdir . --session my_session` (in the folder holding it) |
|
|
144
|
+
| Login stuck / wrong account | `tgturbo logout` then start again |
|
|
145
|
+
|
|
146
|
+
## Responsible use
|
|
147
|
+
|
|
148
|
+
Only download content you have the right to access and keep. Respect copyright, the
|
|
149
|
+
channel owners' rules and Telegram's Terms of Service. Never share your API hash or `.session`
|
|
150
|
+
file — anyone with them can access your account.
|
|
151
|
+
|
|
152
|
+
## License
|
|
153
|
+
|
|
154
|
+
MIT
|
tgturbo-1.0.0/README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# ⚡ tgturbo
|
|
2
|
+
|
|
3
|
+
Fast Telegram media downloader with a colourful terminal UI.
|
|
4
|
+
|
|
5
|
+
- Download **PDFs, videos, audio, photos, any document**
|
|
6
|
+
- Browse **any channel** or pick from **channels you've joined**
|
|
7
|
+
- Paste **one post link**, or a **start + end link** to grab every post in between (inclusive)
|
|
8
|
+
- Video files are **named from their caption** (e.g. `Maths - Probability - 14. Geometrical Probability.mp4`)
|
|
9
|
+
- Parallel downloads, live speed/ETA bars, automatic retries, shared FloodWait pause
|
|
10
|
+
- **Asks where to save every time**, remembers your last folder
|
|
11
|
+
- Works on Linux, macOS, Windows and **Termux (Android)**
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pip install tgturbo
|
|
17
|
+
pip install "tgturbo[fast]" # recommended: TgCrypto + uvloop = much faster downloads
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
> If you previously installed the original `pyrogram`, remove it first (both provide the
|
|
21
|
+
> `pyrogram` module): `pip uninstall -y pyrogram`
|
|
22
|
+
|
|
23
|
+
**Termux:** `pkg install python clang make libffi openssl` then the commands above.
|
|
24
|
+
If `tgturbo[fast]` fails to build, plain `pip install tgturbo` still works (just slower).
|
|
25
|
+
|
|
26
|
+
## First-time setup
|
|
27
|
+
|
|
28
|
+
1. Get a free **API ID** and **API hash**: https://my.telegram.org → *API development tools*.
|
|
29
|
+
2. Run:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
tgturbo setup
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
It asks for your API ID, API hash and a default folder, then starts. On first start Telegram
|
|
36
|
+
sends a login code to your account. After that you stay logged in.
|
|
37
|
+
|
|
38
|
+
> A *bot token* will **not** work: bots cannot read channel history. tgturbo logs in as **you**
|
|
39
|
+
> using the API ID/hash.
|
|
40
|
+
|
|
41
|
+
## Giving credentials — pick any way
|
|
42
|
+
|
|
43
|
+
| Way | Example |
|
|
44
|
+
|---|---|
|
|
45
|
+
| Interactive | `tgturbo setup` |
|
|
46
|
+
| Save once with arguments | `tgturbo config --api-id 123456 --api-hash abcdef...` |
|
|
47
|
+
| One-off (nothing saved) | `tgturbo --api-id 123456 --api-hash abcdef...` |
|
|
48
|
+
| Environment variables | `export TG_API_ID=123456 TG_API_HASH=abcdef...` |
|
|
49
|
+
|
|
50
|
+
Priority: **argument > environment variable > saved config**.
|
|
51
|
+
Saved settings live in a private file (`tgturbo config --path` shows where, permissions `600`).
|
|
52
|
+
|
|
53
|
+
## Commands
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
tgturbo start the downloader
|
|
57
|
+
tgturbo setup interactive first-time setup
|
|
58
|
+
tgturbo config --show show saved settings (hash is masked)
|
|
59
|
+
tgturbo config --reset delete saved settings
|
|
60
|
+
tgturbo logout delete the saved Telegram login
|
|
61
|
+
tgturbo --version
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Arguments (work on `tgturbo`, `tgturbo config`, `tgturbo setup`)
|
|
65
|
+
|
|
66
|
+
| Argument | Env var | Meaning |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| `--api-id ID` | `TG_API_ID` | Telegram API ID |
|
|
69
|
+
| `--api-hash HASH` | `TG_API_HASH` | Telegram API hash |
|
|
70
|
+
| `--phone +NUMBER` | `TG_PHONE` | skip the phone prompt on first login |
|
|
71
|
+
| `--channel @NAME` | `TG_CHANNEL` | default channel in the menu |
|
|
72
|
+
| `--download-dir DIR` | `TGTURBO_DOWNLOAD_DIR` | folder offered first when asking where to save |
|
|
73
|
+
| `--concurrent N` | `TGTURBO_CONCURRENT` | files at once, 1-10 (default 4) |
|
|
74
|
+
| `--transmissions N` | `TGTURBO_TRANSMISSIONS` | parallel chunk streams, 1-16 (default 8) |
|
|
75
|
+
| `--retries N` | `TGTURBO_RETRIES` | retries per file (default 4) |
|
|
76
|
+
| `--session NAME` | – | session name (default `tgturbo`) |
|
|
77
|
+
| `--workdir DIR` | – | folder for the session file |
|
|
78
|
+
| – | `TGTURBO_HOME` | move the whole config folder |
|
|
79
|
+
|
|
80
|
+
Examples:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
tgturbo config --concurrent 2 --download-dir ~/Videos # gentler on rate limits
|
|
84
|
+
tgturbo --download-dir /sdcard/Download/Lectures # this run only
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Using the menu
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
1) Open a channel by @name / link
|
|
91
|
+
2) My joined channels
|
|
92
|
+
3) Download from post link(s) 1 link = post · 2 links = start→end range
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Selection: `all` · `1,3,5` · `2-10` · `/keyword` to filter · `n` next page · `p` previous · `q` quit.
|
|
96
|
+
After choosing files you pick the save folder (Enter = last used).
|
|
97
|
+
|
|
98
|
+
## Rate limits
|
|
99
|
+
|
|
100
|
+
Telegram doesn't publish exact limits. When you ask for too much too fast it replies with a
|
|
101
|
+
**FloodWait** (a temporary wait, not a ban). tgturbo pauses all downloads together and resumes
|
|
102
|
+
automatically. For batches of 50+ files use `--concurrent 2` or `3`.
|
|
103
|
+
|
|
104
|
+
## Troubleshooting
|
|
105
|
+
|
|
106
|
+
| Problem | Fix |
|
|
107
|
+
|---|---|
|
|
108
|
+
| `database is locked` | another tgturbo is running: `pkill -f tgturbo`, then retry |
|
|
109
|
+
| `TgCrypto is missing` warning | `pip install "tgturbo[fast]"` (speed only, not an error) |
|
|
110
|
+
| `There is no current event loop` | `pip uninstall -y pyrogram && pip install -U kurigram` |
|
|
111
|
+
| Want to reuse an old `my_session.session` | `tgturbo --workdir . --session my_session` (in the folder holding it) |
|
|
112
|
+
| Login stuck / wrong account | `tgturbo logout` then start again |
|
|
113
|
+
|
|
114
|
+
## Responsible use
|
|
115
|
+
|
|
116
|
+
Only download content you have the right to access and keep. Respect copyright, the
|
|
117
|
+
channel owners' rules and Telegram's Terms of Service. Never share your API hash or `.session`
|
|
118
|
+
file — anyone with them can access your account.
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
|
+
MIT
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
# If this name is taken on PyPI, change it here (the `tgturbo` command and the
|
|
7
|
+
# import package can stay the same).
|
|
8
|
+
name = "tgturbo"
|
|
9
|
+
dynamic = ["version"]
|
|
10
|
+
description = "Fast Telegram media downloader: PDFs, videos, audio, photos. Channel browser, post-link and range mode, rich terminal UI."
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
requires-python = ">=3.9"
|
|
13
|
+
license = { text = "MIT" }
|
|
14
|
+
authors = [{ name = "YOUR NAME", email = "YOU@EMAIL.COM" }]
|
|
15
|
+
keywords = ["telegram", "downloader", "pyrogram", "kurigram", "cli", "termux"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: End Users/Desktop",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Programming Language :: Python :: 3",
|
|
23
|
+
"Programming Language :: Python :: 3.9",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Programming Language :: Python :: 3.13",
|
|
28
|
+
"Topic :: Communications :: Chat",
|
|
29
|
+
"Topic :: Utilities",
|
|
30
|
+
]
|
|
31
|
+
dependencies = [
|
|
32
|
+
"kurigram>=2.1", # maintained Pyrogram fork (same `pyrogram` import, works on new Python)
|
|
33
|
+
"rich>=13",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.optional-dependencies]
|
|
37
|
+
# Strongly recommended: TgCrypto = much faster encryption, uvloop = faster event loop.
|
|
38
|
+
# Kept optional because TgCrypto needs a C compiler (e.g. on Termux: pkg install clang).
|
|
39
|
+
fast = [
|
|
40
|
+
"tgcrypto>=1.2.5",
|
|
41
|
+
"uvloop>=0.19; sys_platform != 'win32'",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[project.urls]
|
|
45
|
+
Homepage = "https://github.com/YOURGITHUB/tgturbo"
|
|
46
|
+
Issues = "https://github.com/YOURGITHUB/tgturbo/issues"
|
|
47
|
+
|
|
48
|
+
[project.scripts]
|
|
49
|
+
tgturbo = "tgturbo.cli:main"
|
|
50
|
+
|
|
51
|
+
[tool.setuptools.packages.find]
|
|
52
|
+
where = ["src"]
|
|
53
|
+
|
|
54
|
+
[tool.setuptools.dynamic]
|
|
55
|
+
version = { attr = "tgturbo.__version__" }
|
tgturbo-1.0.0/setup.cfg
ADDED