mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-15 21:53:21 +00:00
Compare commits
No commits in common. "8d214c484c57ac3eb19043c7dc72e4f24e3018e2" and "30d22d775bc9abdbd301132b6cb7a57badb796dc" have entirely different histories.
8d214c484c
...
30d22d775b
@ -2375,15 +2375,6 @@ class YoutubeDL:
|
|||||||
if (info_dict.get('duration') or 0) <= 0 and info_dict.pop('duration', None):
|
if (info_dict.get('duration') or 0) <= 0 and info_dict.pop('duration', None):
|
||||||
self.report_warning('"duration" field is negative, there is an error in extractor')
|
self.report_warning('"duration" field is negative, there is an error in extractor')
|
||||||
|
|
||||||
chapters = info_dict.get('chapters') or []
|
|
||||||
dummy_chapter = {'end_time': 0, 'start_time': info_dict.get('duration')}
|
|
||||||
for prev, current, next_ in zip(
|
|
||||||
(dummy_chapter, *chapters), chapters, (*chapters[1:], dummy_chapter)):
|
|
||||||
if current.get('start_time') is None:
|
|
||||||
current['start_time'] = prev.get('end_time')
|
|
||||||
if not current.get('end_time'):
|
|
||||||
current['end_time'] = next_.get('start_time')
|
|
||||||
|
|
||||||
if 'playlist' not in info_dict:
|
if 'playlist' not in info_dict:
|
||||||
# It isn't part of a playlist
|
# It isn't part of a playlist
|
||||||
info_dict['playlist'] = None
|
info_dict['playlist'] = None
|
||||||
|
@ -61,18 +61,12 @@ class HlsFD(FragmentFD):
|
|||||||
s = urlh.read().decode('utf-8', 'ignore')
|
s = urlh.read().decode('utf-8', 'ignore')
|
||||||
|
|
||||||
can_download, message = self.can_download(s, info_dict, self.params.get('allow_unplayable_formats')), None
|
can_download, message = self.can_download(s, info_dict, self.params.get('allow_unplayable_formats')), None
|
||||||
if can_download:
|
if can_download and not Cryptodome_AES and '#EXT-X-KEY:METHOD=AES-128' in s:
|
||||||
has_ffmpeg = FFmpegFD.available()
|
if FFmpegFD.available():
|
||||||
no_crypto = not Cryptodome_AES and '#EXT-X-KEY:METHOD=AES-128' in s
|
|
||||||
if no_crypto and has_ffmpeg:
|
|
||||||
can_download, message = False, 'The stream has AES-128 encryption and pycryptodomex is not available'
|
can_download, message = False, 'The stream has AES-128 encryption and pycryptodomex is not available'
|
||||||
elif no_crypto:
|
else:
|
||||||
message = ('The stream has AES-128 encryption and neither ffmpeg nor pycryptodomex are available; '
|
message = ('The stream has AES-128 encryption and neither ffmpeg nor pycryptodomex are available; '
|
||||||
'Decryption will be performed natively, but will be extremely slow')
|
'Decryption will be performed natively, but will be extremely slow')
|
||||||
elif re.search(r'#EXT-X-MEDIA-SEQUENCE:(?!0$)', s):
|
|
||||||
install_ffmpeg = '' if has_ffmpeg else 'install ffmpeg and '
|
|
||||||
message = ('Live HLS streams are not supported by the native downloader. If this is a livestream, '
|
|
||||||
f'please {install_ffmpeg}add "--downloader ffmpeg --hls-use-mpegts" to your command')
|
|
||||||
if not can_download:
|
if not can_download:
|
||||||
has_drm = re.search('|'.join([
|
has_drm = re.search('|'.join([
|
||||||
r'#EXT-X-FAXS-CM:', # Adobe Flash Access
|
r'#EXT-X-FAXS-CM:', # Adobe Flash Access
|
||||||
|
@ -91,5 +91,4 @@ class CWTVIE(InfoExtractor):
|
|||||||
'timestamp': parse_iso8601(video_data.get('start_time')),
|
'timestamp': parse_iso8601(video_data.get('start_time')),
|
||||||
'age_limit': parse_age_limit(video_data.get('rating')),
|
'age_limit': parse_age_limit(video_data.get('rating')),
|
||||||
'ie_key': 'ThePlatform',
|
'ie_key': 'ThePlatform',
|
||||||
'thumbnail': video_data.get('large_thumbnail')
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user