]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/livejournal.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from ..compat
import compat_str
6 from ..utils
import int_or_none
9 class LiveJournalIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:[^.]+\.)?livejournal\.com/video/album/\d+.+?\bid=(?P<id>\d+)'
12 'url': 'https://andrei-bt.livejournal.com/video/album/407/?mode=view&id=51272',
13 'md5': 'adaf018388572ced8a6f301ace49d4b2',
17 'title': 'Истребители против БПЛА',
18 'upload_date': '20190624',
19 'timestamp': 1561406715,
23 def _real_extract(self
, url
):
24 video_id
= self
._match
_id
(url
)
25 webpage
= self
._download
_webpage
(url
, video_id
)
26 record
= self
._parse
_json
(self
._search
_regex
(
27 r
'Site\.page\s*=\s*({.+?});', webpage
,
28 'page data'), video_id
)['video']['record']
29 storage_id
= compat_str(record
['storageid'])
30 title
= record
.get('name')
32 # remove filename extension(.mp4, .mov, etc...)
33 title
= title
.rsplit('.', 1)[0]
35 '_type': 'url_transparent',
38 'thumbnail': record
.get('thumbnail'),
39 'timestamp': int_or_none(record
.get('timecreate')),
40 'url': 'eagleplatform:vc.videos.livejournal.com:' + storage_id
,
41 'ie_key': 'EaglePlatform',