mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-22 10:07:43 -05:00
[ie/youtube] Check newly uploaded iOS HLS formats (#8336)
Closes #7747 Authored by: bashonly
This commit is contained in:
parent
39abae2354
commit
ef79d20dc9
@ -2338,7 +2338,7 @@ class YoutubeDL:
|
|||||||
return
|
return
|
||||||
|
|
||||||
for f in formats:
|
for f in formats:
|
||||||
if f.get('has_drm'):
|
if f.get('has_drm') or f.get('__needs_testing'):
|
||||||
yield from self._check_formats([f])
|
yield from self._check_formats([f])
|
||||||
else:
|
else:
|
||||||
yield f
|
yield f
|
||||||
|
@ -4560,6 +4560,14 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||||||
self._parse_time_text(self._get_text(vpir, 'dateText'))) or upload_date
|
self._parse_time_text(self._get_text(vpir, 'dateText'))) or upload_date
|
||||||
info['upload_date'] = upload_date
|
info['upload_date'] = upload_date
|
||||||
|
|
||||||
|
if upload_date and live_status not in ('is_live', 'post_live', 'is_upcoming'):
|
||||||
|
# Newly uploaded videos' HLS formats are potentially problematic and need to be checked
|
||||||
|
upload_datetime = datetime_from_str(upload_date).replace(tzinfo=datetime.timezone.utc)
|
||||||
|
if upload_datetime >= datetime_from_str('today-1day'):
|
||||||
|
for fmt in info['formats']:
|
||||||
|
if fmt.get('protocol') == 'm3u8_native':
|
||||||
|
fmt['__needs_testing'] = True
|
||||||
|
|
||||||
for s_k, d_k in [('artist', 'creator'), ('track', 'alt_title')]:
|
for s_k, d_k in [('artist', 'creator'), ('track', 'alt_title')]:
|
||||||
v = info.get(s_k)
|
v = info.get(s_k)
|
||||||
if v:
|
if v:
|
||||||
|
Loading…
Reference in New Issue
Block a user