1 from .common
import InfoExtractor
10 class ExpressenIE(InfoExtractor
):
13 (?:www\.)?(?:expressen|di)\.se/
14 (?:(?:tvspelare/video|video-?player/embed)/)?
15 (?:tv|nyheter)/(?:[^/?#]+/)*
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,
46 'url
': 'https
://www
.expressen
.se
/video
-player
/embed
/tv
/nyheter
/ekero
-fodda
-olof
-gustafsson
-forvaltar
-knarkbaronen
-pablo
-escobars
-namn
',
47 'only_matching
': True,
49 'url
': 'https
://www
.expressen
.se
/nyheter
/efter
-egna
-telefonbluffen
-escobar
-stammer
-klarna
/',
50 'only_matching
': True,
53 def _real_extract(self, url):
54 display_id = self._match_id(url)
56 webpage = self._download_webpage(url, display_id)
58 def extract_data(name):
59 return self._parse_json(
61 rf'data
-{name}
=(["\'])(?P<value>(?:(?!\1).)+)\1',
62 webpage, 'info', group='value'),
63 display_id, transform_source=unescapeHTML)
65 info = extract_data('video-tracking-info')
66 video_id = info['contentId']
68 data = extract_data('article-data')
69 stream = data['stream']
71 if determine_ext(stream) == 'm3u8':
72 formats = self._extract_m3u8_formats(
73 stream, display_id, 'mp4', entry_protocol='m3u8_native',
80 title = info.get('titleRaw') or data['title']
81 description = info.get('descriptionRaw')
82 thumbnail = info.get('socialMediaImage') or data.get('image')
83 duration = int_or_none(info.get('videoTotalSecondsDuration')
84 or data.get('totalSecondsDuration'))
85 timestamp = unified_timestamp(info.get('publishDate'))
89 'display_id': display_id,
91 'description': description,
92 'thumbnail': thumbnail,
94 'timestamp': timestamp,