user234683 / youtube-local

browser-based client for watching Youtube anonymously and with greater page performance
GNU Affero General Public License v3.0
517 stars 63 forks source link

No thumbnails loaded when running on uwsgi #198

Closed alive4ever closed 7 months ago

alive4ever commented 8 months ago

When running server.py via uwsgi, no thumbnails are loaded.

Here is a snippet of the error. Full log is attached.

Traceback (most recent call last):
  File "server.py", line 241, in site_dispatch
    yield from handler(env, start_response)
  File "server.py", line 95, in proxy_site
    start_response(str(response.status) + ' ' + response.reason,
TypeError: http headers must be in a python list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "server.py", line 247, in site_dispatch
    start_response('500 Internal Server Error', ())
TypeError: http headers must be in a python list

While debugging this error, I came up with this simple fix that fixes the issue for me.

diff --git a/server.py b/server.py
index 1efd3aa..4915c7c 100644
--- a/server.py
+++ b/server.py
@@ -93,7 +93,7 @@ def proxy_site(env, start_response, video=False):

         if first_attempt:
             start_response(str(response.status) + ' ' + response.reason,
-                           response_headers)
+                           list(response_headers))

         content_length = int(dict(response_headers).get('Content-Length', 0))
         if response.status >= 400:

Here is the full log of server.py under uwsgi running as http-socket.

bugreport.log