JVT038 / MetaTube

Python web ui to download videos from YouTube and add metadata on top of it
GNU General Public License v3.0
317 stars 20 forks source link

Errors on Download #144

Open lasersPew opened 5 months ago

lasersPew commented 5 months ago

Describe the bug When I download something, the download goes through but when I try to download it, I got various errors

To Reproduce Steps to reproduce the behavior:

  1. Run MetaTube
  2. Download Music
  3. Proceed with the download
  4. Click download item

Expected behavior Should download as normal

Screenshots If applicable, add screenshots to help explain your problem.

Server information

Additional context

Traceback (most recent call last):
  File "src\\gevent\\greenlet.py", line 908, in gevent._gevent_cgreenlet.Greenlet.run
  File "A:\metatube1\.venv\Lib\site-packages\socketio\server.py", line 586, in _handle_event_internal
    r = server._trigger_event(data[0], namespace, sid, *data[1:])
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "A:\metatube1\.venv\Lib\site-packages\socketio\server.py", line 611, in _trigger_event
    return handler(*args)
           ^^^^^^^^^^^^^^
  File "A:\metatube1\.venv\Lib\site-packages\flask_socketio\__init__.py", line 282, in _handler
    return self._handle_event(handler, message, namespace, sid,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "A:\metatube1\.venv\Lib\site-packages\flask_socketio\__init__.py", line 827, in _handle_event
    ret = handler(*args)
          ^^^^^^^^^^^^^^
  File "A:\metatube1\metatube\overview\routes.py", line 325, in downloaditem
    mimetype = magic.from_file(path)
               ^^^^^^^^^^^^^^^^^^^^^
  File "A:\metatube1\.venv\Lib\site-packages\magic\magic.py", line 89, in from_file
    return maybe_decode(magic_file(self.cookie, filename))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "A:\metatube1\.venv\Lib\site-packages\magic\magic.py", line 214, in maybe_decode
    return s.decode('utf-8')
           ^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe3 in position 44: invalid continuation byte
2024-04-15T14:49:01Z <Thread at 0x179a124b920: <bound method Server._handle_event_internal of <socketio.server.Server object at 0x000001799EDFE310>>(<socketio.server.Server object at 0x000001799EDFE3, '6XkNKTSvTGRHPSsvAAAL', 'WCPARVZdyxMXkqOpAAAK', ['downloaditem', 'A:\\Projects\\MetaTube\\download, '/', None)> failed with UnicodeDecodeError

pip freeze

alembic==1.13.1
anyio==4.3.0
beautifulsoup4==4.12.3
bidict==0.23.1
blinker==1.7.0
Brotli==1.1.0
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
deezer-python==6.1.1
ffmpeg-python==0.2.0
Flask==3.0.1
Flask-Migrate==4.0.5
Flask-SocketIO==5.3.6
Flask-SQLAlchemy==3.1.1
flask-vite==0.3.8
future==1.0.0
gevent==23.9.1
gevent-websocket==0.10.1
greenlet==3.0.3
h11==0.14.0
httpcore==1.0.5
httpx==0.27.0
idna==3.7
iniconfig==2.0.0
itsdangerous==2.1.2
Jinja2==3.1.3
lyricsgenius==3.0.1
Mako==1.3.3
MarkupSafe==2.1.5
musicbrainzngs==0.7.1
mutagen==1.47.0
packaging==24.0
pluggy==1.4.0
pycparser==2.22
pycryptodomex==3.20.0
pytest==8.0.0
python-dateutil==2.8.2
python-dotenv==1.0.1
python-engineio==4.9.0
python-magic==0.4.27
python-magic-bin==0.4.14
python-socketio==5.11.2
redis==5.0.3
requests==2.31.0
simple-websocket==1.0.0
six==1.16.0
sniffio==1.3.1
soupsieve==2.5
sponsorblock.py==0.2.2
spotipy==2.23.0
SQLAlchemy==2.0.29
typing_extensions==4.11.0
urllib3==2.1.0
websockets==12.0
Werkzeug==3.0.2
wsproto==1.2.0
youtube-search-python==1.6.6
yt-dlp==2024.4.9
zope.event==5.0
zope.interface==6.2
lasersPew commented 5 months ago

Note: This also happens when I try to play stuff