1 from .common
import InfoExtractor
11 class IndavideoEmbedIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://(?:(?:embed\.)?indavideo\.hu/player/video/|assets\.indavideo\.hu/swf/player\.swf\?.*\b(?:v(?:ID|id))=)(?P<id>[\da-f]+)'
13 # Some example URLs covered by generic extractor:
14 # https://indavideo.hu/video/Vicces_cica_1
15 # https://index.indavideo.hu/video/Hod_Nemetorszagban
16 # https://auto.indavideo.hu/video/Sajat_utanfutoban_a_kis_tacsko
17 # https://film.indavideo.hu/video/f_farkaslesen
18 # https://palyazat.indavideo.hu/video/Embertelen_dal_Dodgem_egyuttes
19 _EMBED_REGEX
= [r
'<iframe[^>]+\bsrc=["\'](?P
<url
>(?
:https?
:)//embed\
.indavideo\
.hu
/player
/video
/[\da
-f
]+)']
21 'url
': 'https
://indavideo
.hu
/player
/video
/1bdc3c6d80
/',
22 'md5
': 'c8a507a1c7410685f83a06eaeeaafeab
',
28 'thumbnail
': r're
:^https?
://.*\
.jpg$
',
29 'uploader
': 'cukiajanlo
',
30 'uploader_id
': '83729',
31 'timestamp
': 1439193826,
32 'upload_date
': '20150810',
35 'tags
': ['tánc
', 'cica
', 'cuki
', 'cukiajanlo
', 'newsroom
'],
38 'url
': 'https
://embed
.indavideo
.hu
/player
/video
/1bdc3c6d80?autostart
=1&hide
=1',
39 'only_matching
': True,
42 'url
': 'https
://indavideo
.hu
/video
/Vicces_cica_1
',
46 'title
': 'Vicces cica
',
47 'description
': 'Játszik a tablettel
. :D
',
48 'thumbnail
': r're
:^https?
://.*\
.jpg$
',
49 'uploader
': 'Jet_Pack
',
50 'uploader_id
': '491217',
51 'timestamp
': 1390821212,
52 'upload_date
': '20140127',
55 'tags
': ['cica
', 'Jet_Pack
'],
59 def _real_extract(self, url):
60 video_id = self._match_id(url)
62 video = self._download_json(
63 f'https
://amfphp
.indavideo
.hu
/SYm0json
.php
/player
.playerHandler
.getVideoData
/{video_id}
/',
64 video_id, query={'_
': time_seconds()})['data
']
68 video_files = video.get('video_files
')
69 if isinstance(video_files, list):
70 video_urls.extend(video_files)
71 elif isinstance(video_files, dict):
72 video_urls.extend(video_files.values())
74 video_urls = list(set(video_urls))
76 filesh = video.get('filesh
') or {}
79 for video_url in video_urls:
80 height = int_or_none(self._search_regex(
81 r'\
.(\d
{3,4})\
.mp4(?
:\?|$
)', video_url, 'height
', default=None))
82 if not height and len(filesh) == 1:
83 height = int_or_none(next(iter(filesh.keys())))
84 token = filesh.get(str(height))
88 'url
': update_url_query(video_url, {'token
': token}),
92 timestamp = video.get('date
')
94 # upload date is in CEST
95 timestamp = parse_iso8601(timestamp + ' +0200', ' ')
98 'url
': self._proto_relative_url(thumbnail),
99 } for thumbnail in video.get('thumbnails
', [])]
101 tags = [tag['title
'] for tag in video.get('tags
') or []]
104 'id': video.get('id') or video_id,
105 'title
': video.get('title
'),
106 'description
': video.get('description
'),
107 'thumbnails
': thumbnails,
108 'uploader
': video.get('user_name
'),
109 'uploader_id
': video.get('user_id
'),
110 'timestamp
': timestamp,
111 'duration
': int_or_none(video.get('length
')),
112 'age_limit
': parse_age_limit(video.get('age_limit
')),