mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-15 08:58:28 +00:00
Added check that json download status code is 200.
This commit is contained in:
parent
4df15c0f74
commit
a8c799a13c
@ -101,6 +101,8 @@ def _real_extract(self, url):
|
||||
)
|
||||
except Exception as e:
|
||||
raise ExtractorError(str(e), expected=True)
|
||||
if json_info.get("status") != 200:
|
||||
raise ExtractorError("Json download error. Status code: %s" % str(json_info.get("status")), expected=True)
|
||||
m3u8_url = json_info['data']['playlist']['medialist'][0]['sources']['m3u8'][
|
||||
'auto'
|
||||
]
|
||||
@ -111,9 +113,7 @@ def _real_extract(self, url):
|
||||
return {
|
||||
'id': video_id,
|
||||
'title': json_info['data']['playlist']['medialist'][0]['title'],
|
||||
'thumbnail': json_info['data']['playlist']['medialist'][0]['pictures'][
|
||||
'16:9'
|
||||
],
|
||||
'thumbnail': json_info['data']['playlist']['medialist'][0]['pictures']['16:9'],
|
||||
'formats': formats,
|
||||
'subtitles': subtitles,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user