]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/filmweb.py
1 from __future__
import unicode_literals
4 from .common
import InfoExtractor
7 class FilmwebIE(InfoExtractor
):
8 _VALID_URL
= r
'https?://(?:www\.)?filmweb\.no/(?P<type>trailere|filmnytt)/article(?P<id>\d+)\.ece'
10 'url': 'http://www.filmweb.no/trailere/article1264921.ece',
11 'md5': 'e353f47df98e557d67edaceda9dece89',
15 'title': 'Det som en gang var',
16 'upload_date': '20160316',
17 'timestamp': 1458140101,
18 'uploader_id': '12639966',
19 'uploader': 'Live Roaldset',
23 def _real_extract(self
, url
):
24 article_type
, article_id
= self
._match
_valid
_url
(url
).groups()
25 if article_type
== 'filmnytt':
26 webpage
= self
._download
_webpage
(url
, article_id
)
27 article_id
= self
._search
_regex
(r
'data-videoid="(\d+)"', webpage
, 'article id')
28 embed_code
= self
._download
_json
(
29 'https://www.filmweb.no/template_v2/ajax/json_trailerEmbed.jsp',
31 'articleId': article_id
,
33 iframe_url
= self
._proto
_relative
_url
(self
._search
_regex
(
34 r
'<iframe[^>]+src="([^"]+)', embed_code
, 'iframe url'))
37 '_type': 'url_transparent',
40 'ie_key': 'TwentyThreeVideo',