mhogomchungu / media-downloader

Media Downloader is a Qt/C++ front end to yt-dlp, youtube-dl, gallery-dl, lux, you-get, svtplay-dl, aria2c, wget and safari books..
GNU General Public License v2.0
1.58k stars 118 forks source link

NA instead of playlist and playlist_index with yt-dlp #451

Open junglized opened 3 days ago

junglized commented 3 days ago

playlist and playlist_index fields output NA when set in download optons for yt-dlp. If I use ther same fields running yt-dlp directly from terminal everything's fine.

Example: for playlist https://www.youtube.com/playlist?list=PLWvnUfModHP-rthRgWTFkRmPEWjtH2q2t

Media Downloader: with options set to --embed-subs --sub-langs "en" -S "res:720" -o "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" and download path set to /home/user output folder structure is: /home/user/GC Videography Fellows/NA/NA - David Harvey Lecture 1: Capital as Value in Motion.f247.webm

Notice NA for playlist and playlist_index in output path

Terminal: runningyt-dlp --embed-subs --sub-langs "en" -S "res:720" -o "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLWvnUfModHP-rthRgWTFkRmPEWjtH2q2t" outputs folder sctructure: /home/user/GC Videography Fellows/David Harvey on Marx and Capital: The Concept, The Book, The History/1 - David Harvey Lecture 1: Capital as Value in Motion.webm

playlist and playlist_index set correctly

I hope what I wrote makes sense :)

I'm on Linux Mint 22, Installed Media Downloader from here

mhogomchungu commented 2 days ago
  1. Put only entry of the playlist in the playlist download tab.
  2. Start downloading and cancel the download when the downloading starts.
  3. Right click the entry and then select "Show Log Window".
  4. Post here the contents of the log window.
junglized commented 2 days ago
  1. Put only entry of the playlist in the playlist download tab.
  2. Start downloading and cancel the download when the downloading starts.
  3. Right click the entry and then select "Show Log Window".
  4. Post here the contents of the log window.

Ah, of course I forgot about logs, silly me.

Is that the log you asked for? (I set maximum concurrent downloads to 1). Now when I look at it it passes a lot more arguments than there are in my query. I suppose they are for download folder to be set, show download progress, etc.?

[media-downloader] cmd: "/home/user/.local/share/media-downloader/bin/yt-dlp" "--newline" "--ignore-config" "--no-playlist" "-o" "%(title).200s-%(id)s.%(ext)s" "--output-na-placeholder" "NA" "-P" "/home/user/Mounted/NAS/Downloads/Media Downloader" "--embed-subs" "--sub-langs" "en" "-S" "res:720" "-o" "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "--compat-options" "2022" "--progress-template" "download:[download] downloaded_bytes:%(progress.downloaded_bytes)s ETA:%(progress.eta)s total_bytes_estimate:%(progress.total_bytes_estimate)s total_bytes:%(progress.total_bytes)s progress.speed:%(progress.speed)s filename:%(progress.filename)s" "https://www.youtube.com/watch?v=4MceeO4Ulrs"
[youtube] Extracting URL: https://www.youtube.com/watch?v=4MceeO4Ulrs
[youtube] 4MceeO4Ulrs: Downloading webpage
[youtube] 4MceeO4Ulrs: Downloading ios player API JSON
[youtube] 4MceeO4Ulrs: Downloading web creator player API JSON
[youtube] 4MceeO4Ulrs: Downloading m3u8 information
[info] 4MceeO4Ulrs: Downloading 1 format(s): 247+251
[info] There are no subtitles for the requested languages
[download] Destination: /home/user/Mounted/NAS/Downloads/Media Downloader/GC Videography Fellows/NA/NA - David Harvey Lecture 1: Capital as Value in Motion.f247.webm
[download] 9.93 MiB / 626.50 MiB (1.59%) at 1.74 MiB/s, ETA 05:53
[media-downloader] Download Cancelled

And thank you for your time.

mhogomchungu commented 2 days ago

Are you using "Playlist downloader" tab?

junglized commented 2 days ago

Are you using "Playlist downloader" tab?

Yes. I paste playlist link into Enter Palylist URL field, press Get List, wait a little until all videos from playlist are loaded and press Download.

mhogomchungu commented 2 days ago
"-o" "%(title).200s-%(id)s.%(ext)s"
"-o" "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s"

The problem is the existence of the first line above in your options. Remove it and try again.

junglized commented 2 days ago
"-o" "%(title).200s-%(id)s.%(ext)s"
"-o" "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s"

The problem is the existence of the first line above in your options. Remove it and try again.

Thanks again for your support. The thing is that line is not coming from me. It's saved in Configure > Engine's Default Options. If I click Edit and try to clear it it's being used anyways. What I did was I added a new Default Option and set it as Default:

image

Bu that didn't resolve the issue. I recorded a short animetd GIF to let you see what is in Engine's Default Options now and how I get playlist in Playlist Downloader tab. It's a little choppy though, sorry about that. I hope you'll get the picture.

Peek 2024-09-22 14-08

And the log again:

[media-downloader] cmd: "/home/user/.local/share/media-downloader/bin/yt-dlp" "--newline" "--output-na-placeholder" "NA" "-P" "/home/user/Mounted/NAS/Downloads/Media Downloader" "--embed-subs" "--sub-langs" "en" "-S" "res:720" "-o" "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "--compat-options" "2022" "--progress-template" "download:[download] downloaded_bytes:%(progress.downloaded_bytes)s ETA:%(progress.eta)s total_bytes_estimate:%(progress.total_bytes_estimate)s total_bytes:%(progress.total_bytes)s progress.speed:%(progress.speed)s filename:%(progress.filename)s" "https://www.youtube.com/watch?v=4MceeO4Ulrs"
[youtube] Extracting URL: https://www.youtube.com/watch?v=4MceeO4Ulrs
[youtube] 4MceeO4Ulrs: Downloading webpage
[youtube] 4MceeO4Ulrs: Downloading ios player API JSON
[youtube] 4MceeO4Ulrs: Downloading web creator player API JSON
[youtube] 4MceeO4Ulrs: Downloading m3u8 information
[info] 4MceeO4Ulrs: Downloading 1 format(s): 247+251
[info] There are no subtitles for the requested languages
[download] Resuming download at byte 103932907
[download] Destination: /home/user/Mounted/NAS/Downloads/Media Downloader/GC Videography Fellows/NA/NA - David Harvey Lecture 1: Capital as Value in Motion.f247.webm
[download] 122.79 MiB / 626.50 MiB (19.60%) at 5.62 MiB/s, ETA 01:29
[media-downloader] Download Cancelled

NA is still there.

junglized commented 2 days ago

I even tried downloading with yt-dlp which is shipped with Media Downloader directly (it appears the yt-dlp I have installed systemwide is older). When run this way everything is OK. Here is output from Terminal.

user@user:~/.local/share/media-downloader/bin$ ./yt-dlp --embed-subs --sub-langs "en" -S "res:480" -P "/home/user/Mounted/NAS/Downloads/Media Downloader/" -o "%(uploader)s/%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s" "https://www.youtube.com/playlist?list=PLWvnUfModHP-rthRgWTFkRmPEWjtH2q2t"
[youtube:tab] Extracting URL: https://www.youtube.com/playlist?list=PLWvnUfModHP-rthRgWTFkRmPEWjtH2q2t
[youtube:tab] PLWvnUfModHP-rthRgWTFkRmPEWjtH2q2t: Downloading webpage
[youtube:tab] PLWvnUfModHP-rthRgWTFkRmPEWjtH2q2t: Redownloading playlist API JSON with unavailable videos
[download] Downloading playlist: David Harvey on Marx and Capital: The Concept, The Book, The History
[youtube:tab] PLWvnUfModHP-rthRgWTFkRmPEWjtH2q2t page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (1/3)...
[youtube:tab] PLWvnUfModHP-rthRgWTFkRmPEWjtH2q2t page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (2/3)...
[youtube:tab] PLWvnUfModHP-rthRgWTFkRmPEWjtH2q2t page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Retrying (3/3)...
[youtube:tab] PLWvnUfModHP-rthRgWTFkRmPEWjtH2q2t page 1: Downloading API JSON
WARNING: [youtube:tab] Incomplete data received. Giving up after 3 retries
[youtube:tab] Playlist David Harvey on Marx and Capital: The Concept, The Book, The History: Downloading 6 items of 6
[download] Downloading item 1 of 6
[youtube] Extracting URL: https://www.youtube.com/watch?v=4MceeO4Ulrs
[youtube] 4MceeO4Ulrs: Downloading webpage
[youtube] 4MceeO4Ulrs: Downloading ios player API JSON
[youtube] 4MceeO4Ulrs: Downloading web creator player API JSON
[youtube] 4MceeO4Ulrs: Downloading m3u8 information
[info] 4MceeO4Ulrs: Downloading 1 format(s): 244+251
[info] There are no subtitles for the requested languages
[download] Resuming download at byte 20976083
[download] Destination: /home/user/Mounted/NAS/Downloads/Media Downloader/GC Videography Fellows/David Harvey on Marx and Capital: The Concept, The Book, The History/1 - David Harvey Lecture 1: Capital as Value in Motion.f244.webm
[download]  80.8% of  235.29MiB at    5.23MiB/s ETA 00:08^C
ERROR: Interrupted by user
mhogomchungu commented 2 days ago
  1. Go to "Configure" tab.
  2. Go to "Engine's default options" sub tab.
  3. Add the following line in the "Options to Add" text field: "-o" "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s"
  4. Click "Add".
  5. Click "Save".
  6. Go back to the "Playlist downloader" tab.
  7. Remove the "-o" options you added there.
  8. Try to download again and post the log entry.

If things work as expected then your command should be like below

[media-downloader] cmd: "/home/ink/.local/share/media-downloader/bin/yt-dlp" "--embed-subs" "--sub-langs" "en" "-S" "res:720" "-o" "%(uploader)s/%(playlist)s/%(playlist_index)s - %(title)s.%(ext)s" "--newline" "--output-na-placeholder" "NA" "-P" "/home/ink/yt" "--parse-metadata" "1:%(playlist_index)s" "--parse-metadata" "David Harvey on Marx and Capital: The Concept, The Book, The History:%(playlist)s" "-f" "242+250" "--compat-options" "2022" "--progress-template" "download:[download] downloaded_bytes:%(progress.downloaded_bytes)s ETA:%(progress.eta)s total_bytes_estimate:%(progress.total_bytes_estimate)s total_bytes:%(progress.total_bytes)s progress.speed:%(progress.speed)s filename:%(progress.filename)s" "https://www.youtube.com/watch?v=4MceeO4Ulrs" "--download-archive" "/home/ink/.local/share/media-downloader/data/subscriptions_archive_file.txt"

The command you send to yt-dlp is missing --parse-metadata argument and the problem is here.