From 26f2aa3db96cf44764d69b32db78b7a48752a016 Mon Sep 17 00:00:00 2001 From: Ashish Gupta <39122144+Ashish0804@users.noreply.github.com> Date: Sat, 1 Jan 2022 02:32:23 +0530 Subject: [PATCH] [hotstar] Add extractor args to ignore tags (#2116) Authored by: Ashish0804 --- README.md | 5 +++++ yt_dlp/extractor/hotstar.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 3490721b9..e9785764b 100644 --- a/README.md +++ b/README.md @@ -1631,6 +1631,11 @@ The following extractors use this feature: #### gamejolt * `comment_sort`: `hot` (default), `you` (cookies needed), `top`, `new` - choose comment sorting mode (on GameJolt's side) +#### hotstar +* `res`: resolution to ignore - one or more of `sd`, `hd`, `fhd` +* `vcodec`: vcodec to ignore - one or more of `h264`, `h265`, `dvh265` +* `dr`: dynamic range to ignore - one or more of `sdr`, `hdr10`, `dv` + NOTE: These options may be changed/removed in the future without concern for backward compatibility diff --git a/yt_dlp/extractor/hotstar.py b/yt_dlp/extractor/hotstar.py index de2b30cf7..a0ce1f10a 100644 --- a/yt_dlp/extractor/hotstar.py +++ b/yt_dlp/extractor/hotstar.py @@ -203,6 +203,9 @@ class HotStarIE(HotStarBaseIE): format_url = re.sub( r'(?<=//staragvod)(\d)', r'web\1', format_url) tags = str_or_none(playback_set.get('tagsCombination')) or '' + ingored_res, ignored_vcodec, ignored_dr = self._configuration_arg('res'), self._configuration_arg('vcodec'), self._configuration_arg('dr') + if any(f'resolution:{ig_res}' in tags for ig_res in ingored_res) or any(f'video_codec:{ig_vc}' in tags for ig_vc in ignored_vcodec) or any(f'dynamic_range:{ig_dr}' in tags for ig_dr in ignored_dr): + continue ext = determine_ext(format_url) current_formats, current_subs = [], {} try: