]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/rottentomatoes.py
   1 from __future__ 
import unicode_literals
 
   3 from .common 
import InfoExtractor
 
   4 from ..compat 
import compat_urlparse
 
   5 from .internetvideoarchive 
import InternetVideoArchiveIE
 
   8 class RottenTomatoesIE(InfoExtractor
): 
   9     _VALID_URL 
= r
'https?://www\.rottentomatoes\.com/m/[^/]+/trailers/(?P<id>\d+)' 
  12         'url': 'http://www.rottentomatoes.com/m/toy_story_3/trailers/11028566/', 
  16             'title': 'Toy Story 3', 
  20     def _real_extract(self
, url
): 
  21         video_id 
= self
._match
_id
(url
) 
  22         webpage 
= self
._download
_webpage
(url
, video_id
) 
  23         og_video 
= self
._og
_search
_video
_url
(webpage
) 
  24         query 
= compat_urlparse
.urlparse(og_video
).query
 
  27             '_type': 'url_transparent', 
  28             'url': InternetVideoArchiveIE
._build
_xml
_url
(query
), 
  29             'ie_key': InternetVideoArchiveIE
.ie_key(), 
  30             'title': self
._og
_search
_title
(webpage
),