Skip to content

Commit

Permalink
feat: add aria2 (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
oElberte authored Mar 4, 2023
1 parent f7ea35b commit 0f3dd86
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ Use the button above! It should work like a magic but with limited functionaliti
1. clone code
2. install ffmpeg
3. install Python 3.6+
4. pip3 install -r requirements.txt
5. set environment variables `TOKEN`, `APP_ID` and `APP_HASH`, and more if you like.
6. `python3 ytdl_bot.py`
4. install aria2 and add to PATH
5. pip3 install -r requirements.txt
6. set environment variables `TOKEN`, `APP_ID` and `APP_HASH`, and more if you like.
7. `python3 ytdl_bot.py`

## Docker

Expand Down
2 changes: 1 addition & 1 deletion apk.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ffmpeg vnstat git
ffmpeg vnstat git aria2
2 changes: 2 additions & 0 deletions ytdlbot/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ def ytdl_download(url, tempdir, bm, **kwargs) -> dict:
response = {"status": True, "error": "", "filepath": []}
output = pathlib.Path(tempdir, "%(title).70s.%(ext)s").as_posix()
ydl_opts = {
'external_downloader': 'aria2c',
'external_downloader_args': ['--min-split-size=1M', '--max-connection-per-server=16', '--max-concurrent-downloads=16', '--split=16'],
'progress_hooks': [lambda d: download_hook(d, bm)],
'outtmpl': output,
'restrictfilenames': False,
Expand Down

0 comments on commit 0f3dd86

Please sign in to comment.