feat: add a temporary proxy for no_thumbnail

ideally, this would be served from a local resource instead of proxying
This commit is contained in:
2025-09-25 06:36:23 +02:00
parent caa9e0c2b1
commit 509e81aafa
3 changed files with 15 additions and 3 deletions

View File

@@ -54,4 +54,15 @@ def gucProxy(received_request):
guc.raw.decode_content = True
response = Response(guc.raw, mimetype=guc.headers['content-type'], status=guc.status_code)
return response
def imgProxy(received_request):
# will proxy /img/no_thumbnail.jpg
prefix = "https://i.ytimg.com/"
thumbnail = requests.get(prefix + "img/" + received_request, headers=ythdd_globals.getHeaders(caller='proxy'), stream=True)
thumbnail.raw.decode_content = True
response = Response(thumbnail.raw, mimetype=thumbnail.headers['content-type'], status=thumbnail.status_code)
return response