Merge remote-tracking branch 'dstftw/download-referer-header' (closes #2628)
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Wed, 26 Mar 2014 14:20:11 +0000 (15:20 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Wed, 26 Mar 2014 14:20:11 +0000 (15:20 +0100)
Makefile
youtube_dl/YoutubeDL.py
youtube_dl/__init__.py
youtube_dl/extractor/__init__.py
youtube_dl/extractor/comedycentral.py
youtube_dl/extractor/cspan.py
youtube_dl/extractor/slashdot.py [deleted file]
youtube_dl/extractor/vice.py [deleted file]

index c6d09932bcd4f45b8910e828255703403c2df0d7..f7d917d09d41120abb0065d300d932283efa4661 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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
index d18d6dd00e57e6eb7d8c5213a4b6d46ffb65df13..ae0ec49f84ae0c4765230def95ea2d2020a888d4 100644 (file)
@@ -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:
index 056e94457ae35bef07f2384a8dd732dbe7597f8f..6af4b8aee96c8d937940dddf103a63e220b24004 100644 (file)
@@ -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,
index 56b382aed637de7076591bb10bda1b7659298e09..685fc749d12c4237c03717c5e0af01f9d12ae341 100644 (file)
@@ -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
index 346ecded62c9278e37f059afa5ab4f91f27b850d..483ae576149de801edb23a570f6fa48ef1a8a726 100644 (file)
@@ -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,
         }
index 795ccd926a8ba5fc648ae91a2eb92bd3e2789e8c..2a8eda9eff3ce9364a3e8702c7422cb364dab582 100644 (file)
@@ -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 (file)
index d68646d..0000000
+++ /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 (file)
index 87812d6..0000000
+++ /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')
-