request information with referer
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user