yt-dlp / yt-dlp

A feature-rich command-line audio/video downloader
https://discord.gg/H5MNcFW63r
The Unlicense
89.21k stars 6.91k forks source link

[youtube] Extract `uploader` and `uploader_id` of multifeed playlist #3307

Closed danielyli closed 1 year ago

danielyli commented 2 years ago

Checklist

Description

Background info

When downloading a multifeed video, yt-dlp populates the uploader and uploader_id fields with NA instead of their actual values.

Example

For example, see these two videos:

https://www.youtube.com/watch?v=7jQ5wLZ6Pj4
https://www.youtube.com/watch?v=mp0TW8vkCLg

When downloading one of the videos, we see:

$ yt-dlp --skip-download --write-info-json --output '%(uploader)s-%(uploader_id)s.%(id)s.%(ext)s' 7jQ5wLZ6Pj4
(... etc ...)

$ ls *.info.json
NA-NA.7jQ5wLZ6Pj4.info.json
SpaceX-spacexchannel.7jQ5wLZ6Pj4.info.json
SpaceX-spacexchannel.mp0TW8vkCLg.info.json

Related issues

This feature request relates to #3306.

Verbose log

$ yt-dlp -vU --skip-download --write-info-json --output '%(uploader)s-%(uploader_id)s.%(id)s.%(ext)s' 7jQ5wLZ6Pj4
[debug] Command-line config: ['-vU', '--skip-download', '--write-info-json', '--output', '%(uploader)s-%(uploader_id)s.%(id)s.%(ext)s', '7jQ5wLZ6Pj4']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, err utf-8, pref UTF-8
[debug] yt-dlp version 2022.03.08.2 [e491d06d3]
[debug] Python version 3.10.2 (CPython 64bit) - macOS-12.2.1-arm64-arm-64bit
[debug] exe versions: ffmpeg 5.0 (setts), ffprobe 5.0, rtmpdump 2.4
[debug] Optional libraries: brotli, Cryptodome, mutagen, sqlite, websockets
[debug] Proxy map: {}
Latest version: 2022.03.08.1, Current version: 2022.03.08.2
yt-dlp is up to date (2022.03.08.2)
[debug] [youtube] Extracting URL: 7jQ5wLZ6Pj4
[youtube] 7jQ5wLZ6Pj4: Downloading webpage
[youtube] 7jQ5wLZ6Pj4: Downloading android player API JSON
[youtube] Downloading multifeed video (mp0TW8vkCLg, 7jQ5wLZ6Pj4) - add --no-playlist to just download video 7jQ5wLZ6Pj4
[download] Downloading playlist: Iridium-5 Mission - Countdown Net - Audio Only
[info] Writing playlist metadata as JSON to: NA-NA.7jQ5wLZ6Pj4.info.json
[youtube] playlist Iridium-5 Mission - Countdown Net - Audio Only: Collected 2 videos; downloading 2 of them
[download] Downloading video 1 of 2
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=mp0TW8vkCLg#__youtubedl_smuggle=%7B%22force_singlefeed%22%3A+true%7D
[youtube] mp0TW8vkCLg: Downloading webpage
[youtube] mp0TW8vkCLg: Downloading android player API JSON
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] mp0TW8vkCLg: Downloading 1 format(s): 248+251
[info] Writing video metadata as JSON to: SpaceX-spacexchannel.mp0TW8vkCLg.info.json
[download] Downloading video 2 of 2
[debug] [youtube] Extracting URL: https://www.youtube.com/watch?v=7jQ5wLZ6Pj4#__youtubedl_smuggle=%7B%22force_singlefeed%22%3A+true%7D
[youtube] 7jQ5wLZ6Pj4: Downloading webpage
[youtube] 7jQ5wLZ6Pj4: Downloading android player API JSON
[youtube] 7jQ5wLZ6Pj4: Downloading MPD manifest
[youtube] 7jQ5wLZ6Pj4: Downloading MPD manifest
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, codec:vp9.2, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec:vp9.2(10), acodec, lang, proto, filesize, fs_approx, tbr, vbr, abr, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] 7jQ5wLZ6Pj4: Downloading 1 format(s): 248+251
[info] Writing video metadata as JSON to: SpaceX-spacexchannel.7jQ5wLZ6Pj4.info.json
[info] Writing updated playlist metadata as JSON to: NA-NA.7jQ5wLZ6Pj4.info.json
[download] Finished downloading playlist: Iridium-5 Mission - Countdown Net - Audio Only

$ ls *.info.json
NA-NA.7jQ5wLZ6Pj4.info.json
SpaceX-spacexchannel.7jQ5wLZ6Pj4.info.json
SpaceX-spacexchannel.mp0TW8vkCLg.info.json
pukkandan commented 2 years ago

yt-dlp populates the uploader and uploader_id fields with NA instead of their actual values.

The video's metadata is being populated correctly. You mean the uploader of the "playlist", correct?

Does anyone know if a multifeed can have multiple uploaders? If so, it doesn't make sense to extract an uploader for it. Otherwise, we can potentially extract the first video's uploader and use that

coletdjnz commented 1 year ago

Closing as YouTube has discontinued multi-feed videos.