[HOW TO] use aria2c as yt-dlp --downloader

Post tutorials, HOWTO's and other useful resources here.
User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HOW TO] use aria2c as yt-dlp --downloader

Post#1 by Rava » 08 Jan 2023, 17:31

I stumbled upon a URL on vimeo (the video itself is hosted on *.akamaized.net ) yt-dlp could not download.
All i got was a bunch of these errors

Code: Select all

Got error: HTTP Error 400: Bad Request. Retrying fragment
The error count went up to 10 for the 1st segment, then it went to the next segment, same old same old. In short: the video could not be locally saved at all.

Searching for a solution I found this https://www.reddit.com/r/youtubedl/comm ... ut_doesnt/ and tried incorporating part of the idea like so
yt-dlp --downloader aria2c --no-part --restrict-filenames -N 4 --user-agent "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0" -f VIDEO+AUDIO URL
when the VIDEO is the chosen video format and AUDIO being the chosen audio format, all formats got listed okay via

Code: Select all

yt-dlp -F URL
And the URL of course being the video URL.

It looks like aria2c encountered an issue

Code: Select all

  -> [SocketCore.cc:1018] errorCode=1 SSL/TLS handshake failure: The TLS connection was non-properly terminated.
[#5f5b78 512KiB/544KiB(94%) CN:1 DL:66KiB]                                     
aria2 will resume download if the transfer is restarted.
If there are any errors, then see the log file. See '-l' option in help/man page for details.
[download] Got error: . Retrying fragments (1/10)...
[download] 100% of  140.60MiB in 00:06:52 at 349.39KiB/s
[dashsegments] Total fragments: 357
[dashsegments] Fragment downloads will be delegated to aria2c
[download] Destination: TITLE.m4a
[download] 100% of   25.03MiB in 00:01:16 at 334.21KiB/s
[Merger] Merging formats into TITLE.mp4
but looks like the error could be handled.

Of course you need aria2c as well for that trick to work.

You can create your own aria2 module by either downloading and converting the aria2 package manually or by using getmod.
I used getmod.
Rava wrote:
26 Dec 2022, 01:32
root@porteus:/# getmod -s aria2
aria2-1.36.0-x86_64-1salix15.0 (CLI Metalink/BiTorrent client)
persepolis-3.2.0-x86_64-1salix15.0 (Persepolis Download Manager is a GUI for aria2)
Cave! While the binary is called aria2c the package is called only aria2.

The above created this module:
1044480 bytes (1020 KB) - aria2-1.36.0-x86_64-1salix15.0.xzm with this contents:

Code: Select all

/usr
/usr/bin
/usr/bin/aria2c
/usr/share
/var
/var/lib
/var/lib/pkgtools
/var/lib/pkgtools/douninst.sh
/var/lib/pkgtools/packages
/var/lib/pkgtools/packages/aria2-1.36.0-x86_64-1salix15.0
/var/lib/pkgtools/scripts
/var/lib/pkgtools/setup
/var/lib/pkgtools/setup/tmp
/var/log
/var/log/packages
/var/log/pkgtools
/var/log/pkgtools/removed_packages
/var/log/pkgtools/removed_scripts
/var/log/scripts
/var/log/setup
The main part of course being the binary /usr/bin/aria2c
Cheers!
Yours Rava