GuardKenzie / miniplayer

A curses based mpd client with basic functionality and album art.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'utf-8' codec can't decode byte 0xdd in position 55: invalid continuation byte

ahloiscreamo opened this issue · comments

commented

Hello,

i try to run but come across error
output

❯ miniplayer
Traceback (most recent call last):
  File "/home/ahloi/.local/bin/miniplayer", line 455, in loop
    self.handleKeypress()
  File "/home/ahloi/.local/bin/miniplayer", line 263, in handleKeypress
    if self.checkSongUpdate() == 1:
  File "/home/ahloi/.local/bin/miniplayer", line 220, in checkSongUpdate
    song = self.client.currentsong()
  File "/usr/lib/python3.9/site-packages/mpd/base.py", line 435, in mpd_command
    return wrapper(self, name, args, callback)
  File "/usr/lib/python3.9/site-packages/mpd/base.py", line 498, in _execute
    return retval()
  File "/usr/lib/python3.9/site-packages/mpd/base.py", line 420, in command_callback
    res = function(self, self._read_lines())
  File "/usr/lib/python3.9/site-packages/mpd/base.py", line 360, in _parse_object
    objs = list(self._parse_objects(lines))
  File "/usr/lib/python3.9/site-packages/mpd/base.py", line 206, in _parse_objects
    for key, value in self._parse_pairs(lines)
:
  File "/usr/lib/python3.9/site-packages/mpd/base.py", line 201, in _parse_pairs
    for line in lines:
  File "/usr/lib/python3.9/site-packages/mpd/base.py", line 552, in _read_lines
    line = self._read_line()
  File "/usr/lib/python3.9/site-packages/mpd/base.py", line 534, in _read_line
    line = self._rbfile.readline().decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdd in position 55: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ahloi/.local/bin/miniplayer", line 487, in <module>
    player.loop()
  File "/home/ahloi/.local/bin/miniplayer", line 482, in loop
    if error:
UnboundLocalError: local variable 'error' referenced before assignment
~
❯ 

this happened both build install (miniplayer-git on arch repo and PyPi)
any help is appreciated, thanks

commented

#UPDATE

i replace line 534 "utf-8" with "ISO-8859-1" and it runs,
but now it did not rendered properly, any idea?

no idea

commented

Does this happen no matter which song you are playing (from different artists and albums)?

I suspect this has something to do with some song's metadata being weird.

commented

Yes confirmed, i play with different albums,
there are another person on reddit having the same problem.
I will come for update, still need a time to figure out what is causing this.

commented

Which version of python-mpd2 and mpd are you using?

Can you please post your config file as well if you have made one?

commented

mpd

❯ mpd --version 
Music Player Daemon 0.22.4 (0.22.4)

python-mpd2

❯ pacman -Ss python-mpd2
community/python-mpd2 3.0.3-1 [installed]
    Python library which provides a client interface for the Music Player Daemon

This is my config

[player]
music_directory = "/gallery/Music/"
font_width = 11
font_height = 24

[mpd]
host = localhost
port = 6600
commented

Can you run this python code while playing a song that has issues with the player and see if you get the same error:

from mpd import MPDClient
c = MPDClient()
c.connect("localhost", 6600)
c.currentsong()

If you do, could you post the full path of the song file. I suspect this might be an issue with the python-mpd2 module.

Also, your music_directory option should not have quotes.

commented

Sorry for the late reply.

How do i run the code?
i try to run the code but getting error

❯ ./config
Failed to execute process './config'. Reason:
exec: Exec format error
The file './config' is marked as an executable but could not be run by the operating system.

but you were right after deleting the quotes on the music directory, it run and show the cover!
now, it glitches, it just show the cover without the progress bar/info ..

glitch

this is the large pic, the progress bar is there it's just stay behind the cover
large

commented

This looks like an issue with your font_width and font_height config options. You need to measure the height and width of a character in your terminal (the cursor is a great candidate) and put those pixel values in the config.

commented

i see, ok i'll be back in a second

commented

Hey it finally works!

finally

Thanks for taking your time and helping out, i appreciate it! THANK YOU !!!
i hope the projects reach to many people, i don't know why mod remove it on reddit.

I will close the issue.