1 from .common
import InfoExtractor
10 class ExpressenIE(InfoExtractor
):
13 (?:www\.)?(?:expressen|di)\.se/
14 (?:(?:tvspelare/video|videoplayer/embed)/)?
18 _EMBED_REGEX
= [r
'<iframe[^>]+\bsrc=(["\'])(?P
<url
>(?
:https?
:)?
//(?
:www\
.)?
(?
:expressen|di
)\
.se
/(?
:tvspelare
/video|videoplayer
/embed
)/tv
/.+?
)\
1']
20 'url
': 'https
://www
.expressen
.se
/tv
/ledare
/ledarsnack
/ledarsnack
-om
-arbetslosheten
-bland
-kvinnor
-i
-speciellt
-utsatta
-omraden
/',
21 'md5
': 'deb2ca62e7b1dcd19fa18ba37523f66e
',
23 'id': 'ba90f5a9
-78d1
-4511-aa02
-c177b9c99136
',
24 'display_id
': 'ledarsnack
-om
-arbetslosheten
-bland
-kvinnor
-i
-speciellt
-utsatta
-omraden
',
26 'title
': 'Ledarsnack
: Om arbetslösheten bland kvinnor i speciellt utsatta områden
',
27 'description
': 'md5
:f38c81ff69f3de4d269bbda012fcbbba
',
28 'thumbnail
': r're
:^https?
://.*\
.jpg$
',
30 'timestamp
': 1526639109,
31 'upload_date
': '20180518',
34 'url
': 'https
://www
.expressen
.se
/tv
/kultur
/kulturdebatt
-med
-expressens
-karin
-olsson
/',
35 'only_matching
': True,
37 'url
': 'https
://www
.expressen
.se
/tvspelare
/video
/tv
/ditv
/ekonomistudion
/experterna
-har
-ar
-fragorna
-som
-avgor
-valet
/?embed
=true
&external
=true
&autoplay
=true
&startVolume
=0&partnerId
=di
',
38 'only_matching
': True,
40 'url
': 'https
://www
.expressen
.se
/videoplayer
/embed
/tv
/ditv
/ekonomistudion
/experterna
-har
-ar
-fragorna
-som
-avgor
-valet
/?embed
=true
&external
=true
&autoplay
=true
&startVolume
=0&partnerId
=di
',
41 'only_matching
': True,
43 'url
': 'https
://www
.di
.se
/videoplayer
/embed
/tv
/ditv
/borsmorgon
/implantica
-rusar
-70--under
-borspremiaren
-hor
-styrelsemedlemmen
/?embed
=true
&external
=true
&autoplay
=true
&startVolume
=0&partnerId
=di
',
44 'only_matching
': True,
47 def _real_extract(self, url):
48 display_id = self._match_id(url)
50 webpage = self._download_webpage(url, display_id)
52 def extract_data(name):
53 return self._parse_json(
55 r'data
-%s=(["\'])(?P<value>(?:(?!\1).)+)\1' % name,
56 webpage, 'info', group='value'),
57 display_id, transform_source=unescapeHTML)
59 info = extract_data('video-tracking-info')
60 video_id = info['contentId']
62 data = extract_data('article-data')
63 stream = data['stream']
65 if determine_ext(stream) == 'm3u8':
66 formats = self._extract_m3u8_formats(
67 stream, display_id, 'mp4', entry_protocol='m3u8_native',
73 self._sort_formats(formats)
75 title = info.get('titleRaw') or data['title']
76 description = info.get('descriptionRaw')
77 thumbnail = info.get('socialMediaImage') or data.get('image')
78 duration = int_or_none(info.get('videoTotalSecondsDuration')
79 or data.get('totalSecondsDuration'))
80 timestamp = unified_timestamp(info.get('publishDate'))
84 'display_id': display_id,
86 'description': description,
87 'thumbnail': thumbnail,
89 'timestamp': timestamp,