1 from .common
import InfoExtractor
12 class WeyyakIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://weyyak\.com/(?P<lang>\w+)/(?:player/)?(?P<type>episode|movie)/(?P<id>\d+)'
16 'url': 'https://weyyak.com/en/player/episode/1341952/Ribat-Al-Hob-Episode49',
17 'md5': '0caf55c1a615531c8fe60f146ae46849',
21 'title': 'Ribat Al Hob',
23 'alt_title': 'رباط الحب',
26 'episode': 'Episode 49',
28 'timestamp': 1485907200,
29 'upload_date': '20170201',
30 'thumbnail': r
're:^https://content\.weyyak\.com/.+/poster-image',
31 'categories': ['Drama', 'Thrillers', 'Romance'],
36 'url': 'https://weyyak.com/en/movie/233255/8-Seconds',
37 'md5': 'fe740ae0f63e4d1c8a7fc147a410c564',
43 'alt_title': '8 ثواني',
44 'description': 'md5:45b83a155c30b49950624c7e99600b9d',
47 'timestamp': 1683106031,
48 'upload_date': '20230503',
49 'thumbnail': r
're:^https://content\.weyyak\.com/.+/poster-image',
50 'categories': ['Drama', 'Social'],
51 'cast': ['Ceylin Adiyaman', 'Esra Inal'],
56 def _real_extract(self
, url
):
57 video_id
, lang
, type_
= self
._match
_valid
_url
(url
).group('id', 'lang', 'type')
59 path
= 'episode/' if type_
== 'episode' else 'contents/moviedetails?contentkey='
60 data
= self
._download
_json
(
61 f
'https://msapifo-prod-me.weyyak.z5.com/v1/{lang}/{path}{video_id}', video_id
)['data']
62 m3u8_url
= self
._download
_json
(
63 f
'https://api-weyyak.akamaized.net/get_info/{data["video_id"]}',
64 video_id
, 'Extracting video details')['url_video']
65 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(m3u8_url
, video_id
)
70 'subtitles': subtitles
,
71 **traverse_obj(data
, {
72 'title': ('title', {str}
),
73 'alt_title': ('translated_title', {str}
),
74 'description': ('synopsis', {str}
),
75 'duration': ('length', {float_or_none}
),
76 'age_limit': ('age_rating', {parse_age_limit}
),
77 'season_number': ('season_number', {int_or_none}
),
78 'episode_number': ('episode_number', {int_or_none}
),
79 'thumbnail': ('imagery', 'thumbnail', {url_or_none}
),
80 'categories': ('genres', ..., {str}
),
81 'tags': ('tags', ..., {str}
),
82 'cast': (('main_actor', 'main_actress'), {str}
),
83 'timestamp': ('insertedAt', {unified_timestamp}
),
84 'release_year': ('production_year', {int_or_none}
),