]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/syfy.py
1 from __future__
import unicode_literals
3 from .adobepass
import AdobePassIE
10 class SyfyIE(AdobePassIE
):
11 _VALID_URL
= r
'https?://www\.syfy\.com/(?:[^/]+/)?videos/(?P<id>[^/?#]+)'
13 'url': 'http://www.syfy.com/theinternetruinedmylife/videos/the-internet-ruined-my-life-season-1-trailer',
17 'title': 'The Internet Ruined My Life: Season 1 Trailer',
18 'description': 'One tweet, one post, one click, can destroy everything.',
19 'uploader': 'NBCU-MPAT',
20 'upload_date': '20170113',
21 'timestamp': 1484345640,
25 'skip_download': True,
27 'add_ie': ['ThePlatform'],
30 def _real_extract(self
, url
):
31 display_id
= self
._match
_id
(url
)
32 webpage
= self
._download
_webpage
(url
, display_id
)
33 syfy_mpx
= list(self
._parse
_json
(self
._search
_regex
(
34 r
'jQuery\.extend\([^,]+,\s*({.+})\);', webpage
, 'drupal settings'),
35 display_id
)['syfy']['syfy_mpx'].values())[0]
36 video_id
= syfy_mpx
['mpxGUID']
37 title
= syfy_mpx
['episodeTitle']
42 if syfy_mpx
.get('entitlement') == 'auth':
43 resource
= self
._get
_mvpd
_resource
(
44 'syfy', title
, video_id
,
45 syfy_mpx
.get('mpxRating', 'TV-14'))
46 query
['auth'] = self
._extract
_mvpd
_auth
(
47 url
, video_id
, 'syfy', resource
)
50 '_type': 'url_transparent',
51 'ie_key': 'ThePlatform',
52 'url': smuggle_url(update_url_query(
53 self
._proto
_relative
_url
(syfy_mpx
['releaseURL']), query
),
54 {'force_smil_url': True}),
57 'display_id': display_id
,