]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/videofyme.py
[ie/youtube] Suppress "Unavailable videos are hidden" warning (#10159)
[yt-dlp.git] / yt_dlp / extractor / videofyme.py
CommitLineData
bba12cec
JMF
1from .common import InfoExtractor
2from ..utils import (
5c321101 3 int_or_none,
c514b0ec 4 parse_iso8601,
bba12cec
JMF
5)
6
5f6a1245 7
bba12cec 8class VideofyMeIE(InfoExtractor):
df773c3d 9 _WORKING = False
5c321101
PH
10 _VALID_URL = r'https?://(?:www\.videofy\.me/.+?|p\.videofy\.me/v)/(?P<id>\d+)(&|#|$)'
11 IE_NAME = 'videofy.me'
bba12cec
JMF
12
13 _TEST = {
5c321101
PH
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',
c514b0ec 20 'description': '',
21 'upload_date': '20130326',
22 'timestamp': 1364288959,
5c321101
PH
23 'uploader': 'VideofyMe',
24 'uploader_id': 'thisisvideofyme',
25 'view_count': int,
f4f9f6d0 26 'like_count': int,
c514b0ec 27 'comment_count': int,
bba12cec 28 },
bba12cec
JMF
29 }
30
31 def _real_extract(self, url):
5c321101 32 video_id = self._match_id(url)
c514b0ec 33
add96eb9 34 config = self._download_json(f'http://vf-player-info-loader.herokuapp.com/{video_id}.json', video_id)['videoinfo']
c514b0ec 35
36 video = config.get('video')
37 blog = config.get('blog', {})
bba12cec 38
5c321101
PH
39 return {
40 'id': video_id,
c514b0ec 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)),
f4f9f6d0 49 'like_count': int_or_none(video.get('likes')),
c514b0ec 50 'comment_count': int_or_none(video.get('nrOfComments')),
5c321101 51 }