Skip to content
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

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

Open
junglized opened this issue Sep 21, 2024 · 10 comments
Open

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

junglized opened this issue Sep 21, 2024 · 10 comments

Comments

@junglized
Copy link

junglized commented Sep 21, 2024

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:
running yt-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
Copy link
Owner

  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
Copy link
Author

  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
Copy link
Owner

Are you using "Playlist downloader" tab?

@junglized
Copy link
Author

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
Copy link
Owner

"-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
Copy link
Author

"-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
Copy link
Author

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
Copy link
Owner

  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.

@mhogomchungu
Copy link
Owner

Revisiting this issue.

What version of Media Downloader are you using? Your outputs makes no sense to me so perhaps were are testing from two different and incompatible versions.

@junglized
Copy link
Author

junglized commented Dec 26, 2024

Sorry for such a delay in answering. I had to reinstall Linux Mint some time ago, my SSD died. Currently I'm using Media Downloader 5.1.0, still in Linux Mint 22 Cinnamon edition. Just now I had some time to try to recreate original issue. It may be the case it doesn't exist anymore. Sorry for troubling you. I'll post my findings soon.


EDIT:

I've just tested your suggestion, to put output template in "Engine's default options" and the result is the same:

[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" "-o" "%(uploader)s/%(playlist_title)s/%(playlist_index)s - %(title)s.%(ext)s" "-f" "bestvideo[ext=mp4][vcodec^=avc]+bestaudio[ext=m4a]/bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio/best[ext=mp4]/best" "--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/user/.local/share/media-downloader/data/subscriptions_archive_file.txt"
[youtube] Extracting URL: https://www.youtube.com/watch?v=4MceeO4Ulrs
[youtube] 4MceeO4Ulrs: Downloading webpage
[youtube] 4MceeO4Ulrs: Downloading ios player API JSON
[youtube] 4MceeO4Ulrs: Downloading mweb player API JSON
[youtube] 4MceeO4Ulrs: Downloading m3u8 information
[info] 4MceeO4Ulrs: Downloading 1 format(s): 270+140
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 960
[download] Destination: /home/user/Mounted/NAS/Downloads/Media Downloader/GC Videography Fellows/NA/NA - David Harvey Lecture 1: Capital as Value in Motion.f270.mp4
[download] 4.11 MiB / ~851.36 MiB (0.48%) at 960.03 KiB/s, ETA 00:00
[media-downloader] Download Cancelled

Actually I tested more playlist related yt-dlp options (playlist_title, playlist_uploader, playlist_count) and they all seem to fail giving NA as an output. Other options (like_count, uploader, was_live, tags, etc.) produce expected output.

Another thing is I noticed when fetching playlist data (pasting playlist URL and clicking Get List) all playlist related yt-dlp options are displayed correctly:

[media-downloader] cmd: "/home/user/.local/share/media-downloader/bin/yt-dlp" "--newline" "--print" "{"uploader":%(uploader)j,"id":%(id)j,"thumbnail":%(thumbnail)j,"duration":%(duration)j,"title":%(title)j,"upload_date":%(upload_date)j,"webpage_url":%(webpage_url)j,"playlist_id":%(playlist_id)j,"playlist_title":%(playlist_title)j,"playlist":%(playlist)j,"playlist_uploader":%(playlist_uploader)j,"playlist_uploader_id":%(playlist_uploader_id)j}0xdeadbeef>>MediaDownloaderEndMarker<<0xdeadbeef" "--lazy-playlist" "--compat-options" "2022" "--output-na-placeholder" ""NA"" "-v" "https://www.youtube.com/playlist?list=PLWvnUfModHP-rthRgWTFkRmPEWjtH2q2t"
{
    "duration": 5124,
    "id": "4MceeO4Ulrs",
    "playlist": "David Harvey on Marx and Capital: The Concept, The Book, The History",
    "playlist_id": "PLWvnUfModHP-rthRgWTFkRmPEWjtH2q2t",
    "playlist_title": "David Harvey on Marx and Capital: The Concept, The Book, The History",
    "playlist_uploader": "Reading Marx's Capital with David Harvey",
    "playlist_uploader_id": "@readingcapital",
    "thumbnail": "https://i.ytimg.com/vi/4MceeO4Ulrs/maxresdefault.jpg",
    "title": "David Harvey Lecture 1: Capital as Value in Motion",
    "upload_date": "20160930",
    "uploader": "GC Videography Fellows",
    "webpage_url": "https://www.youtube.com/watch?v=4MceeO4Ulrs"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants