request information with referer

This commit is contained in:
Simon
2026-02-10 17:57:59 +00:00
parent 81597c3bb2
commit 081493d13f

View File

@@ -472,6 +472,14 @@ def stream_video():
}, },
} }
referer_url = ""
if request.method == 'POST':
referer_url = request.json.get('referer')
else:
referer_url = request.args.get('referer')
if len(referer_url) > 0:
ydl_opts['http_headers']["Referer"] = referer_url
with yt_dlp.YoutubeDL(ydl_opts) as ydl: with yt_dlp.YoutubeDL(ydl_opts) as ydl:
# Extract the info # Extract the info
info = ydl.extract_info(video_url, download=False) info = ydl.extract_info(video_url, download=False)