~facundo/encuentro/trunk

« back to all changes in this revision

Viewing changes to external/youtube-dl/youtube_dl/extractor/videodetective.py

  • Committer: Facundo Batista
  • Date: 2015-12-27 11:27:15 UTC
  • mto: This revision was merged to the branch mainline in revision 274.
  • Revision ID: facundo@taniquetil.com.ar-20151227112715-ztuasdhqm26hycug
Able to download TEDx.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from __future__ import unicode_literals
 
2
 
 
3
from .common import InfoExtractor
 
4
from ..compat import compat_urlparse
 
5
from .internetvideoarchive import InternetVideoArchiveIE
 
6
 
 
7
 
 
8
class VideoDetectiveIE(InfoExtractor):
 
9
    _VALID_URL = r'https?://www\.videodetective\.com/[^/]+/[^/]+/(?P<id>\d+)'
 
10
 
 
11
    _TEST = {
 
12
        'url': 'http://www.videodetective.com/movies/kick-ass-2/194487',
 
13
        'info_dict': {
 
14
            'id': '194487',
 
15
            'ext': 'mp4',
 
16
            'title': 'KICK-ASS 2',
 
17
            'description': 'md5:65ba37ad619165afac7d432eaded6013',
 
18
            'duration': 138,
 
19
        },
 
20
    }
 
21
 
 
22
    def _real_extract(self, url):
 
23
        video_id = self._match_id(url)
 
24
        webpage = self._download_webpage(url, video_id)
 
25
        og_video = self._og_search_video_url(webpage)
 
26
        query = compat_urlparse.urlparse(og_video).query
 
27
        return self.url_result(InternetVideoArchiveIE._build_url(query), ie=InternetVideoArchiveIE.ie_key())