youtube-dl-webui
youtube-dl-webui copied to clipboard
Running under apache mod_wsgi. NoneType has no attribute 'put'
I'd like to run the youtube_dl_webgui under apache mod_wsgi, but i did not get it to work yet. I am also quite new to flask an wsgi, so it might be my fault.
I allready tried to create a wsgi-script as described in the flask documentation:
from youtube_dl_webui.server import app as application
Apache loads that file without problems and displays the front page as it should, but any other actions result in an internal server error. Here is an example of an apache error log entry:
ERROR in app: Exception on /task/list [GET] Traceback (most recent call last): File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 2446, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1951, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1820, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/lib/python3.7/dist-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1949, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.7/dist-packages/flask/app.py", line 1935, in dispatch_request return self.view_functionsrule.endpoint File "/usr/local/lib/python3.7/dist-packages/youtube_dl_webui-rolling-py3.7.egg/youtube_dl_webui/server.py", line 42, in list_task MSG.put('list', payload) AttributeError: 'NoneType' object has no attribute 'put'
I think the problem is MSG = None
at the beginning of server.py. The MSG Variable is only initialized, when you have an Instance of the Server
class and call it's run
method. And I don't do that, when I load the app as described above. So i guess i should somehow make an instance of that Server
class in my wsgi-script. But then i don't know with which values I should initialize it (espacialy what is msg_cli).
So what would be helpful to me is either a note on how to supply this app using apache (or any other wsgi production server), or a fix for server.py (if that is possible) or even a complete wsgi script one could use.
What do you think about that?
I think this project is almost out of maintenance, and I found another alternative project. This is the website https://github.com/MyopicBadger/guitube. I hope it can help you.