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

Getting 500 uncaught exception error when clicking subscriptions button on homepage #191

Open rec-email-gt opened 6 months ago

rec-email-gt commented 6 months ago

Hi there, Whenever I try to see my subscriptions via the subscriptions button at the homepage I get this "500 Uncaught exception" error with the following code:

Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(*view_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lt/youtube-local/youtube/subscriptions.py", line 942, in get_subscriptions_page videos, number_of_videos_in_db = _get_videos(cursor, 60, (page - 1)60, tag) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lt/youtube-local/youtube/subscriptions.py", line 177, in _get_videos 'time_published': exact_timestamp(db_video[3]) if db_video[4] else posix_to_dumbed_down(db_video[3]), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lt/youtube-local/youtube/subscriptions.py", line 282, in posix_to_dumbed_down delta = int(time.time() - posix_time)


TypeError: unsupported operand type(s) for -: 'float' and 'str'

A few days ago it'd only happen after tagging and grouping a bunch of channels by tags in the subscription manager, but as of today it's started happening with no tags or grouping at all.

Thanks a lot in advance!
Cheers!
user234683 commented 6 months ago

Can you add this before line 282 in /home/lt/youtube-local/youtube/subscriptions.py: print(posix_time) print(time.time())

rec-email-gt commented 6 months ago

Hi there! Thanks for your response! I just did what you suggested, but I'm still getting a very similar error under the same circumstances. Here's the text of the current error in case there's any significant difference from the one I'd already shared further above:

Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app response = self.full_dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request rv = self.handle_user_exception(e) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(*view_args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lt/youtube-local/youtube/subscriptions.py", line 944, in get_subscriptions_page videos, number_of_videos_in_db = _get_videos(cursor, 60, (page - 1)60, tag) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lt/youtube-local/youtube/subscriptions.py", line 177, in _get_videos 'time_published': exact_timestamp(db_video[3]) if db_video[4] else posix_to_dumbed_down(db_video[3]), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lt/youtube-local/youtube/subscriptions.py", line 282, in posix_to_dumbed_down print(posix_time) OSError: [Errno 5] Input/output error

Thanks a bunch once again!!

user234683 commented 6 months ago

How are you running it? Can you run this in a terminal? It appears there's no stdout available for the print statement to output to.

Should not be getting this unless there's nowhere for the output to go: "OSError: [Errno 5] Input/output error"