mirror of https://github.com/yt-dlp/yt-dlp.git
Compare commits
4 Commits
c9abebb851
...
e6ab678e36
Author | SHA1 | Date |
---|---|---|
pukkandan | e6ab678e36 | |
pukkandan | ab1de9cb1e | |
makeworld | 871c907454 | |
Elyse | 0551511b45 |
|
@ -3376,18 +3376,19 @@ class YoutubeDL:
|
|||
[info_filename], mode='r',
|
||||
openhook=fileinput.hook_encoded('utf-8'))) as f:
|
||||
# FileInput doesn't have a read method, we can't call json.load
|
||||
info = self.sanitize_info(json.loads('\n'.join(f)), self.params.get('clean_infojson', True))
|
||||
try:
|
||||
self.__download_wrapper(self.process_ie_result)(info, download=True)
|
||||
except (DownloadError, EntryNotInPlaylist, ReExtractInfo) as e:
|
||||
if not isinstance(e, EntryNotInPlaylist):
|
||||
self.to_stderr('\r')
|
||||
webpage_url = info.get('webpage_url')
|
||||
if webpage_url is not None:
|
||||
infos = [self.sanitize_info(info, self.params.get('clean_infojson', True))
|
||||
for info in variadic(json.loads('\n'.join(f)))]
|
||||
for info in infos:
|
||||
try:
|
||||
self.__download_wrapper(self.process_ie_result)(info, download=True)
|
||||
except (DownloadError, EntryNotInPlaylist, ReExtractInfo) as e:
|
||||
if not isinstance(e, EntryNotInPlaylist):
|
||||
self.to_stderr('\r')
|
||||
webpage_url = info.get('webpage_url')
|
||||
if webpage_url is None:
|
||||
raise
|
||||
self.report_warning(f'The info failed to download: {e}; trying with URL {webpage_url}')
|
||||
return self.download([webpage_url])
|
||||
else:
|
||||
raise
|
||||
self.download([webpage_url])
|
||||
return self._download_retcode
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -952,6 +952,8 @@ def _real_main(argv=None):
|
|||
parser.destroy()
|
||||
try:
|
||||
if opts.load_info_filename is not None:
|
||||
if all_urls:
|
||||
ydl.report_warning('URLs are ignored due to --load-info-json')
|
||||
return ydl.download_with_info_file(expand_path(opts.load_info_filename))
|
||||
else:
|
||||
return ydl.download(all_urls)
|
||||
|
|
|
@ -202,7 +202,7 @@ class CBCPlayerIE(InfoExtractor):
|
|||
|
||||
class CBCGemIE(InfoExtractor):
|
||||
IE_NAME = 'gem.cbc.ca'
|
||||
_VALID_URL = r'https?://gem\.cbc\.ca/media/(?P<id>[0-9a-z-]+/s[0-9]+[a-z][0-9]+)'
|
||||
_VALID_URL = r'https?://gem\.cbc\.ca/(?:media/)?(?P<id>[0-9a-z-]+/s[0-9]+[a-z][0-9]+)'
|
||||
_TESTS = [{
|
||||
# This is a normal, public, TV show video
|
||||
'url': 'https://gem.cbc.ca/media/schitts-creek/s06e01',
|
||||
|
@ -245,6 +245,9 @@ class CBCGemIE(InfoExtractor):
|
|||
},
|
||||
'params': {'format': 'bv'},
|
||||
'skip': 'Geo-restricted to Canada',
|
||||
}, {
|
||||
'url': 'https://gem.cbc.ca/nadiyas-family-favourites/s01e01',
|
||||
'only_matching': True,
|
||||
}]
|
||||
|
||||
_GEO_COUNTRIES = ['CA']
|
||||
|
|
|
@ -47,15 +47,16 @@ class HiDiveIE(InfoExtractor):
|
|||
login_webpage = self._download_webpage(
|
||||
self._LOGIN_URL, None, 'Logging in', data=urlencode_postdata(data))
|
||||
# If the user has multiple profiles on their account, select one. For now pick the first profile.
|
||||
profile_id = self._search_regex(r'<button [^>]+?data-profile-id="(\w+)"', login_webpage, 'profile_id')
|
||||
profile_id = self._search_regex(
|
||||
r'<button [^>]+?data-profile-id="(\w+)"', login_webpage, 'profile id', default=None)
|
||||
if profile_id is None:
|
||||
return # If only one profile, Hidive auto-selects it
|
||||
profile_id_hash = self._search_regex(r'\<button [^>]+?data-hash="(\w+)"', login_webpage, 'profile_id_hash')
|
||||
self._request_webpage(
|
||||
'https://www.hidive.com/ajax/chooseprofile', None,
|
||||
data=urlencode_postdata({
|
||||
'profileId': profile_id,
|
||||
'hash': profile_id_hash,
|
||||
'hash': self._search_regex(
|
||||
r'\<button [^>]+?data-hash="(\w+)"', login_webpage, 'profile id hash'),
|
||||
'returnUrl': '/dashboard'
|
||||
}))
|
||||
|
||||
|
|
|
@ -456,7 +456,7 @@ class TwitchVodIE(TwitchBaseIE):
|
|||
thumbnail = url_or_none(info.get('previewThumbnailURL'))
|
||||
is_live = None
|
||||
if thumbnail:
|
||||
if thumbnail.endswith('/404_processing_{width}x{height}.png'):
|
||||
if re.findall(r'/404_processing_[^.?#]+\.png', thumbnail):
|
||||
is_live, thumbnail = True, None
|
||||
else:
|
||||
is_live = False
|
||||
|
|
Loading…
Reference in New Issue