[youtube] Fix a FutureWarning from xml.etree.ElementTree
authorYen Chi Hsuan <yan12125@gmail.com>
Sat, 6 Jun 2015 14:22:26 +0000 (22:22 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sat, 6 Jun 2015 14:22:26 +0000 (22:22 +0800)
youtube_dl/extractor/youtube.py

index 6d288e8487a5875d862e63fe6200cd788a15c9bf..2424ac2c0c5df0afac139be7629986b84625a1d1 100644 (file)
@@ -816,7 +816,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                         'filesize': filesize,
                         'fps': int_or_none(r.attrib.get('frameRate')),
                     }
-                    if segment_list:
+                    if len(segment_list):
                         f.update({
                             'initialization_url': segment_list.find('{urn:mpeg:DASH:schema:MPD:2011}Initialization').attrib['sourceURL'],
                             'segment_urls': [segment.attrib.get('media') for segment in segment_list.findall('{urn:mpeg:DASH:schema:MPD:2011}SegmentURL')],