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
131.66k stars 9.97k forks source link

--dump-json missing information for .mp4s from twitch.tv #12383

Closed jrogozen closed 7 years ago

jrogozen commented 7 years ago

Seems like running the --dump-json command doesn't return all information for twitch.tv clips

running

youtube-dl https://clips-media-assets.twitch.tv/24708907632-offset-5632-854x480.mp4 --dump-json

outputs

{"upload_date": "20170306", "protocol": "https", "extractor": "generic", "direct": true, "fulltitle": "24708907632-offset-5632-854x480", "id": "24708907632-offset-5632-854x480", "playlist": null, "title": "24708907632-offset-5632-854x480", "_filename": "24708907632-offset-5632-854x480-24708907632-offset-5632-854x480.mp4", "playlist_index": null, "webpage_url_basename": "24708907632-offset-5632-854x480.mp4", "display_id": "24708907632-offset-5632-854x480", "format": "mp4 - unknown", "requested_subtitles": null, "format_id": "mp4", "url": "https://clips-media-assets.twitch.tv/24708907632-offset-5632-854x480.mp4", "extractor_key": "Generic", "vcodec": null, "http_headers": {"Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Accept-Language": "en-us,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/47.0 (Chrome)"}, "ext": "mp4", "webpage_url": "https://clips-media-assets.twitch.tv/24708907632-offset-5632-854x480.mp4", "formats": [{"protocol": "https", "format": "mp4 - unknown", "url": "https://clips-media-assets.twitch.tv/24708907632-offset-5632-854x480.mp4", "vcodec": null, "http_headers": {"Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Accept-Language": "en-us,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/47.0 (Chrome)"}, "ext": "mp4", "format_id": "mp4"}]}

it is missing the duration info. is this an error in the encoding of twitch's mp4s, or something on the youtube-dl side?

thanks!

dstftw commented 7 years ago

https://clips-media-assets.twitch.tv/24708907632-offset-5632-854x480.mp4 is a direct link, where is it supposed to get duration from?

jrogozen commented 7 years ago

what about something like https://clips.twitch.tv/RoundLitigiousMangetoutKippa ?

{ "display_id": "RoundLitigiousMangetoutKippa", "extractor": "twitch:clips", "protocol": "https", "_filename": "Wow-RoundLitigiousMangetoutKippa.mp4", "creator": "Jobochan", "requested_subtitles": null, "format": "720 - 720p", "height": 720, "uploader": "jobochan", "id": "RoundLitigiousMangetoutKippa", "format_id": "720", "uploader_id": "Jobochan", "playlist": null, "thumbnails": [ { "url": "https://clips-media-assets.twitch.tv/24719028272-offset-18204-preview.jpg", "id": "0" } ], "title": "Wow", "url": "https://clips-media-assets.twitch.tv/24719028272-offset-18204.mp4", "extractor_key": "TwitchClips", "http_headers": { "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Accept-Language": "en-us,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/47.0 (Chrome)" }, "playlist_index": null, "ext": "mp4", "webpage_url": "https://clips.twitch.tv/RoundLitigiousMangetoutKippa", "formats": [ { "protocol": "https", "format": "360 - 360p", "url": "https://clips-media-assets.twitch.tv/24719028272-offset-18204-640x360.mp4", "http_headers": { "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Accept-Language": "en-us,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/47.0 (Chrome)" }, "height": 360, "ext": "mp4", "format_id": "360" }, { "protocol": "https", "format": "480 - 480p", "url": "https://clips-media-assets.twitch.tv/24719028272-offset-18204-854x480.mp4", "http_headers": { "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Accept-Language": "en-us,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/47.0 (Chrome)" }, "height": 480, "ext": "mp4", "format_id": "480" }, { "protocol": "https", "format": "720 - 720p", "url": "https://clips-media-assets.twitch.tv/24719028272-offset-18204.mp4", "http_headers": { "Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Accept-Language": "en-us,en;q=0.5", "Accept-Encoding": "gzip, deflate", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/47.0 (Chrome)" }, "height": 720, "ext": "mp4", "format_id": "720" } ], "fulltitle": "Wow", "thumbnail": "https://clips-media-assets.twitch.tv/24719028272-offset-18204-preview.jpg", "webpage_url_basename": "RoundLitigiousMangetoutKippa" }

doesn't include fps or duration information here. sorry if i'm missing something

dstftw commented 7 years ago

There is no duration or fps information available.

jrogozen commented 7 years ago

Ah, so a limitation of the twitch api? I think I had the assumption that youtube-dl would download a stream of the video file extracted from the url and pass it into ffprobe or something to get info.

But it probably calls w/e 3rd party api to get information based on the url. Sorry!

dstftw commented 7 years ago

There is no API. It parses a webpage.

jrogozen commented 7 years ago

Oh! Thanks for clearing that up