Merge remote-tracking branch 'malept/tds-extended-interviews'
authorPhilipp Hagemeister <phihag@phihag.de>
Thu, 27 Mar 2014 01:02:18 +0000 (02:02 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Thu, 27 Mar 2014 01:02:18 +0000 (02:02 +0100)
Makefile
youtube_dl/downloader/http.py
youtube_dl/extractor/__init__.py
youtube_dl/extractor/auengine.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 348097dab0886954655b85917def8743975d963a..cc8b9c9a7f5cac66a4b59d460c7678917aa98cc0 100644 (file)
@@ -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)
 
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 94caad0cf3ce212695646bf9bcdb7ad05a3dbbd6..20bf12550d4b4493982ca3ea6f31578368e31aba 100644 (file)
@@ -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',
         }
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')
-