Skip to content

Conversation

@auouymous
Copy link
Member

@auouymous auouymous commented Oct 18, 2021

This changes the youtube-dl extension to use yt-dlp if installed. As of yt-dlp 2021.10.09, the progress bar appears in the console and needs noprogress to suppress.

  • The mac and windows builds need to install yt-dlp and its dependencies.

Closes #1176.

@auouymous auouymous added the wip label Oct 18, 2021
@tpikonen
Copy link
Contributor

Could you also change youtube-dl to yt-dlp in the tools/requirements.txt file? The flatpak builds have their python deps generated from this file.

@pieska
Copy link
Contributor

pieska commented Oct 22, 2021

doesn't quite work for me, see comment in #1176

@auouymous
Copy link
Member Author

I haven't finished this because yt-dlp has an issue where it correctly writes the whole file to tempname.ext but incorrectly writes a little bit of the start to tempname. The extension then sees that tempname has a non-zero size and uses it instead of finding the actual file at tempname.ext. Playback is then cut short and deleting the episode leaves behind the tempname.ext file which must be manually removed outside of gpodder.

It has never happened when using yt-dlp outside of gpodder, so either an issue with embedding or the nopart option gpodder passes to it, which is something I don't use outside gpodder. The youtube-dl extension could be altered to always scan for tempname.ext files by eliminating the stat and size check lines. Scanning is probably the normal behavior for most downloads, so it shouldn't cause any slowdowns. Does annyone have better ideas or see any issues with this approach?

@tpikonen
Copy link
Contributor

The issue with --no-part should be fixed in yt-dlp, or at least reported. But current versions should be supported also.

@auouymous
Copy link
Member Author

There are 133 open/closed issues matching 'no-part', is/was there an issue with it that you know of?

It could also be related to using DASH formats which I do in gpodder but rarely outside of it. I haven't filed an issue yet, but cancelling a ytdl/ytdlp download leaves behind the separate video and audio parts. So the youtube-dl extension does need a bit better handling of the files created by ytdl/ytdlp.

@tpikonen
Copy link
Contributor

There are 133 open/closed issues matching 'no-part', is/was there an issue with it that you know of?

Sorry, no. For huge projects like yt-dlp it's usually more productive to just submit a patch rather than a bug report. That's of course easier said than done, and I don't have the time right now.

@elelay
Copy link
Member

elelay commented Jan 30, 2022

@auouymous

The youtube-dl extension could be altered to always scan for tempname.ext

No objection: whatever works with yt-dlp

@auouymous
Copy link
Member Author

This should now be ready to merge along with #1219, unless anyone sees something I missed. The only issue I have seen is that yt-dlp dumps a stack trace and three identical messages when it can't download a video without throttling. It would be nice if gpodder could prevent the dump and be notified of the throttling, but it should be fine for now.

@auouymous auouymous merged commit 1950a05 into gpodder:master Feb 8, 2022
@auouymous auouymous deleted the add-yt-dlp-support branch February 8, 2022 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch from youtube-dl to yt-dlp?

4 participants