diff options
| -rw-r--r-- | Makefile | 3 | ||||
| -rw-r--r-- | youtube_dl/downloader/http.py | 2 | ||||
| -rw-r--r-- | youtube_dl/extractor/__init__.py | 2 | ||||
| -rw-r--r-- | youtube_dl/extractor/auengine.py | 1 | ||||
| -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 | 
7 files changed, 11 insertions, 116 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/downloader/http.py b/youtube_dl/downloader/http.py index 348097dab..cc8b9c9a7 100644 --- a/youtube_dl/downloader/http.py +++ b/youtube_dl/downloader/http.py @@ -23,6 +23,8 @@ class HttpFD(FileDownloader):          headers = {'Youtubedl-no-compression': 'True'}          if 'user_agent' in info_dict:              headers['Youtubedl-user-agent'] = info_dict['user_agent'] +        if 'http_referer' in info_dict: +            headers['Referer'] = info_dict['http_referer']          basic_request = compat_urllib_request.Request(url, None, headers)          request = compat_urllib_request.Request(url, None, headers) 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/auengine.py b/youtube_dl/extractor/auengine.py index 94caad0cf..20bf12550 100644 --- a/youtube_dl/extractor/auengine.py +++ b/youtube_dl/extractor/auengine.py @@ -51,4 +51,5 @@ class AUEngineIE(InfoExtractor):              'url': video_url,              'title': title,              'thumbnail': thumbnail, +            'http_referer': 'http://www.auengine.com/flowplayer/flowplayer.commercial-3.2.14.swf',          } 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') - | 
