]> dgit.raspbian.org Git - git-annex.git/commit
default to yt-dlp and fix progress parsing bugs
authorJoey Hess <joeyh@joeyh.name>
Sat, 27 May 2023 16:45:16 +0000 (12:45 -0400)
committerJoey Hess <joeyh@joeyh.name>
Sat, 27 May 2023 17:04:53 +0000 (13:04 -0400)
commitf2db6da938d3b78e3db6397eed54da41bedaa394
tree09b5a13d8b0d9f276a5ff39204fba9053238d677
parentf1cdb79ca4ac7c1ea264098bc59f47bd3f99814f
default to yt-dlp and fix progress parsing bugs

I noticed git-annex was using a lot of CPU when downloading from youtube,
and was not displaying progress. Turns out that yt-dlp (and I think also
youtube-dl) sometimes only knows an estimated size, not the actual size,
and displays the progress output slightly differently for that. That broke
the parser. And, the parser was feeding chunks that failed to parse back
as a remainder, which caused it to try to re-parse the entire output each
time, so it got slower and slower.

Using --progress-template like this should avoid parsing problems as well
as future proof against output changes. But it will work with only yt-dlp.

So, this seemed like the right time to deprecate youtube-dl, and default
to yt-dlp when available.

git-annex will still use youtube-dl if that's all that's available.
However, since the progress parser for youtube-dl was buggy, and I don't
want to maintain two different progress parsers (especially since
youtube-dl is no longer in debian unstable having been replaced by
yt-dlp), made git-annex no longer try to parse youtube-dl's progress.

Also, updated docs for yt-dlp being default. It did not seem worth
renaming annex.youtube-dl-options and annex.youtube-dl-command.

Note that yt-dlp does not seem to document the fields available in the
progress template. I found them by reading the source and looking at
the templates it uses internally. Also note that the use of "i" (rather
than "s") in progressTemplate makes it display floats rounded to integers;
particularly the estimated total size can be a float. That also does not
seem to be documented but I assume is a python thing?

Sponsored-by: Joshua Antonishen on Patreon
Annex/YoutubeDl.hs
CHANGELOG
doc/git-annex-addurl.mdwn
doc/git-annex-importfeed.mdwn
doc/git-annex.mdwn
doc/tips/downloading_podcasts.mdwn
doc/tips/using_the_web_as_a_special_remote.mdwn