Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Twitch VODs fail with parsing of the thumbnail data #25531
Comments
|
Can confirm the same issue, fixed with the applied patch. |
|
Thanks for this quick patch, hope to see it in the next release :) |
Checklist
I also have applied the diff from by previous bug #25528, otherwise I would getthe 410 error.
I have my browser configured to not play videos, but the videos are alive and the attached patch fixes playback of the videos.
Verbose log
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--verbose', 'https://www.twitch.tv/videos/640872506']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2020.05.29
[debug] Python version 3.8.3 (CPython) - Linux-5.6.9-pinguin20200502-x86_64-with-glibc2.29
[debug] exe versions: ffmpeg 4.2.2-1, ffprobe 4.2.2-1, rtmpdump 2.4
[debug] Proxy map: {}
[twitch:vod] 640872506: Downloading vod info JSON
[twitch:vod] 640872506: Downloading vod access token
[twitch:vod] 640872506: Downloading m3u8 information
Traceback (most recent call last):
File "/usr/bin/youtube-dl", line 11, in
load_entry_point('youtube-dl==2020.5.29', 'console_scripts', 'youtube-dl')()
File "/usr/lib/python3/dist-packages/youtube_dl/init.py", line 478, in main
_real_main(argv)
File "/usr/lib/python3/dist-packages/youtube_dl/init.py", line 468, in _real_main
retcode = ydl.download(all_urls)
File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 2018, in download
res = self.extract_info(
File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 808, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 863, in process_ie_result
return self.process_video_result(ie_result, download=download)
File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 1460, in process_video_result
t['url'] = sanitize_url(t['url'])
File "/usr/lib/python3/dist-packages/youtube_dl/utils.py", line 2135, in sanitize_url
if url.startswith('//'):
AttributeError: 'dict' object has no attribute 'startswith'
Description
It seems Twitch is returning a dictionary of several thumbnails now with info.get('preview') (extractor/twitch.py line 194). On the above URL i get the following json data:
{"small": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/dfa4f0f421b0286b0cb0_rahmschnitzel_1840886609_115117682//thumb/thumb0-80x45.jpg", "medium": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/dfa4f0f421b0286b0cb0_rahmschnitzel_1840886609_115117682//thumb/thumb0-320x180.jpg", "large": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/dfa4f0f421b0286b0cb0_rahmschnitzel_1840886609_115117682//thumb/thumb0-640x360.jpg", "template": "https://static-cdn.jtvnw.net/cf_vods/d2nvs31859zcd8/dfa4f0f421b0286b0cb0_rahmschnitzel_1840886609_115117682//thumb/thumb0-{width}x{height}.jpg"}Parsing of the thumbnail(s) only supports a string or an array of dictionaries. Arbitrarily selecting one seems to work (see attached patch), otherwise the preview data must be reparsed into the expected format for "thumbnails".
thumbnail.diff.txt