Browse Source

print WARNINGs during test + minor fix to NBAIE

rtmp_test
Filippo Valsorda 12 years ago
parent
commit
476203d025
2 changed files with 10 additions and 1 deletions
  1. +9
    -0
      test/test_download.py
  2. +1
    -1
      youtube_dl/InfoExtractors.py

+ 9
- 0
test/test_download.py View File

@ -40,9 +40,18 @@ def _try_rm(filename):
class FileDownloader(youtube_dl.FileDownloader): class FileDownloader(youtube_dl.FileDownloader):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self._to_stderr = self.to_stderr
self.to_stderr = self.to_screen self.to_stderr = self.to_screen
self.processed_info_dicts = [] self.processed_info_dicts = []
return youtube_dl.FileDownloader.__init__(self, *args, **kwargs) 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): def process_info(self, info_dict):
self.processed_info_dicts.append(info_dict) self.processed_info_dicts.append(info_dict)
return youtube_dl.FileDownloader.process_info(self, info_dict) return youtube_dl.FileDownloader.process_info(self, info_dict)


+ 1
- 1
youtube_dl/InfoExtractors.py View File

@ -3183,7 +3183,7 @@ class NBAIE(InfoExtractor):
uploader_date = self._search_regex(r'<b>Date:</b> (.*?)</div>', webpage, 'upload_date', fatal=False) 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 = { info = {
'id': shortened_video_id, 'id': shortened_video_id,


Loading…
Cancel
Save