-
-
Notifications
You must be signed in to change notification settings - Fork 217
Fix yt-dlp output file name #1382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
It still spams |
|
We also need to decide if youtube-dl support should be dropped or if this patch needs to be modified to use the old renaming code for youtube-dl, and new code for yt-dlp. youtube-dl doesn't support --paths, or complain about it, but outtmpl would need the absolute path for it to work. Then there is the renaming code that uses the unsupported filepath in youtube-dl. I'd say drop it due to no releases this year, but it does appear active and might get a release eventually. |
|
Do you get the '--paths' warnings only with youtube-dl (not yt-dlp)? Admittedly I did not test with youtube-dl. The support for original youtube-dl could be dropped, IMO. |
Only yt-dlp throws the warning, for every download. youtube-dl doesn't know about it and has no code to warn.
There is a chance that some distro doesn't have yt-dlp yet and would cause problems for users. We could drop it in January if they don't get a release out this year, but it might be good to continue supporting it until then. There is a new |
|
Strangely I don't see the warning here, although when looking at yt-dlp code I should. There should be no problem in using I'll look into switching the rename code on |
…empty Prevents file names with two periods before the extension.
83f8419 to
09b85d6
Compare
|
Now has separate renaming for yt-dlp and youtube-dl, uses Rebased to master, needs squashing later. |
|
I only tested this with yt-dlp, so please test with youtube-dl. |
|
Not tested, but code looks good. Thanks! |
|
I'll merge it in a week if nothing breaks during testing. |
Great, I'll squash this before that. |
Use separate code paths to rename output files from yt-dlp and
youtube-dl to the requested name ('tempname'). The output is always
renamed with yt-dlp.
Add the 'ext' to the output template. This is needed to unbreak
post-processing (like subtitle embedding). See yt-dlp issue #1844.
Use basename(tempname) for yt-dlp and tempname for youtube-dl as output
template, since we set the output path for yt-dlp in the 'paths' option.
Derive abstract classes CustomDownload and CustomDownloader from ABC from the abc module. Decorate abstract methods with @AbstractMethod. Add abstract 'partial_filename' property to CustomDownload and make it concrete in the derived DefaultDownload class. This property holds the full path of the temporary file where the episode is being downloaded or None, if the downloader does not use a previewable temporary file.
Add the 'partial_filename' property for a previewable temporary file. Get this filename from yt-dlp / youtube-dl by splitting the download into two parts, first get the extractor info which contains the 'ext', derive the temporary filename from that and the outtmpl and then download the file.
Add 'custom_downloader' member var to DownloadTask. Use it in episode.get_playback_url() to get a preview file name. Also add episode.can_preview() method and use it in ep.can_play().
Use it to decide if 'Preview' is shown in episode contect menu.
PR gpodder#1382 broke support for yt-dlp versions prior to 2022.6.22.1. Fixes gpodder#1439.
Get the output file name from the yt-dlp result dict and rename the file to what is expected (
tempname), if it is different.Add the extension to the output template. This is needed to unbreak post-processing (like subtitle embedding). See yt-dlp issue 1844.
Set the 'paths' param in ydl to get all downloaded files to the correct location.
In addition, the first commit makes
util.sanitize_filename_ext()to return a file name without an ending perdiod, if ext is empty.