1 from .common import InfoExtractor
7 class ShahidIE(InfoExtractor):
8 _VALID_URL = r'https?://shahid\.mbc\.net/ar/episode/(?P<id>\d+)/?'
11 'url': 'https://shahid.mbc.net/ar/episode/108084/%D8%AE%D9%88%D8%A7%D8%B7%D8%B1-%D8%A7%D9%84%D9%85%D9%88%D8%B3%D9%85-11-%D8%A7%D9%84%D8%AD%D9%84%D9%82%D8%A9-1.html',
16 'description': 'بسم الله'
20 'skip_download': True,
24 #shahid plus subscriber only
25 'url': 'https://shahid.mbc.net/ar/series/90497/%D9%85%D8%B1%D8%A7%D9%8A%D8%A7-2011.html',
30 def _real_extract(self, url):
31 video_id = self._match_id(url)
32 webpage = self._download_webpage(url, video_id)
33 json_data = self._parse_json(
34 get_element_by_id('jsonld', webpage),
37 title = json_data['name']
38 thumbnail = json_data['image']
39 categories = json_data['genre']
40 description = json_data['description']
41 player_json_data = self._download_json(
42 'https://shahid.mbc.net/arContent/getPlayerContent-param-.id-'+video_id+'.type-player.html',
45 if 'url' in player_json_data:
46 m3u8_url = player_json_data['url']
48 for error in json_data['error'].values():
49 raise ExtractorError(error)
51 formats = self._extract_m3u8_formats(m3u8_url, video_id)
55 'thumbnail': thumbnail,
56 'categories': categories,
57 'description': description,