]> jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/videofyme.py
[ie/orf:on] Improve extraction (#9677)
[yt-dlp.git] / yt_dlp / extractor / videofyme.py
1 from .common import InfoExtractor
2 from ..utils import (
3 int_or_none,
4 parse_iso8601,
5 )
6
7
8 class VideofyMeIE(InfoExtractor):
9 _WORKING = False
10 _VALID_URL = r'https?://(?:www\.videofy\.me/.+?|p\.videofy\.me/v)/(?P<id>\d+)(&|#|$)'
11 IE_NAME = 'videofy.me'
12
13 _TEST = {
14 'url': 'http://www.videofy.me/thisisvideofyme/1100701',
15 'md5': 'c77d700bdc16ae2e9f3c26019bd96143',
16 'info_dict': {
17 'id': '1100701',
18 'ext': 'mp4',
19 'title': 'This is VideofyMe',
20 'description': '',
21 'upload_date': '20130326',
22 'timestamp': 1364288959,
23 'uploader': 'VideofyMe',
24 'uploader_id': 'thisisvideofyme',
25 'view_count': int,
26 'like_count': int,
27 'comment_count': int,
28 },
29 }
30
31 def _real_extract(self, url):
32 video_id = self._match_id(url)
33
34 config = self._download_json('http://vf-player-info-loader.herokuapp.com/%s.json' % video_id, video_id)['videoinfo']
35
36 video = config.get('video')
37 blog = config.get('blog', {})
38
39 return {
40 'id': video_id,
41 'title': video['title'],
42 'url': video['sources']['source']['url'],
43 'thumbnail': video.get('thumb'),
44 'description': video.get('description'),
45 'timestamp': parse_iso8601(video.get('date')),
46 'uploader': blog.get('name'),
47 'uploader_id': blog.get('identifier'),
48 'view_count': int_or_none(self._search_regex(r'([0-9]+)', video.get('views'), 'view count', fatal=False)),
49 'like_count': int_or_none(video.get('likes')),
50 'comment_count': int_or_none(video.get('nrOfComments')),
51 }