8 from .common
import InfoExtractor
11 class BloggerIE(InfoExtractor
):
12 IE_NAME
= 'blogger.com'
13 _VALID_URL
= r
'https?://(?:www\.)?blogger\.com/video\.g\?token=(?P<id>.+)'
14 _EMBED_REGEX
= [r
'''<iframe[^>]+src=["'](?P<url>(?:https?:)?//(?:www\.)?blogger\.com/video\.g\?token=[^"']+)["']''']
16 'url': 'https://www.blogger.com/video.g?token=AD6v5dzEe9hfcARr5Hlq1WTkYy6t-fXH3BBahVhGvVHe5szdEUBEloSEDSTA8-b111089KbfWuBvTN7fnbxMtymsHhXAXwVvyzHH4Qch2cfLQdGxKQrrEuFpC1amSl_9GuLWODjPgw',
17 'md5': 'f1bc19b6ea1b0fd1d81e84ca9ec467ac',
19 'id': 'BLOGGER-video-3c740e3a49197e16-796',
20 'title': 'BLOGGER-video-3c740e3a49197e16-796',
22 'thumbnail': r
're:^https?://.*',
27 def _real_extract(self
, url
):
28 token_id
= self
._match
_id
(url
)
29 webpage
= self
._download
_webpage
(url
, token_id
)
30 data_json
= self
._search
_regex
(r
'var\s+VIDEO_CONFIG\s*=\s*(\{.*)', webpage
, 'JSON data')
31 data
= self
._parse
_json
(data_json
.encode('utf-8').decode('unicode_escape'), token_id
)
32 streams
= data
['streams']
34 'ext': mimetype2ext(traverse_obj(parse_qs(stream
['play_url']), ('mime', 0))),
35 'url': stream
['play_url'],
36 'format_id': str_or_none(stream
.get('format_id')),
37 } for stream
in streams
]
40 'id': data
.get('iframe_id', token_id
),
41 'title': data
.get('iframe_id', token_id
),
43 'thumbnail': data
.get('thumbnail'),
44 'duration': parse_duration(traverse_obj(parse_qs(streams
[0]['play_url']), ('dur', 0))),