ytdl-org / youtube-dl

Command-line program to download videos from YouTube.com and other video sites
http://ytdl-org.github.io/youtube-dl/
The Unlicense
132.29k stars 10.03k forks source link

Command '--add-metadata' causes ERROR message with no content from youtube-dl on some YouTube urls #31527

Closed Emasoft closed 1 year ago

Emasoft commented 1 year ago

Checklist

Verbose log

[~YoutubeDL]$ 
[~YoutubeDL]$ youtube-dl -x "https://www.youtube.com/watch?app=desktop&v=5jgQy5tMQQ8" --add-metadata -f m4a  -o output.mp4 
[youtube] 5jgQy5tMQQ8: Downloading webpage
[youtube] 5jgQy5tMQQ8: Downloading MPD manifest
[download] Destination: output.mp4
[download] 100% of 8.42MiB in 03:04
[ffmpeg] Correcting container in "output.mp4"
[ffmpeg] Destination: output.m4a
Deleting original file output.mp4 (pass -k to keep)
[ffmpeg] Adding metadata to 'output.m4a'
ERROR: 
[~YoutubeDL]$ 
[~YoutubeDL]$ 
[~YoutubeDL]$ youtube-dl -x "https://www.youtube.com/watch?app=desktop&v=5jgQy5tMQQ8" --add-metadata -f m4a 
[youtube] 5jgQy5tMQQ8: Downloading webpage
[youtube] 5jgQy5tMQQ8: Downloading MPD manifest
[download] You're Going to Miss It - Harry Gregson-Williams-5jgQy5tMQQ8.m4a has already been downloaded
[download] 100% of 8.42MiB
[ffmpeg] Correcting container in "You're Going to Miss It - Harry Gregson-Williams-5jgQy5tMQQ8.m4a"
ERROR: 
[~YoutubeDL]$ 
[~YoutubeDL]$ 
[~YoutubeDL]$ youtube-dl -x "https://www.youtube.com/watch?app=desktop&v=5jgQy5tMQQ8" --add-metadata -f m4a
[youtube] 5jgQy5tMQQ8: Downloading webpage
[youtube] 5jgQy5tMQQ8: Downloading MPD manifest
[download] Destination: You're Going to Miss It - Harry Gregson-Williams-5jgQy5tMQQ8.m4a
[download] 100% of 8.42MiB in 02:31
[ffmpeg] Correcting container in "You're Going to Miss It - Harry Gregson-Williams-5jgQy5tMQQ8.m4a"
ERROR: 
[~YoutubeDL]$ 
[~YoutubeDL]$ 
[~YoutubeDL]$ 

Description

Command '--add-metadata' causes ERROR message with no content from youtube-dl on some YouTube urls.

EXAMPLE URL: https://www.youtube.com/watch?app=desktop&v=5jgQy5tMQQ8

To reproduce use this command:

youtube-dl -x "https://www.youtube.com/watch?app=desktop&v=5jgQy5tMQQ8" --add-metadata -f m4a  -o output.mp4

or this command:

youtube-dl -x "https://www.youtube.com/watch?app=desktop&v=5jgQy5tMQQ8" --add-metadata -f m4a
dirkf commented 1 year ago

Please post verbose (-v) log instead.

dirkf commented 1 year ago

@Emasoft ?

Emasoft commented 1 year ago

@dirkf Sorry, I cannot post the verbose log for personal reasons. But the result doesn't depend on any specific configuration. You can easily reproduce it and see for yourself.

dirkf commented 1 year ago

Not reproducible with latest yt-dl:

$ python -m youtube_dl -v -x 'https://www.youtube.com/watch?app=desktop&v=5jgQy5tMQQ8' --add-metadata -f m4a  -o output.mp4
[debug] System config: [u'--prefer-ffmpeg']
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'-x', u'https://www.youtube.com/watch?app=desktop&v=5jgQy5tMQQ8', u'--add-metadata', u'-f', u'm4a', u'-o', u'output.mp4']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2021.12.17
[debug] Git HEAD: 1d3751c3f
[debug] Python version 2.7.18 (CPython) - Linux-4.4.0-210-generic-i686-with-Ubuntu-16.04-xenial
[debug] exe versions: avconv 4.3, avprobe 4.3, ffmpeg 4.3, ffprobe 4.3
[debug] Proxy map: {}
[youtube] 5jgQy5tMQQ8: Downloading webpage
[youtube] 5jgQy5tMQQ8: Downloading MPD manifest
[debug] [youtube] Decrypted nsig aDsVoOWNu226rBl2 => 639wEUxGGWRQlw
[debug] [youtube] Decrypted nsig _MC6U1LazQN4v8Ir => vNC95GHKQGC1lA
WARNING: unable to extract uploader id; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
[debug] Invoking downloader on u'https://rr3---sn-cu-aigss.googlevideo.com/videoplayback?sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cgir%2Cclen%2Cotfp%2Cdur%2Clmt&fexp=24007246&ei=mq30Y6OcAv7yxN8P1v6MgAU&ip=46.208.6.20&clen=8825280&id=o-ALj1cp0PSry5vaXYmyTIJjLkyHbk9KzEDkyNVHuP_bM0&keepalive=yes&gir=yes&requiressl=yes&source=youtube&mv=m&sig=AOq0QJ8wRQIhAIWZJ0GoN6CmV9fgL7f-4ebYpIAGFttE4COY20kkm3fDAiANixSlY5e9vwmpzj45rAHfpPxpWpwg3Bz_Ol-26dw6_A%3D%3D&dur=555.212&ns=IA1Gi7HMrxleMDmsU9Ih6NoL&initcwndbps=1200000&vprv=1&lsig=AG3C_xAwRQIhAMoYxXz0Tw5XgD8sRp3AsPJ6msup5fpnE1g5Rj4F-cMrAiAO1XdcGcGjzdW8LDn31HO8b23AxREx7sadIs1PGqhYBw%3D%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lmt=1520923364209603&c=WEB&otfp=1&mime=audio%2Fmp4&fvip=5&itag=140&mm=31%2C29&mn=sn-cu-aigss%2Csn-cu-c9i6&mh=Yw&n=639wEUxGGWRQlw&mt=1676979210&expire=1677001210&pl=25&ms=au%2Crdu&mvi=3'
[download] Destination: output.mp4
[download] 100% of 8.42MiB in 05:46
[ffmpeg] Correcting container in "output.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:output.mp4' -c copy -f mp4 'file:output.temp.mp4'
[debug] ffmpeg command line: ffprobe -show_streams 'file:output.mp4'
[ffmpeg] Destination: output.m4a
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:output.mp4' -vn -acodec copy '-bsf:a' aac_adtstoasc 'file:output.m4a'
Deleting original file output.mp4 (pass -k to keep)
[ffmpeg] Adding metadata to 'output.m4a'
[debug] ffmpeg command line: ffmpeg -y -loglevel 'repeat+info' -i 'file:output.m4a' -vn -acodec copy -metadata 'comment=Music composed by Harry Gregson-Williams for the movie Spy Game.' -metadata 'album=Spy Game' -metadata 'description=Music composed by Harry Gregson-Williams for the movie Spy Game.' -metadata 'artist=Harry Gregson-Williams [Conductor]' -metadata 'title="You'"'"'re Going To Miss It" (Original Motion Picture Soundtrack)' -metadata 'date=20170728' -metadata 'purl=https://www.youtube.com/watch?v=5jgQy5tMQQ8' 'file:output.temp.m4a'
$

MediaInfo says:

General
Complete name                            : /home/df/Documents/src/youtube-dl/output.m4a
Format                                   : MPEG-4
Format profile                           : Apple audio with iTunes info
Codec ID                                 : M4A  (M4A /isom/iso2)
File size                                : 8.40 MiB
Duration                                 : 9mn 15s
Overall bit rate mode                    : Constant
Overall bit rate                         : 127 Kbps
Album                                    : Spy Game
Track name                               : "You're Going To Miss It" (Original Motion Picture Soundtrack)
Performer                                : Harry Gregson-Williams [Conductor]
Description                              : Music composed by Harry Gregson-Williams for the movie Spy Game.
Recorded date                            : 20170728
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00
Writing application                      : Lavf58.45.100
Comment                                  : Music composed by Harry Gregson-Williams for the movie Spy Game.

Audio
ID                                       : 1
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 9mn 15s
Bit rate mode                            : Constant
Bit rate                                 : 126 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 44.1 KHz
Frame rate                               : 43.066 fps (1024 spf)
Compression mode                         : Lossy
Stream size                              : 8.31 MiB (99%)
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00

The item purl isn't set, but otherwise as intended.

dirkf commented 1 year ago

Also: https://github.com/yt-dlp/yt-dlp/issues/6313.