fix: handle url rewrite when querying wrong endpoint
materialious is guilty of this
This commit is contained in:
4
views.py
4
views.py
@@ -36,6 +36,10 @@ def ggphtProxy(received_request):
|
||||
|
||||
prefix = "https://yt3.ggpht.com/"
|
||||
|
||||
# fix for how materialious fetches avatars
|
||||
if received_request.startswith("guc/"):
|
||||
return gucProxy(received_request.removeprefix("guc/"))
|
||||
|
||||
ggpht = requests.get(prefix + received_request, headers=ythdd_globals.getHeaders(caller='proxy'), stream=True)
|
||||
ggpht.raw.decode_content = True
|
||||
response = Response(ggpht.raw, mimetype=ggpht.headers['content-type'], status=ggpht.status_code)
|
||||
|
||||
Reference in New Issue
Block a user