]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/aenetworks.py
   1 from __future__ 
import unicode_literals
 
   3 from .common 
import InfoExtractor
 
   4 from ..utils 
import smuggle_url
 
   7 class AENetworksIE(InfoExtractor
): 
   9     IE_DESC 
= 'A+E Networks: A&E, Lifetime, History.com, FYI Network' 
  10     _VALID_URL 
= r
'https?://(?:www\.)?(?:(?:history|aetv|mylifetime)\.com|fyi\.tv)/(?:[^/]+/)+(?P<id>[^/]+?)(?:$|[?#])' 
  13         'url': 'http://www.history.com/topics/valentines-day/history-of-valentines-day/videos/bet-you-didnt-know-valentines-day?m=528e394da93ae&s=undefined&f=1&free=false', 
  17             'title': "Bet You Didn't Know: Valentine's Day", 
  18             'description': 'md5:7b57ea4829b391995b405fa60bd7b5f7', 
  22             'skip_download': True, 
  24         'add_ie': ['ThePlatform'], 
  25         'expected_warnings': ['JSON-LD'], 
  27         'url': 'http://www.history.com/shows/mountain-men/season-1/episode-1', 
  31             'title': 'Winter Is Coming', 
  32             'description': 'md5:641f424b7a19d8e24f26dea22cf59d74', 
  36             'skip_download': True, 
  38         'add_ie': ['ThePlatform'], 
  40         'url': 'http://www.aetv.com/shows/duck-dynasty/video/inlawful-entry', 
  43         'url': 'http://www.fyi.tv/shows/tiny-house-nation/videos/207-sq-ft-minnesota-prairie-cottage', 
  46         'url': 'http://www.mylifetime.com/shows/project-runway-junior/video/season-1/episode-6/superstar-clients', 
  50     def _real_extract(self
, url
): 
  51         video_id 
= self
._match
_id
(url
) 
  53         webpage 
= self
._download
_webpage
(url
, video_id
) 
  56             r
'data-href="[^"]*/%s"[^>]+data-release-url="([^"]+)"' % video_id
, 
  57             r
"media_url\s*=\s*'([^']+)'" 
  59         video_url 
= self
._search
_regex
(video_url_re
, webpage
, 'video url') 
  61         info 
= self
._search
_json
_ld
(webpage
, video_id
, fatal
=False) 
  63             '_type': 'url_transparent', 
  64             'url': smuggle_url(video_url
, {'sig': {'key': 'crazyjava', 'secret': 's3cr3t'}}),