ErrorFlynn / ytdlp-interface

Windows graphical interface for yt-dlp, designed as a simple YouTube downloader
MIT License
1.09k stars 58 forks source link

[Question&Feature request] Process the playlist's videos #173

Open iG8R opened 2 months ago

iG8R commented 2 months ago

Hello. First of all, thank you very much for such a great program. In the process of using it, some questions arose. E.g., there is the following Youtube playlist https://www.youtube.com/playlist?list=PLEe8jzHjtRiRQWZugdORFlqCGh18fwnSz

  1. How could I select formats for each video or group of videos in this playlist? Currently, I can only select formats for the first video, even if I deselected it from the download list. It would come in handy in those cases, when it is necessary to download multiple audio tracks at the same time. It would be great to have, for example, forward and backward arrows next to the title of the video in the manual selection of format window. Something like this:

image

  1. Is it possible to display videos that are in the playlist also in the "queue" view with their corresponding statuses? For example:

image

ErrorFlynn commented 2 months ago

How could I select formats for each video or group of videos in this playlist? Currently, I can only select formats for the first video, even if I deselected it from the download list.

It's not clear what you're requesting. Do you want to select different formats for each video in a playlist? If so, that's not possible, because yt-dlp doesn't have that capability. If you want to be able to do that because you want to make sure that yt-dlp downloads the best formats for each video (since different videos in the playlist may have different formats), then just don't select any formats and it will do that. You can even influence what "best" is, by going to Settings -> yt-dlp and setting your preferences for resolution, codec, etc.

Or, do you want to select the same formats for all videos. If so, then you should know that you don't select formats for the first video, you select formats from the first video, and those formats are used for all videos you download from the playlist.

It would come in handy in those cases, when it is necessary to download multiple audio tracks at the same time.

I'm not sure what you mean by "download multiple audio tracks at the same time". You can download multiple audio tracks at the same time by first checking the checkbox Select multiple audio formats to merge into .mkv file as audio tracks (this passes --audio-multistreams to yt-dlp), and then selecting multiple audio formats from the list. You seem to be talking about something else, but it's not clear what.

Is it possible to display videos that are in the playlist also in the "queue" view with their corresponding statuses?

I don't see a good reason why that feature should exist, and plenty of reasons why it shouldn't. If you want to see the status of the playlist download, the Status column in the queue tells you which video is being downloaded in addition to the progress percentage (for example, [5/13] 46%). If you need more info than that, you can check the output view and see all the info yt-dlp produced while downloading.

If you want that feature because you want to see additional info for each video (like file size and what formats are to be downloaded), that's not possible the way you imagine it, because yt-dlp doesn't get that additional info when the program requests data for the playlist (it gets minimal info for each video). The program uses yt-dlp to get extensive info only for the first video, so that you have the possibility to select formats from a list (this was a requested feature).

What you're asking could be done through a feature that would add the videos from a playlist to the queue, and then remove the [playlist] item. But then, we could be talking about hundreds of videos (or more, some playlists have over a thousand videos). Which means yt-dlp would have to get info for hundreds of videos in a short period, which YouTube might not like and which might contribute to your IP being banned, depending on what else you do (I've heard of people being blocked for downloading too much too quickly, especially when using cookies).

Also, the memory consumption of the program would probably go up significantly. I'm not even sure how well it would perform with that many queue items, each one having its own data obtained from yt-dlp, and its own download options. I'm kind of scared to find out, but I'll keep this feature in mind (it has been proposed before), and I'll probably try implementing it at some point to see how feasible it is. I don't consider it a priority though, so it might take a while.

iG8R commented 2 months ago

Wow! Thank you very much for such a detailed clarification and the time you spent on it!

It's not clear what you're requesting. Do you want to select different formats for each video in a playlist?

Yes.

If so, that's not possible, because yt-dlp doesn't have that capability. If you want to be able to do that because you want to make sure that yt-dlp downloads the best formats for each video (since different videos in the playlist may have different formats), then just don't select any formats and it will do that. You can even influence what "best" is, by going to Settings -> yt-dlp and setting your preferences for resolution, codec, etc.

More specifically, there are videos that contain Multi-language Audio Tracks (MLA), and I want to be able to choose what tracks ytdlp-Interface will download. In addition, sometimes it is necessary to download several audio tracks but with different quality or codecs.

Or, do you want to select the same formats for all videos. If so, then you should know that you don't select formats for the first video, you select formats from the first video, and those formats are used for all videos you download from the playlist.

That is the issue, because the formats from the first video can be worse than the ones in the subsequent videos in the playlist. E.g. if the first video has max quality 720p, but one video somewhere in the middle of the playlist is 8K max quality and I want to download it in 4K, another - 4K, but I want to download it in 1080p - how could I do it? Or with different codecs for each video, due to a situation when the author didn't encode some of their videos well. Yes, these situations don't occur very often, but sometimes they still happen to me.

I'm not sure what you mean by "download multiple audio tracks at the same time". You can download multiple audio tracks at the same time by first checking the checkbox Select multiple audio formats to merge into .mkv file as audio tracks (this passes --audio-multistreams to yt-dlp), and then selecting multiple audio formats from the list. You seem to be talking about something else, but it's not clear what.

E.g. I have my playlist. The first video in it is https://www.youtube.com/watch?v=nqbyzU2kErQ with the following audio and video tracks

image


And somewhere further there is https://www.youtube.com/watch?v=3A9WHQRNyv8 with

image

How do I need to choose from the m4a and mp4 formats of the first video so, that the audio and video of the second video would be downloaded as follows: audio: 250+140+251 video: 248 Why do I need 3 audio tracks? Later, I'll pick what I like best and delete the unnecessary audios.

Is it possible to display videos that are in the playlist also in the "queue" view with their corresponding statuses?

I don't see a good reason why that feature should exist, and plenty of reasons why it shouldn't. If you want to see the status of the playlist download, the Status column in the queue tells you which video is being downloaded in addition to the progress percentage (for example, [5/13] 46%). If you need more info than that, you can check the output view and see all the info yt-dlp produced while downloading.

All I want is to see without any additional manipulations and pleasant to the eyes what videos are in the current playlist, what their statuses and in what state the download process is. What we have now is this: to see and select the videos you want in a playlist, you have to right-click on the playlist and click "Select Video" to get an additional huge window with only "Number", "Video Title" and "Duration" columns and without all the extra information about the individual video that we can see in the main window. How wonderful it would be if after inserting the link to a playlist, this playlist's videos will appear right in the main window under the playlist line with all the information available and then, if necessary, it would be possible to adjust selection which videos to download and the downloadable audio and video formats inherited from the playlist itself by clicking on the desired video.

If you want that feature because you want to see additional info for each video (like file size and what formats are to be downloaded), that's not possible the way you imagine it, because yt-dlp doesn't get that additional info when the program requests data for the playlist (it gets minimal info for each video). The program uses yt-dlp to get extensive info only for the first video, so that you have the possibility to select formats from a list (this was a requested feature).

When requesting playlist data, this data contains links to each video in the playlist, right? Why shouldn't these links be used to get this additional information?

What you're asking could be done through a feature that would add the videos from a playlist to the queue, and then remove the [playlist] item. But then, we could be talking about hundreds of videos (or more, some playlists have over a thousand videos). Which means yt-dlp would have to get info for hundreds of videos in a short period, which YouTube might not like and which might contribute to your IP being banned, depending on what else you do (I've heard of people being blocked for downloading too much too quickly, especially when using cookies).

Then why not make a limit on the number of simultaneous downloads? For example, 3. 3 because nowadays it is not uncommon to have 3 monitors and watch 3 videos at the same time. So, only 3 links to the video will be processed at the same time and thus you can easily avoid any suspicion from Youtube.

Also, the memory consumption of the program would probably go up significantly. I'm not even sure how well it would perform with that many queue items, each one having its own data obtained from yt-dlp, and its own download options. I'm kind of scared to find out, but I'll keep this feature in mind (it has been proposed before), and I'll probably try implementing it at some point to see how feasible it is. I don't consider it a priority though, so it might take a while.

The number of simultaneous downloads is the answer to this issue as well.

ErrorFlynn commented 2 months ago

I see, so you want to be able to select different formats for different videos in a playlist. Like I said, yt-dlp does not have that capability. If you pass yt-dlp a playlist URL, there are no command line options to tell it to download formats x+y+z from one video, and formats a+b+c from another. The only way to do that is to run yt-dlp multiple times, each time with the URL of an individual video from the playlist, and the -f option that corresponds to the formats you want for that video.

When requesting playlist data, this data contains links to each video in the playlist, right? Why shouldn't these links be used to get this additional information?

Because it takes much longer, and also hammers the YouTube servers with many requests in a way that might trigger a ban (although to be fair, that just my suspicion, I haven't confirmed it).

Then why not make a limit on the number of simultaneous downloads?

The data for a URL is obtained the moment the URL is added to the queue, otherwise you wouldn't be able to select formats from a list before you start the download. So if a playlist contains a thousand videos, the feature I was envisioning would add a thousand videos to the queue all at once. Currently, when multiple URLs are added to the queue at the same time (when pasting a list of URLs), the program launches multiple instances of yt-dlp at a time to get data, equal to the number of logical processors. In my case, that would be 24 concurrent yt-dlp instances getting data for 24 videos at a time, until all of them have data. I could set a hard limit of 4 or something like that, to make it less likely YouTube gets angry.

All I want is to see without any additional manipulations and pleasant to the eyes what videos are in the current playlist, what their statuses and in what state the download process is.

In order to do it the way you portrayed it in your screenshot, I would have to write a custom version of the existing listbox widget that the GUI library provides, and I seriously doubt I'm going to do that (too much headache, and there are more worthwhile priorities to put time and effort in). The next best thing you can hope for is the feature I discussed, that adds the playlist videos to the queue (I will be looking into it after I release the next version).

iG8R commented 2 months ago

I could set a hard limit of 4 or something like that, to make it less likely YouTube gets angry.

Is it possible to make it customizable? So that users can adjust to Youtube's reaction to the number of simultaneous downloads if it decides to change something about it.

In order to do it the way you portrayed it in your screenshot, I would have to write a custom version of the existing listbox widget that the GUI library provides, and I seriously doubt I'm going to do that (too much headache, and there are more worthwhile priorities to put time and effort in). The next best thing you can hope for is the feature I discussed, that adds the playlist videos to the queue (I will be looking into it after I release the next version).

Whatever you find convenient to implement. Maybe it is possible, without rewriting the listbox, to simulate working with a playlist when putting videos from it into separate queue lines, for example, by marking them as having been added from it and downloading them to the same folder as it is done now and making it possibel to change the name of that folder for all these videos at once before the playlist starts downloading?

ErrorFlynn commented 2 months ago

Maybe it is possible, without rewriting the listbox, to simulate working with a playlist when putting videos from it into separate queue lines, for example, by marking them as having been added from it and downloading them to the same folder as it is done now and making it possibel to change the name of that folder for all these videos at once before the playlist starts downloading?

That should be possible, I'll see what I can do.

iG8R commented 2 months ago

Thank you very much!