瀏覽代碼

More trouble calls changed in InfoExtractors.py

The calls with the message starting with 'WARNING' have been changed to report_warning instead of report_error
Jaime Marquínez Ferrándiz 12 年之前
父節點
當前提交
c9fa1cbab6
共有 1 個文件被更改,包括 8 次插入8 次删除
  1. 8 8
      youtube_dl/InfoExtractors.py

+ 8 - 8
youtube_dl/InfoExtractors.py

@@ -467,7 +467,7 @@ class YoutubeIE(InfoExtractor):
         if mobj is not None:
         if mobj is not None:
             video_uploader_id = mobj.group(1)
             video_uploader_id = mobj.group(1)
         else:
         else:
-            self._downloader.trouble(u'WARNING: unable to extract uploader nickname')
+            self._downloader.report_warning(u'unable to extract uploader nickname')
 
 
         # title
         # title
         if 'title' not in video_info:
         if 'title' not in video_info:
@@ -477,7 +477,7 @@ class YoutubeIE(InfoExtractor):
 
 
         # thumbnail image
         # thumbnail image
         if 'thumbnail_url' not in video_info:
         if 'thumbnail_url' not in video_info:
-            self._downloader.trouble(u'WARNING: unable to extract video thumbnail')
+            self._downloader.report_warning(u'unable to extract video thumbnail')
             video_thumbnail = ''
             video_thumbnail = ''
         else:   # don't panic if we can't find it
         else:   # don't panic if we can't find it
             video_thumbnail = compat_urllib_parse.unquote_plus(video_info['thumbnail_url'][0])
             video_thumbnail = compat_urllib_parse.unquote_plus(video_info['thumbnail_url'][0])
@@ -509,7 +509,7 @@ class YoutubeIE(InfoExtractor):
                 self._downloader.trouble(srt_error)
                 self._downloader.trouble(srt_error)
 
 
         if 'length_seconds' not in video_info:
         if 'length_seconds' not in video_info:
-            self._downloader.trouble(u'WARNING: unable to extract video duration')
+            self._downloader.report_warning(u'unable to extract video duration')
             video_duration = ''
             video_duration = ''
         else:
         else:
             video_duration = compat_urllib_parse.unquote_plus(video_info['length_seconds'][0])
             video_duration = compat_urllib_parse.unquote_plus(video_info['length_seconds'][0])
@@ -785,7 +785,7 @@ class DailymotionIE(InfoExtractor):
             # lookin for official user
             # lookin for official user
             mobj_official = re.search(r'<span rel="author"[^>]+?>([^<]+?)</span>', webpage)
             mobj_official = re.search(r'<span rel="author"[^>]+?>([^<]+?)</span>', webpage)
             if mobj_official is None:
             if mobj_official is None:
-                self._downloader.trouble(u'WARNING: unable to extract uploader nickname')
+                self._downloader.report_warning(u'unable to extract uploader nickname')
             else:
             else:
                 video_uploader = mobj_official.group(1)
                 video_uploader = mobj_official.group(1)
         else:
         else:
@@ -2449,7 +2449,7 @@ class ComedyCentralIE(InfoExtractor):
                 turls.append(finfo)
                 turls.append(finfo)
 
 
             if len(turls) == 0:
             if len(turls) == 0:
-                self._downloader.trouble(u'\nERROR: unable to download ' + mediaId + ': No videos found')
+                self._downloader.report_error(u'unable to download ' + mediaId + ': No videos found')
                 continue
                 continue
 
 
             if self._downloader.params.get('listformats', None):
             if self._downloader.params.get('listformats', None):
@@ -2609,7 +2609,7 @@ class CollegeHumorIE(InfoExtractor):
             info['thumbnail'] = videoNode.findall('./thumbnail')[0].text
             info['thumbnail'] = videoNode.findall('./thumbnail')[0].text
             manifest_url = videoNode.findall('./file')[0].text
             manifest_url = videoNode.findall('./file')[0].text
         except IndexError:
         except IndexError:
-            self._downloader.trouble(u'\nERROR: Invalid metadata XML file')
+            self._downloader.report_error(u'Invalid metadata XML file')
             return
             return
 
 
         manifest_url += '?hdcore=2.10.3'
         manifest_url += '?hdcore=2.10.3'
@@ -2626,7 +2626,7 @@ class CollegeHumorIE(InfoExtractor):
             node_id = media_node.attrib['url']
             node_id = media_node.attrib['url']
             video_id = adoc.findall('./{http://ns.adobe.com/f4m/1.0}id')[0].text
             video_id = adoc.findall('./{http://ns.adobe.com/f4m/1.0}id')[0].text
         except IndexError as err:
         except IndexError as err:
-            self._downloader.trouble(u'\nERROR: Invalid manifest file')
+            self._downloader.report_error(u'Invalid manifest file')
             return
             return
 
 
         url_pr = compat_urllib_parse_urlparse(manifest_url)
         url_pr = compat_urllib_parse_urlparse(manifest_url)
@@ -2980,7 +2980,7 @@ class StanfordOpenClassroomIE(InfoExtractor):
                 info['title'] = mdoc.findall('./title')[0].text
                 info['title'] = mdoc.findall('./title')[0].text
                 info['url'] = baseUrl + mdoc.findall('./videoFile')[0].text
                 info['url'] = baseUrl + mdoc.findall('./videoFile')[0].text
             except IndexError:
             except IndexError:
-                self._downloader.trouble(u'\nERROR: Invalid metadata XML file')
+                self._downloader.report_error(u'Invalid metadata XML file')
                 return
                 return
             info['ext'] = info['url'].rpartition('.')[2]
             info['ext'] = info['url'].rpartition('.')[2]
             return [info]
             return [info]