-
Notifications
You must be signed in to change notification settings - Fork 114
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
Format Selection Bug: -f 137+136+140+139 should be -f 137/136+140/139 #680
Comments
Any yt-dlp option containing brackets must be surrounded by quotes, so this will not work:
But this will:
Tartube assumes that everything added to the Additional download options box should be passed on to yt-dlp unaltered, so it's up to users to familiarise themselves with yt-dlp documentation. (There are good reasons for not interfering, which I can explain if necessary.) About the rest of your problem, I will write more shortly... |
I have fixed the problem. I will try to finish the new release this weekend; the new release will include the fix. The problem was a holdover from the original youtube-dl-gui. I have changed the code, so that by default, this is generated:
...instead of this, which is clearly wrong:
In addition, if the selected formats are exclusively video-only and audio-only, then Tartube will generate this instead:
This special case is enabled for new installations by default; existing users must enable it by clicking Edit > General download options... > Formats > Advanced > For each video, combine the first video and first audio format from the preferred list |
Regarding your other issues:
During this new operation, the archive file is ignored, so it shouldn't be necessary to edit it manually. (If that does not solve your problem, then you can tell me.)
|
Yes I am aware of that. This specific problem happens if you click Re-Download and that download fails or is stopped for whatever reason. At that point, the entry is still in the archive.txt file so that blocks downloading the file again, and (I presume) the entry has already been removed from the tartube database so Re-Download is no longer an available menu option.
As near as I can figure, that is suppose to work but in reality, it does not always work. Here is a video that is missing only 139 : https://www.youtube.com/watch?v=8VLX_dqybpA The bottom line, is that the following does seem to work: -f "(137/136)+(140/139)" (Incidentally, relating to #1 above. If you were to stop the re-download at the point where you see it is only going to download video and no sound, then you will see that you can no longer re-download that file without editing the archive.txt file)
These other formats are minor subtypes of each main numbered format. Would it be possible to use only the first 3 numbers for tartube logic but allow the full format code to be used in the "List of preferred formats" and/or the "Type extractor code" box? |
The re-download menu option is only visible if Tartube's database thinks the video has been successfully downloaded. When you click this option, the following things happen:
Because the thumbnail is no longer visible in the Videos tab, it does look like the video has been removed from the database. But it's still there and is still visible in the list of videos. You can't "re-download" the video, but you can just download it as normal. In this case, I think the best strategy is to temporarily disable the archive file (Edit > System preferences > Operations > Archive > Allow downloader to create its own archive file) while you get the videos you want. I definitely don't want Tartube to make changes to the archive file; that would create a whole new bunch of problems. |
Understood. Perhaps you could ask the yt-dlp people to fix that particular problem; there is no reason why it should not behave the same as -f "137/136+140/139". |
I have modified the "Type extractor code" box so that it will accept anything; the change will be in this weekend's release. |
The issue was reported, replied to, and closed....before I even finished my coffee. :) Maybe I missed it in the documentation, but the official yt-dlp reply was:
|
Great, I'll amend Tartube code to use -f "(137/136)+(140/139)" instead of -f "137/136+140/139", in this situation. |
All changes are available in v2.5.100, released today. This release includes a change to re-checked and re-downloaded videos. If the re-download fails, the old files are restored, rather than being deleted immediately. This was a long thread and maybe I've forgotten something, but feel free to close it yourself if not. |
I noticed a couple things: If I manually add a format like 140-drc, then the logic breaks and the command reverts to: -f 137/136/135/134/140/139/140-drc Otherwise the command is: -f (137/136/135/134)+(140/139) I fear that people might not find the combine checkbox on the Advanced tab. Should there be something closer to where the formats are selected and/or should the default be to combine when audio and video are downloaded? or maybe a popup box??? |
Yes, because Tartube doesn't know what 140-drc is. The -f (A/B/C) + (D/E/F) only applies when Tartube knows that A/B/C/D/E/F are video-only or audio-only formats.
No, because of the shell environment, quotes are not needed and in fact they won't work.
I think the layout of the "Preferred" tab is already too complicated for normal users. People who care about 140-drc are the same people who will find the Advanced tab anyway. |
Couldn't any sub-formats with extensions be treated as the base format? For example, 140-0 is always going to be sound with the same codec and bitrate, etc. It's just going to be German rather than English.
To be clear, my comment had nothing to do with adding sub-formats like 140-drc. This will be relevant to everyone who combines audio and video. In my testing, the download will appear to succeed but only the first found file will be downloaded which is typically going to have the appearance of a video with broken sound. Thanks for all your hard work. I know myself and a lot of people really appreciate it. |
A possibility, but is there any guarantee that A-B will be the same as A? If we had an official list of YouTube formats, this decision would be easier, but we don't. |
It's your call. I can't find an official list either. Whatever might be available seems to be behind a 'wall' for channel owners/uploaders. Before you move on, please allow me one last indulgence. Oh btw, close this issue at your option. The following video is only a couple weeks old and contains only audio sub-formats. There is not a single standard audio format available to download. I don't think there is even a combined format. (I included the full format listing at the bottom of this message) Since these formats were added by YT, I would consider them official. Based on the audio format descriptions, there is always a labeled default format which we can assume would typically be the native language. Then the other audio formats are typically AI generated dubbing in other popular languages. The only exception I have seen is the xxx-drc which is audio dynamic range balancing. So, like I said, it's your call. It certainly looks to me like YT is rolling out language preference. Now that I see them doing it, I'm actually surprised they haven't done this sooner. (Or maybe they have and I just haven't noticed it) As a side note, if you were to ever include a language preference option in the future, the actual format code numbers are meaningless as far as language it concerned. IOW, 140-0 is not always German. The formats would have to be filtered based on what is in the format description brackets. For example [de-DE] is German obviously, but could 140-0 or 249-2. I hope that helps, and thanks again. (Sorry if this listing is broken for you. I don't know how to make it display better) 133 mp4 426x240 30 | 4.07MiB 74k https | avc1.4d4015 74k video only 240p, mp4_dash |
Here's a couple more very recent videos I've come across with dubbing: I asked Grok AI about it and received this reply for what it's worth:
|
I think we will have to wait for yt-dlp to handle this situation, perhaps by introducing a new download option that looks something like this: --format mp4 --format-language de_DE I can't think of a convenient way for Tartube to handle language selections at the moment. |
Windows 10 Tartube: 2.5.062
I believe tartube is using the wrong format for the format selection option.
If I pick JUST these 4 formats, tartube will form this command '-f 137+136+140+139'
With that command, YT-DLP wants to find and download all 4 formats.
This causes downloads to fail or non-optimal formats to be downloaded depending on the exact list of formats.
As I understand the manual: The correct format should be '-f 137/136+140/139'
This will download one from the first set and 1 from the second set. Then combine them.
Here it a link to the appropriate section of the documents: (ctrl-f '137' to find a good example in the doc)
To reproduce the issue:
Start with this video: https://www.youtube.com/watch?v=SkF1U4vrlhU
Note that this video will be missing the Video 137 and Audio 139 format.
Put ONLY these 4 formats (137,136,140,139) in the "List of preferred formats" and attempt a download.
The download will use this in the command line: "-f 137+136+140+139" and then it will fail with this error:
"ERROR: [youtube] SkF1U4vrlhU: Requested format is not available. Use --list-formats for a list of available formats"
Now remove those 4 formats in the "List of preferred formats" so it is EMPTY and use this in the command line box: -f 137/136+140/139
Tartube will download the first found video and audio and merge them. Incidentally, this command syntax still has some issues and as near as I can figure something like this works much better: -f "(137/136)+(140/139)"
Thanks for all your hard work and I hope this helps.
PS. I have noticed 2 other issues while looking into this that you may encounter:
If I click to download a video again, and it fails, then the video will still be added to the archive list but since it doesn't really 'exist' anymore, I cannot click to download it again until I manually edit the archive list to remove it.
There are other formats which I do not think are handled properly by tartube. For example, the 140 format also has 140-drc, 140-1, 140-2, 140-3, 140-4, 140-5
You can see those formats here: https://www.youtube.com/watch?v=ewfn6qKUe48 https://www.youtube.com/watch?v=BGhrTC0o-qg
The text was updated successfully, but these errors were encountered: