all repos — FixYouTube-legacy @ 6394a2385768605c8c2b66f3c9a0f6353e68ec91

A better way to embed YouTube videos everywhere (inspired by FixTweet).

fix Connection broken: IncompleteRead
Andronaco Marco marco.andronaco@olivetti.com
Mon, 18 Dec 2023 15:37:06 +0100
commit

6394a2385768605c8c2b66f3c9a0f6353e68ec91

parent

5e703053115a838fbc8984de5e6c4cbffe526ba5

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M fixyoutube/views.pyfixyoutube/views.py

@@ -47,5 +47,5 @@

if result is None: return abort(400) - req = get(result.url, headers=c.PROXY_HEADERS_REQUEST) - return Response(req.content, headers=c.PROXY_HEADERS_RESPONSE) + with get(result.url, headers=c.PROXY_HEADERS_REQUEST, stream=True) as r: + return Response(r.content, headers=c.PROXY_HEADERS_RESPONSE)