]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/thescene.py
b8504f0ebdc04ade7d580102f0bcf506bebc4230
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
5 from ..compat
import compat_urlparse
12 class TheSceneIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://thescene\.com/watch/[^/]+/(?P<id>[^/#?]+)'
16 'url': 'https://thescene.com/watch/vogue/narciso-rodriguez-spring-2013-ready-to-wear',
18 'id': '520e8faac2b4c00e3c6e5f43',
20 'title': 'Narciso Rodriguez: Spring 2013 Ready-to-Wear',
21 'display_id': 'narciso-rodriguez-spring-2013-ready-to-wear',
23 'series': 'Style.com Fashion Shows',
24 'season': 'Ready To Wear Spring 2013',
30 def _real_extract(self
, url
):
31 display_id
= self
._match
_id
(url
)
33 webpage
= self
._download
_webpage
(url
, display_id
)
35 player_url
= compat_urlparse
.urljoin(
37 self
._html
_search
_regex
(
38 r
'id=\'js
-player
-script
\'[^
>]+src
=\'(.+?
)\'', webpage, 'player url
'))
40 player = self._download_webpage(player_url, display_id)
41 info = self._parse_json(
43 r'(?m
)video\s
*:\s
*({.+?
}),$
', player, 'info json
'),
49 qualities_order = qualities(('low
', 'high
'))
51 'format_id
': '{0}
-{1}
'.format(f['type'].split('/')[0], f['quality
']),
53 'quality
': qualities_order(f['quality
']),
54 } for f in info['sources
']]
55 self._sort_formats(formats)
59 'display_id
': display_id,
62 'thumbnail
': info.get('poster_frame
'),
63 'duration
': int_or_none(info.get('duration
')),
64 'series
': info.get('series_title
'),
65 'season
': info.get('season_title
'),
66 'tags
': info.get('tags
'),
67 'categories
': info.get('categories
'),