user234683 / youtube-local

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

How to host on different port? #156

Closed ghost closed 1 year ago

ghost commented 1 year ago

I already have a service using port 8080. I tried changing the port in settings.py but doesnt do anything.

user234683 commented 1 year ago

You need to restart youtube-local after changing the port

ghost commented 1 year ago

I'm not sure it's working, it still seems to try to use port 8080 even if i set it to something like 8086. I edit settings.py and then do python3 server.py but it still get this.

Running in non-portable mode
Tor routing is OFF - your Youtube activity is NOT anonymous
Started httpserver on port 8080
Traceback (most recent call last):
  File "/root/yt-local/server.py", line 277, in <module>
    server.serve_forever()
  File "/usr/local/lib/python3.9/dist-packages/gevent/baseserver.py", line 398, in serve_forever
    self.start()
  File "/usr/local/lib/python3.9/dist-packages/gevent/baseserver.py", line 336, in start
    self.init_socket()
  File "/usr/local/lib/python3.9/dist-packages/gevent/pywsgi.py", line 1545, in init_socket
    StreamServer.init_socket(self)
  File "/usr/local/lib/python3.9/dist-packages/gevent/server.py", line 180, in init_socket
    self.socket = self.get_listener(self.address, self.backlog, self.family)
  File "/usr/local/lib/python3.9/dist-packages/gevent/server.py", line 192, in get_listener
    return _tcp_listener(address, backlog=backlog, reuse_addr=cls.reuse_addr, family=family)
  File "/usr/local/lib/python3.9/dist-packages/gevent/server.py", line 288, in _tcp_listener
    sock.bind(address)
  File "/usr/local/lib/python3.9/dist-packages/gevent/_socketcommon.py", line 563, in bind
    return self._sock.bind(address)
OSError: [Errno 98] Address already in use: ('127.0.0.1', 8080)
user234683 commented 1 year ago

Did you click the save settings button after changing it?

ghost commented 1 year ago

Yes, I'm making sure to write to the file before running server.py. I should clarify what my setup looks like, should've done that earlier.

Running this off a Debian 10 VPS. git clone the repo and cd into the directory. vim settings.py and edit the 'default' option under 'port_number' to a different port, :wq. run python3 server.py, but it still gives the error I had pasted earlier.

user234683 commented 1 year ago

You don't want to edit the .py files. You need to edit settings.txt. By default it will be in ~/.youtube-local. Alternatively if you create a blank settings.txt file in the same directory it will populate that instead and store the rest of the data there (portable mode per the readme)

ghost commented 1 year ago

You don't want to edit the .py files. You need to edit settings.txt. By default it will be in ~/.youtube-local. Alternatively if you create a blank settings.txt file in the same directory it will populate that instead and store the rest of the data there (portable mode per the readme)

This did it, thanks for your time and help!