Skip to content

Commit

Permalink
[ie/eporner] Extract AV1 formats (#9028)
Browse files Browse the repository at this point in the history
Authored by: michal-repo
  • Loading branch information
michal-repo committed Feb 4, 2024
1 parent e3ce2b3 commit 96d0f8c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion yt_dlp/extractor/eporner.py
@@ -1,8 +1,10 @@
from .common import InfoExtractor
from ..utils import (
encode_base_n,
ExtractorError,
encode_base_n,
get_elements_by_class,
int_or_none,
join_nonempty,
merge_dicts,
parse_duration,
str_to_int,
Expand Down Expand Up @@ -81,6 +83,7 @@ def calc_hash(s):
sources = video['sources']

formats = []
has_av1 = bool(get_elements_by_class('download-av1', webpage))
for kind, formats_dict in sources.items():
if not isinstance(formats_dict, dict):
continue
Expand All @@ -106,6 +109,14 @@ def calc_hash(s):
'height': height,
'fps': fps,
})
if has_av1:
formats.append({
'url': src.replace('.mp4', '-av1.mp4'),
'format_id': join_nonempty('av1', format_id),
'height': height,
'fps': fps,
'vcodec': 'av1',
})

json_ld = self._search_json_ld(webpage, display_id, default={})

Expand Down

0 comments on commit 96d0f8c

Please sign in to comment.