feat: storyboard generation (json, webvtt) and proxy
adds support for video storyboard extraction, generation and proxying
This commit is contained in:
15
views.py
15
views.py
@@ -45,6 +45,21 @@ def thumbnailProxy(received_request):
|
||||
|
||||
return response
|
||||
|
||||
def storyboardProxy(received_request):
|
||||
|
||||
# will proxy storyboards
|
||||
prefix = "https://i.ytimg.com/"
|
||||
sqp = request.args.get("sqp")
|
||||
sigh = request.args.get("sigh")
|
||||
|
||||
if sqp is None or sigh is None:
|
||||
return Response(json.dumps({"status": "error", "error": "Request lacks the sqp, sigh params (or both)."}), mimetype="application/json", status=400)
|
||||
|
||||
sb = requests.get(prefix + "sb/" + received_request, headers=ythdd_globals.getHeaders(caller='proxy'), params={"sqp": sqp, "sigh": sigh}, stream=True)
|
||||
sb.raw.decode_content = True
|
||||
response = Response(sb.raw, mimetype=sb.headers['content-type'], status=sb.status_code)
|
||||
return response
|
||||
|
||||
def ggphtProxy(received_request):
|
||||
|
||||
prefix = "https://yt3.ggpht.com/"
|
||||
|
||||
Reference in New Issue
Block a user