diff options
author | Filippo Valsorda <filippo.valsorda@gmail.com> | 2013-06-06 15:07:05 +0200 |
---|---|---|
committer | Filippo Valsorda <filippo.valsorda@gmail.com> | 2013-06-06 15:07:05 +0200 |
commit | 476203d025dd2619ea9f9e2f99ffce507dec6596 (patch) | |
tree | ea9a98f23a3014ae97e14f9ddf3273b0d9255088 | |
parent | 468e2e926b8d1f55d6ce67fee67e33a7fa6d8371 (diff) |
print WARNINGs during test + minor fix to NBAIE
-rw-r--r-- | test/test_download.py | 9 | ||||
-rwxr-xr-x | youtube_dl/InfoExtractors.py | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/test/test_download.py b/test/test_download.py index 3eca333f2..3e6bdd44e 100644 --- a/test/test_download.py +++ b/test/test_download.py @@ -40,9 +40,18 @@ def _try_rm(filename): class FileDownloader(youtube_dl.FileDownloader): def __init__(self, *args, **kwargs): + self._to_stderr = self.to_stderr self.to_stderr = self.to_screen self.processed_info_dicts = [] return youtube_dl.FileDownloader.__init__(self, *args, **kwargs) + def report_warning(self, message): + # let warnings pass to output + if sys.stderr.isatty() and os.name != 'nt': + _msg_header=u'\033[0;33mWARNING:\033[0m' + else: + _msg_header=u'WARNING:' + warning_message=u'%s %s' % (_msg_header,message) + self._to_stderr(warning_message) def process_info(self, info_dict): self.processed_info_dicts.append(info_dict) return youtube_dl.FileDownloader.process_info(self, info_dict) diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py index fbf40f3ca..0f1880756 100755 --- a/youtube_dl/InfoExtractors.py +++ b/youtube_dl/InfoExtractors.py @@ -3183,7 +3183,7 @@ class NBAIE(InfoExtractor): uploader_date = self._search_regex(r'<b>Date:</b> (.*?)</div>', webpage, 'upload_date', fatal=False) - description = self._search_regex(r'<div class="description">(.*?)</h1>', webpage, 'description', fatal=False) + description = self._search_regex(r'<meta name="description" (?:content|value)="(.*?)" />', webpage, 'description', fatal=False) info = { 'id': shortened_video_id, |