request information with referer
This commit is contained in:
@@ -471,7 +471,15 @@ def stream_video():
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
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:
|
||||
# Extract the info
|
||||
info = ydl.extract_info(video_url, download=False)
|
||||
|
||||
Reference in New Issue
Block a user