fix: use exclusively tv player for age-restricted videos

also filter out DRC audio
This commit is contained in:
2025-11-20 17:54:41 +01:00
parent eebf434f3e
commit d1f381220d
2 changed files with 8 additions and 4 deletions

View File

@@ -290,8 +290,11 @@ def videos(data):
continue
if video_stream["format_id"] == "18": # todo: do this dynamically
initial_fstreams_y[int(video_stream["format_id"])] = video_stream
else:
elif video_stream["format_id"].isdigit():
# filter out DRC audio
initial_astreams_y[int(video_stream["format_id"])] = video_stream
else:
continue
# format streams
for video_stream in wdata_streams["formats"]:
@@ -315,7 +318,8 @@ def videos(data):
hls_url = safeTraverse(ydata, ["url"], default="ythdd: unable to retrieve stream url")
if age_restricted:
adaptive_formats = [{"url": f"http://a/?expire={int(time_start + 5.9 * 60 * 60)}", "itag": "18", "type": "", "clen": "0", "lmt": "", "projectionType": "RECTANGULAR"}] # same as above
if not adaptive_formats:
adaptive_formats = [{"url": f"http://a/?expire={int(time_start + 5.9 * 60 * 60)}", "itag": "18", "type": "", "clen": "0", "lmt": "", "projectionType": "RECTANGULAR"}] # same as above
description += " \n(ythdd: this video is age-restricted and thus only available in 360p - itag 18)"
description_html += "<br/>(ythdd: this video is age-restricted and thus only available in 360p - itag 18)"