Upgrade yt_dlp and download script
This commit is contained in:
@@ -5,6 +5,7 @@ from ..networking.exceptions import HTTPError
|
||||
from ..utils import (
|
||||
ExtractorError,
|
||||
int_or_none,
|
||||
join_nonempty,
|
||||
parse_age_limit,
|
||||
traverse_obj,
|
||||
)
|
||||
@@ -12,7 +13,7 @@ from ..utils import (
|
||||
|
||||
class ViewLiftBaseIE(InfoExtractor):
|
||||
_API_BASE = 'https://prod-api.viewlift.com/'
|
||||
_DOMAINS_REGEX = r'(?:(?:main\.)?snagfilms|snagxtreme|funnyforfree|kiddovid|winnersview|(?:monumental|lax)sportsnetwork|vayafilm|failarmy|ftfnext|lnppass\.legapallacanestro|moviespree|app\.myoutdoortv|neoufitness|pflmma|theidentitytb)\.com|(?:hoichoi|app\.horseandcountry|kronon|marquee|supercrosslive)\.tv'
|
||||
_DOMAINS_REGEX = r'(?:(?:main\.)?snagfilms|snagxtreme|funnyforfree|kiddovid|winnersview|(?:monumental|lax)sportsnetwork|vayafilm|failarmy|ftfnext|lnppass\.legapallacanestro|moviespree|app\.myoutdoortv|neoufitness|pflmma|theidentitytb|chorki)\.com|(?:hoichoi|app\.horseandcountry|kronon|marquee|supercrosslive)\.tv'
|
||||
_SITE_MAP = {
|
||||
'ftfnext': 'lax',
|
||||
'funnyforfree': 'snagfilms',
|
||||
@@ -27,6 +28,7 @@ class ViewLiftBaseIE(InfoExtractor):
|
||||
'snagxtreme': 'snagfilms',
|
||||
'theidentitytb': 'tampabay',
|
||||
'vayafilm': 'snagfilms',
|
||||
'chorki': 'prothomalo',
|
||||
}
|
||||
_TOKENS = {}
|
||||
|
||||
@@ -61,8 +63,8 @@ class ViewLiftBaseIE(InfoExtractor):
|
||||
|
||||
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',
|
||||
@@ -73,7 +75,7 @@ class ViewLiftEmbedIE(ViewLiftBaseIE):
|
||||
'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',
|
||||
@@ -97,7 +99,7 @@ class ViewLiftEmbedIE(ViewLiftBaseIE):
|
||||
|
||||
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']
|
||||
@@ -119,7 +121,7 @@ class ViewLiftEmbedIE(ViewLiftBaseIE):
|
||||
'height', default=None))
|
||||
formats.append({
|
||||
'url': video_asset_url,
|
||||
'format_id': 'http%s' % ('-%d' % bitrate if bitrate else ''),
|
||||
'format_id': join_nonempty('http', bitrate),
|
||||
'tbr': bitrate,
|
||||
'height': height,
|
||||
'vcodec': video_asset.get('codec'),
|
||||
@@ -152,7 +154,7 @@ class ViewLiftEmbedIE(ViewLiftBaseIE):
|
||||
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',
|
||||
@@ -168,7 +170,7 @@ class ViewLiftIE(ViewLiftBaseIE):
|
||||
'age_limit': 14,
|
||||
'upload_date': '20150421',
|
||||
'timestamp': 1429656820,
|
||||
}
|
||||
},
|
||||
}, {
|
||||
'url': 'http://www.snagfilms.com/show/the_world_cut_project/india',
|
||||
'md5': 'e6292e5b837642bbda82d7f8bf3fbdfd',
|
||||
@@ -182,7 +184,7 @@ class ViewLiftIE(ViewLiftBaseIE):
|
||||
'duration': 979,
|
||||
'timestamp': 1399478279,
|
||||
'upload_date': '20140507',
|
||||
}
|
||||
},
|
||||
}, {
|
||||
'url': 'http://main.snagfilms.com/augie_alone/s_2_ep_12_love',
|
||||
'info_dict': {
|
||||
@@ -230,7 +232,6 @@ class ViewLiftIE(ViewLiftBaseIE):
|
||||
'description': 'md5:e28f2fb8680096a69c944d37c1fa5ffc',
|
||||
'thumbnail': r're:^https?://.*\.jpg$',
|
||||
'upload_date': '20211006',
|
||||
'series': None
|
||||
},
|
||||
'params': {'skip_download': True},
|
||||
}, { # Free film
|
||||
@@ -242,7 +243,6 @@ class ViewLiftIE(ViewLiftBaseIE):
|
||||
'description': 'md5:605cba408e51a79dafcb824bdeded51e',
|
||||
'thumbnail': r're:^https?://.*\.jpg$',
|
||||
'upload_date': '20210827',
|
||||
'series': None
|
||||
},
|
||||
'params': {'skip_download': True},
|
||||
}, { # Free episode
|
||||
@@ -254,7 +254,7 @@ class ViewLiftIE(ViewLiftBaseIE):
|
||||
'description': 'md5:ca30a682b4528d02a3eb6d0427dd0f87',
|
||||
'thumbnail': r're:^https?://.*\.jpg$',
|
||||
'upload_date': '20210830',
|
||||
'series': 'Case Jaundice'
|
||||
'series': 'Case Jaundice',
|
||||
},
|
||||
'params': {'skip_download': True},
|
||||
}, { # Free video
|
||||
@@ -266,7 +266,7 @@ class ViewLiftIE(ViewLiftBaseIE):
|
||||
'description': 'md5:9d21edc1827d32f8633eb67c2054fc31',
|
||||
'thumbnail': r're:^https?://.*\.jpg$',
|
||||
'upload_date': '20211006',
|
||||
'series': 'Six (Hindi)'
|
||||
'series': 'Six (Hindi)',
|
||||
},
|
||||
'params': {'skip_download': True},
|
||||
}, { # Free episode
|
||||
@@ -278,7 +278,7 @@ class ViewLiftIE(ViewLiftBaseIE):
|
||||
'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
|
||||
@@ -295,12 +295,39 @@ class ViewLiftIE(ViewLiftBaseIE):
|
||||
},
|
||||
}, { # 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,
|
||||
'info_dict': {
|
||||
'id': 'bn/series/sinpaat',
|
||||
},
|
||||
}, { # Chorki free movie
|
||||
'url': 'https://www.chorki.com/bn/videos/bangla-movie-bikkhov',
|
||||
'info_dict': {
|
||||
'id': '564e755b-f5c7-4515-aee6-8959bee18c93',
|
||||
'title': 'Bikkhov',
|
||||
'ext': 'mp4',
|
||||
'upload_date': '20230824',
|
||||
'timestamp': 1692860553,
|
||||
'categories': ['Action Movies', 'Salman Special'],
|
||||
'tags': 'count:14',
|
||||
'thumbnail': 'https://snagfilms-a.akamaihd.net/dd078ff5-b16e-45e4-9723-501b56b9df0a/images/2023/08/24/1692860450729_1920x1080_16x9Images.jpg',
|
||||
'display_id': 'bn/videos/bangla-movie-bikkhov',
|
||||
'description': 'md5:71492b086450625f4374a3eb824f27dc',
|
||||
'duration': 8002,
|
||||
},
|
||||
'params': {
|
||||
'skip_download': True,
|
||||
},
|
||||
}, { # Chorki Premium movie
|
||||
'url': 'https://www.chorki.com/bn/videos/something-like-an-autobiography',
|
||||
'only_matching': True,
|
||||
}]
|
||||
|
||||
@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:
|
||||
@@ -329,7 +356,7 @@ class ViewLiftIE(ViewLiftBaseIE):
|
||||
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',
|
||||
|
Reference in New Issue
Block a user