aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authoroittaa <oittaa@users.noreply.github.com>2016-01-07 07:26:14 +0200
committerSergey M․ <dstftw@gmail.com>2016-01-07 11:36:17 +0600
commite4f49a87533bd6e3ebf11b43c3baf0e32db2f5ca (patch)
tree8ff61bfd60fb1f3c4bec3b7564aab76e9acfdc82 /youtube_dl
parent51d3045de26fccbdcf0076c5cab8ab8152548bba (diff)
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
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/crunchyroll.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/crunchyroll.py b/youtube_dl/extractor/crunchyroll.py
index 00d943f77..785594df8 100644
--- a/youtube_dl/extractor/crunchyroll.py
+++ b/youtube_dl/extractor/crunchyroll.py
@@ -329,8 +329,10 @@ Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
streamdata_req, video_id,
note='Downloading media info for %s' % video_format)
stream_info = streamdata.find('./{default}preload/stream_info')
- video_url = stream_info.find('./host').text
- video_play_path = stream_info.find('./file').text
+ video_url = xpath_text(stream_info, './host')
+ video_play_path = xpath_text(stream_info, './file')
+ if not video_url or not video_play_path:
+ continue
metadata = stream_info.find('./metadata')
format_info = {
'format': video_format,