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