mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-19 09:25:43 +00:00
check video_play_path and use xpath_text
"This check should take place earlier and should be more general if not video_url:. Same should be done for video_play_path. Also these fields better extracted with xpath_text." Suggestions by @dstftw
This commit is contained in:
parent
51d3045de2
commit
e4f49a8753
@ -329,8 +329,10 @@ def _real_extract(self, url):
|
|||||||
streamdata_req, video_id,
|
streamdata_req, video_id,
|
||||||
note='Downloading media info for %s' % video_format)
|
note='Downloading media info for %s' % video_format)
|
||||||
stream_info = streamdata.find('./{default}preload/stream_info')
|
stream_info = streamdata.find('./{default}preload/stream_info')
|
||||||
video_url = stream_info.find('./host').text
|
video_url = xpath_text(stream_info, './host')
|
||||||
video_play_path = stream_info.find('./file').text
|
video_play_path = xpath_text(stream_info, './file')
|
||||||
|
if not video_url or not video_play_path:
|
||||||
|
continue
|
||||||
metadata = stream_info.find('./metadata')
|
metadata = stream_info.find('./metadata')
|
||||||
format_info = {
|
format_info = {
|
||||||
'format': video_format,
|
'format': video_format,
|
||||||
|
Loading…
Reference in New Issue
Block a user