3 from .common
import InfoExtractor
16 class MyVideoGeIE(InfoExtractor
):
17 _VALID_URL
= r
'https?://(?:www\.)?myvideo\.ge/v/(?P<id>[0-9]+)'
19 'url': 'https://www.myvideo.ge/v/3941048',
20 'md5': '8c192a7d2b15454ba4f29dc9c9a52ea9',
24 'title': 'The best prikol',
25 'upload_date': '20200611',
26 'thumbnail': r
're:^https?://.*\.jpg$',
27 'uploader': 'chixa33',
28 'description': 'md5:5b067801318e33c2e6eea4ab90b1fdd3',
31 _MONTH_NAMES_KA
= ['იანვარი', 'თებერვალი', 'მარტი', 'აპრილი', 'მაისი', 'ივნისი', 'ივლისი', 'აგვისტო', 'სექტემბერი', 'ოქტომბერი', 'ნოემბერი', 'დეკემბერი']
33 _quality
= staticmethod(qualities(('SD', 'HD')))
35 def _real_extract(self
, url
):
36 video_id
= self
._match
_id
(url
)
37 webpage
= self
._download
_webpage
(url
, video_id
)
40 self
._og
_search
_title
(webpage
, default
=None)
41 or clean_html(get_element_by_class('my_video_title', webpage
))
42 or self
._html
_search
_regex
(r
'<title\b[^>]*>([^<]+)</title\b', webpage
, 'title'))
44 jwplayer_sources
= self
._parse
_json
(
46 r
'''(?s)jwplayer\s*\(\s*['"]mvplayer['"]\s*\)\s*\.\s*setup\s*\(.*?\bsources\s*:\s*(\[.*?])\s*[,});]''', webpage
, 'jwplayer sources', fatal
=False)
48 video_id
, transform_source
=js_to_json
, fatal
=False)
50 formats
= self
._parse
_jwplayer
_formats
(jwplayer_sources
or [], video_id
)
51 for f
in formats
or []:
52 f
['quality'] = self
._quality
(f
['format_id'])
55 self
._og
_search
_description
(webpage
)
56 or get_element_by_id('long_desc_holder', webpage
)
57 or self
._html
_search
_meta
('description', webpage
))
59 uploader
= self
._search
_regex
(r
'<a[^>]+class="mv_user_name"[^>]*>([^<]+)<', webpage
, 'uploader', fatal
=False)
61 upload_date
= get_element_by_class('mv_vid_upl_date', webpage
)
62 # as ka locale may not be present roll a local date conversion
63 upload_date
= (unified_strdate(
64 # translate any ka month to an en one
65 re
.sub('|'.join(self
._MONTH
_NAMES
_KA
),
66 lambda m
: MONTH_NAMES
['en'][self
._MONTH
_NAMES
_KA
.index(m
.group(0))],
67 upload_date
, flags
=re
.I
))
68 if upload_date
else None)
73 'description': description
,
76 'thumbnail': self
._og
_search
_thumbnail
(webpage
),
77 'upload_date': upload_date
,
78 'view_count': int_or_none(get_element_by_class('mv_vid_views', webpage
)),
79 'like_count': int_or_none(get_element_by_id('likes_count', webpage
)),
80 'dislike_count': int_or_none(get_element_by_id('dislikes_count', webpage
)),