user234683 / youtube-local

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

Dark theme seems to cause error #166

Closed ydalton closed 1 year ago

ydalton commented 1 year ago

I just installed this program and went to settings. I enabled dark mode and set the default resolution of videos to be 480p. When I went to watch a video, I got this error:

Traceback (most recent call last):
  File "/home/pino/.local/lib/python3.11/site-packages/flask/app.py", line 2528, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pino/.local/lib/python3.11/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pino/.local/lib/python3.11/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pino/.local/lib/python3.11/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pino/Documents/git/youtube-local/youtube/search.py", line 77, in get_search_page
    polymer_json = get_search_json(query, page, autocorrect, sort, filters)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pino/Documents/git/youtube-local/youtube/search.py", line 56, in get_search_json
    content = util.fetch_url(url, headers=headers, report_text="Got search results", debug_name='search_results')
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/pino/Documents/git/youtube-local/youtube/util.py", line 364, in fetch_url
    print(report_text, '    Latency:', round(response_time - start_time,3), '    Read time:', round(read_finish - response_time,3))
OSError: [Errno 5] Input/output error

OS: Fedora 38

user234683 commented 1 year ago

It's not related to dark mode. It seems the program does not have access to stdout. Are you running it in a terminal or from a cron job? You need to make sure it can output correctly. See https://github.com/user234683/youtube-local/issues/88

ydalton commented 1 year ago

It's not related to dark mode. It seems the program does not have access to stdout. Are you running it in a terminal or from a cron job? You need to make sure it can output correctly. See #88

Now I use a systemd script to autostart, but when this issue appear I think I ran the server through the terminal. After using the systemd script I don't seem to have this issue anymore.