diff options
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | youtube_dl/YoutubeDL.py | 3 | ||||
-rw-r--r-- | youtube_dl/__init__.py | 5 | ||||
-rw-r--r-- | youtube_dl/extractor/__init__.py | 2 | ||||
-rw-r--r-- | youtube_dl/extractor/comedycentral.py | 4 | ||||
-rw-r--r-- | youtube_dl/extractor/cspan.py | 57 | ||||
-rw-r--r-- | youtube_dl/extractor/slashdot.py | 24 | ||||
-rw-r--r-- | youtube_dl/extractor/vice.py | 38 |
8 files changed, 18 insertions, 118 deletions
@@ -72,8 +72,9 @@ youtube-dl.tar.gz: youtube-dl README.md README.txt youtube-dl.1 youtube-dl.bash- --exclude '__pycache' \ --exclude '.git' \ --exclude 'testdata' \ + --exclude 'docs/_build' \ -- \ - bin devscripts test youtube_dl \ + bin devscripts test youtube_dl docs \ CHANGELOG LICENSE README.md README.txt \ Makefile MANIFEST.in youtube-dl.1 youtube-dl.bash-completion setup.py \ youtube-dl diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index d18d6dd00..ae0ec49f8 100644 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -94,6 +94,7 @@ class YoutubeDL(object): usenetrc: Use netrc for authentication instead. verbose: Print additional info to stdout. quiet: Do not print messages to stdout. + no_warnings: Do not print out anything for warnings. forceurl: Force printing final URL. forcetitle: Force printing title. forceid: Force printing ID. @@ -376,6 +377,8 @@ class YoutubeDL(object): if self.params.get('logger') is not None: self.params['logger'].warning(message) else: + if self.params.get('no_warnings'): + return if self._err_file.isatty() and os.name != 'nt': _msg_header = '\033[0;33mWARNING:\033[0m' else: diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index 056e94457..6af4b8aee 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -364,6 +364,10 @@ def parseOpts(overrideArguments=None): verbosity.add_option('-q', '--quiet', action='store_true', dest='quiet', help='activates quiet mode', default=False) + verbosity.add_option( + '--no-warnings', + dest='no_warnings', action='store_true', default=False, + help='Ignore warnings') verbosity.add_option('-s', '--simulate', action='store_true', dest='simulate', help='do not download the video and do not write anything to disk', default=False) verbosity.add_option('--skip-download', @@ -708,6 +712,7 @@ def _real_main(argv=None): 'password': opts.password, 'videopassword': opts.videopassword, 'quiet': (opts.quiet or any_printing), + 'no_warnings': opts.no_warnings, 'forceurl': opts.geturl, 'forcetitle': opts.gettitle, 'forceid': opts.getid, diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index 56b382aed..685fc749d 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -208,7 +208,6 @@ from .rutv import RUTVIE from .savefrom import SaveFromIE from .servingsys import ServingSysIE from .sina import SinaIE -from .slashdot import SlashdotIE from .slideshare import SlideshareIE from .smotri import ( SmotriIE, @@ -263,7 +262,6 @@ from .veehd import VeeHDIE from .veoh import VeohIE from .vesti import VestiIE from .vevo import VevoIE -from .vice import ViceIE from .viddler import ViddlerIE from .videobam import VideoBamIE from .videodetective import VideoDetectiveIE diff --git a/youtube_dl/extractor/comedycentral.py b/youtube_dl/extractor/comedycentral.py index 346ecded6..483ae5761 100644 --- a/youtube_dl/extractor/comedycentral.py +++ b/youtube_dl/extractor/comedycentral.py @@ -191,7 +191,7 @@ class ComedyCentralShowsIE(InfoExtractor): }) self._sort_formats(formats) - virtual_id = show_name + '-' + epTitle + ' part ' + compat_str(part_num + 1) + virtual_id = show_name + ' ' + epTitle + ' part ' + compat_str(part_num + 1) entries.append({ 'id': guid, 'title': virtual_id, @@ -206,6 +206,6 @@ class ComedyCentralShowsIE(InfoExtractor): return { '_type': 'playlist', 'entries': entries, - 'title': title, + 'title': show_name + ' ' + title, 'description': description, } diff --git a/youtube_dl/extractor/cspan.py b/youtube_dl/extractor/cspan.py index 795ccd926..2a8eda9ef 100644 --- a/youtube_dl/extractor/cspan.py +++ b/youtube_dl/extractor/cspan.py @@ -56,61 +56,16 @@ class CSpanIE(InfoExtractor): url = unescapeHTML(data['video']['files'][0]['path']['#text']) - doc = self._download_xml('http://www.c-span.org/common/services/flashXml.php?programid=' + video_id + '&version=2014-01-23', + doc = self._download_xml('http://www.c-span.org/common/services/flashXml.php?programid=' + video_id, video_id) - formats = [ - { - 'url': url, - } - ] - - def find_string(node, s): - return find_xpath_attr(node, './/string', 'name', s).text - - def find_number(node, s): - return int(find_xpath_attr(node, './/number', 'name', s).text) - - def find_array(node, s): - return find_xpath_attr(node, './/array', 'name', s) - - def process_files(files, url, formats): - for file in files: - path = find_string(file, 'path') - #duration = find_number(file, './number', 'name', 'length') - hd = find_number(file, 'hd') - formats.append({ - 'url': url, - 'play_path': path, - 'ext': 'flv', - 'quality': hd, - }) - - def process_node(node, formats): - url = find_xpath_attr(node, './string', 'name', 'url') - if url is None: - url = find_xpath_attr(node, './string', 'name', 'URL') - if url is None: - return - url = url.text.replace('$(protocol)', 'rtmp').replace('$(port)', '1935') - files = find_array(node, 'files') - if files is None: - return - process_files(files, url, formats) - - process_node(doc.find('./media-link'), formats) - - streams = find_array(doc, 'streams') - if streams is not None: - for stream in streams: - if find_string(stream, 'name') != 'vod': - continue - process_node(stream, formats) + def find_string(s): + return find_xpath_attr(doc, './/string', 'name', s).text return { 'id': video_id, - 'title': find_string(doc, 'title'), + 'title': find_string('title'), + 'url': url, 'description': description, - 'thumbnail': find_string(doc, 'poster'), - 'formats': formats, + 'thumbnail': find_string('poster'), } diff --git a/youtube_dl/extractor/slashdot.py b/youtube_dl/extractor/slashdot.py deleted file mode 100644 index d68646d24..000000000 --- a/youtube_dl/extractor/slashdot.py +++ /dev/null @@ -1,24 +0,0 @@ -import re - -from .common import InfoExtractor - - -class SlashdotIE(InfoExtractor): - _VALID_URL = r'https?://tv\.slashdot\.org/video/\?embed=(?P<id>.*?)(&|$)' - - _TEST = { - u'add_ie': ['Ooyala'], - u'url': u'http://tv.slashdot.org/video/?embed=JscHMzZDplD0p-yNLOzTfzC3Q3xzJaUz', - u'file': u'JscHMzZDplD0p-yNLOzTfzC3Q3xzJaUz.mp4', - u'md5': u'd2222e7a4a4c1541b3e0cf732fb26735', - u'info_dict': { - u'title': u' Meet the Stampede Supercomputing Cluster\'s Administrator', - }, - } - - def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') - webpage = self._download_webpage(url, video_id) - ooyala_url = self._search_regex(r'<script src="(.*?)"', webpage, 'ooyala url') - return self.url_result(ooyala_url, 'Ooyala') diff --git a/youtube_dl/extractor/vice.py b/youtube_dl/extractor/vice.py deleted file mode 100644 index 87812d6af..000000000 --- a/youtube_dl/extractor/vice.py +++ /dev/null @@ -1,38 +0,0 @@ -import re - -from .common import InfoExtractor -from .ooyala import OoyalaIE -from ..utils import ExtractorError - - -class ViceIE(InfoExtractor): - _VALID_URL = r'http://www\.vice\.com/.*?/(?P<name>.+)' - - _TEST = { - u'url': u'http://www.vice.com/Fringes/cowboy-capitalists-part-1', - u'file': u'43cW1mYzpia9IlestBjVpd23Yu3afAfp.mp4', - u'info_dict': { - u'title': u'VICE_COWBOYCAPITALISTS_PART01_v1_VICE_WM_1080p.mov', - }, - u'params': { - # Requires ffmpeg (m3u8 manifest) - u'skip_download': True, - }, - } - - def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - name = mobj.group('name') - webpage = self._download_webpage(url, name) - try: - ooyala_url = self._og_search_video_url(webpage) - except ExtractorError: - try: - embed_code = self._search_regex( - r'OO.Player.create\(\'ooyalaplayer\', \'(.+?)\'', webpage, - u'ooyala embed code') - ooyala_url = OoyalaIE._url_for_embed_code(embed_code) - except ExtractorError: - raise ExtractorError(u'The page doesn\'t contain a video', expected=True) - return self.url_result(ooyala_url, ie='Ooyala') - |