class ViewLiftEmbedIE(ViewLiftBaseIE):
IE_NAME = 'viewlift:embed'
- _VALID_URL = r'https?://(?:(?:www|embed)\.)?(?P<domain>%s)/embed/player\?.*\bfilmId=(?P<id>[\da-f]{8}-(?:[\da-f]{4}-){3}[\da-f]{12})' % ViewLiftBaseIE._DOMAINS_REGEX
- _EMBED_REGEX = [r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:embed\.)?(?:%s)/embed/player.+?)\1' % ViewLiftBaseIE._DOMAINS_REGEX]
+ _VALID_URL = rf'https?://(?:(?:www|embed)\.)?(?P<domain>{ViewLiftBaseIE._DOMAINS_REGEX})/embed/player\?.*\bfilmId=(?P<id>[\da-f]{{8}}-(?:[\da-f]{{4}}-){{3}}[\da-f]{{12}})'
+ _EMBED_REGEX = [rf'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:embed\.)?(?:{ViewLiftBaseIE._DOMAINS_REGEX})/embed/player.+?)\1']
_TESTS = [{
'url': 'http://embed.snagfilms.com/embed/player?filmId=74849a00-85a9-11e1-9660-123139220831&w=500',
'md5': '2924e9215c6eff7a55ed35b72276bd93',
'description': 'md5:b542bef32a6f657dadd0df06e26fb0c8',
'timestamp': 1334350096,
'upload_date': '20120413',
- }
+ },
}, {
# invalid labels, 360p is better that 480p
'url': 'http://www.snagfilms.com/embed/player?filmId=17ca0950-a74a-11e0-a92a-0026bb61d036',
content_data = self._call_api(
site, 'entitlement/video/status', film_id, url, {
- 'id': film_id
+ 'id': film_id,
})['video']
gist = content_data['gist']
title = gist['title']
'height', default=None))
formats.append({
'url': video_asset_url,
- 'format_id': 'http%s' % ('-%d' % bitrate if bitrate else ''),
+ 'format_id': 'http{}'.format(f'-{bitrate}' if bitrate else ''),
'tbr': bitrate,
'height': height,
'vcodec': video_asset.get('codec'),
class ViewLiftIE(ViewLiftBaseIE):
IE_NAME = 'viewlift'
_API_BASE = 'https://prod-api-cached-2.viewlift.com/'
- _VALID_URL = r'https?://(?:www\.)?(?P<domain>%s)(?P<path>(?:/(?:films/title|show|(?:news/)?videos?|watch))?/(?P<id>[^?#]+))' % ViewLiftBaseIE._DOMAINS_REGEX
+ _VALID_URL = rf'https?://(?:www\.)?(?P<domain>{ViewLiftBaseIE._DOMAINS_REGEX})(?P<path>(?:/(?:films/title|show|(?:news/)?videos?|watch))?/(?P<id>[^?#]+))'
_TESTS = [{
'url': 'http://www.snagfilms.com/films/title/lost_for_life',
'md5': '19844f897b35af219773fd63bdec2942',
'age_limit': 14,
'upload_date': '20150421',
'timestamp': 1429656820,
- }
+ },
}, {
'url': 'http://www.snagfilms.com/show/the_world_cut_project/india',
'md5': 'e6292e5b837642bbda82d7f8bf3fbdfd',
'duration': 979,
'timestamp': 1399478279,
'upload_date': '20140507',
- }
+ },
}, {
'url': 'http://main.snagfilms.com/augie_alone/s_2_ep_12_love',
'info_dict': {
'description': 'md5:e28f2fb8680096a69c944d37c1fa5ffc',
'thumbnail': r're:^https?://.*\.jpg$',
'upload_date': '20211006',
- 'series': None
},
'params': {'skip_download': True},
}, { # Free film
'description': 'md5:605cba408e51a79dafcb824bdeded51e',
'thumbnail': r're:^https?://.*\.jpg$',
'upload_date': '20210827',
- 'series': None
},
'params': {'skip_download': True},
}, { # Free episode
'description': 'md5:ca30a682b4528d02a3eb6d0427dd0f87',
'thumbnail': r're:^https?://.*\.jpg$',
'upload_date': '20210830',
- 'series': 'Case Jaundice'
+ 'series': 'Case Jaundice',
},
'params': {'skip_download': True},
}, { # Free video
'description': 'md5:9d21edc1827d32f8633eb67c2054fc31',
'thumbnail': r're:^https?://.*\.jpg$',
'upload_date': '20211006',
- 'series': 'Six (Hindi)'
+ 'series': 'Six (Hindi)',
},
'params': {'skip_download': True},
}, { # Free episode
'description': 'md5:ef6ffae01a3d83438597367400f824ed',
'thumbnail': r're:^https?://.*\.jpg$',
'upload_date': '20211004',
- 'series': 'Asian Paints Moner Thikana'
+ 'series': 'Asian Paints Moner Thikana',
},
'params': {'skip_download': True},
}, { # Free series
},
}, { # Premium movie
'url': 'https://www.hoichoi.tv/movies/detective-2020',
- 'only_matching': True
+ 'only_matching': True,
}, { # Chorki Premium series
'url': 'https://www.chorki.com/bn/series/sinpaat',
'playlist_mincount': 7,
@classmethod
def suitable(cls, url):
- return False if ViewLiftEmbedIE.suitable(url) else super(ViewLiftIE, cls).suitable(url)
+ return False if ViewLiftEmbedIE.suitable(url) else super().suitable(url)
def _show_entries(self, domain, seasons):
for season in seasons:
film_id = next(m['contentData'][0]['gist']['id'] for m in modules if m.get('moduleType') == 'VideoDetailModule')
return {
'_type': 'url_transparent',
- 'url': 'http://%s/embed/player?filmId=%s' % (domain, film_id),
+ 'url': f'http://{domain}/embed/player?filmId={film_id}',
'id': film_id,
'display_id': display_id,
'ie_key': 'ViewLiftEmbed',