Skip to content

Commit

Permalink
[ie/youtube] Check newly uploaded iOS HLS formats (#8336)
Browse files Browse the repository at this point in the history
Closes #7747
Authored by: bashonly
  • Loading branch information
bashonly committed Oct 28, 2023
1 parent 39abae2 commit ef79d20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion yt_dlp/YoutubeDL.py
Expand Up @@ -2338,7 +2338,7 @@ def _check_formats(formats):
return

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])
else:
yield f
Expand Down
8 changes: 8 additions & 0 deletions yt_dlp/extractor/youtube.py
Expand Up @@ -4560,6 +4560,14 @@ def process_language(container, base_url, lang_code, sub_name, query):
self._parse_time_text(self._get_text(vpir, 'dateText'))) or 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')]:
v = info.get(s_k)
if v:
Expand Down

0 comments on commit ef79d20

Please sign in to comment.