Pirate player for pirate audio

hi i’m new and a total noob, but i have a question about the pirate audio

i’ve tried to install pirateplayer for the pirate audio but when i try to start “pirateplayer” i’ve get this error

Traceback (most recent call last):
File “/home/pi/.local/bin/pirateplayer”, line 10, in
File “/home/pi/.local/lib/python3.7/site-packages/pirateplayer/main.py”, line 20, in main
pins = confparse.get_pins()
File “/home/pi/.local/lib/python3.7/site-packages/pirateplayer/utils/confparse.py”, line 24, in get_pins
return list(_CONF[‘BUTTON’].getint(btn) for btn in _CONF[‘BUTTON’])
File “/usr/lib/python3.7/configparser.py”, line 958, in getitem
raise KeyError(key)
KeyError: ‘BUTTON’

i dunno what i’m doing wrong, like i said i’m a totally noob, maybe someone can help me
i wanted to create a mp3 player that i can use offline not with mopidy which i’ve allready tried

best regards Ghurkki

Haven’t used it, but looking at the source code it is trying to read the config file.
In /home/pi/.config/pirateplayer there should be a file called conf.ini that contains

root = ~/Music

a = 5
b = 6
x = 16
y = 20

If that file does not exist (it should have been created by the installer) you need to create it.
Don’t know if that helps.

If you have a look at the buttons.py example y is gpio 24, not 20. I think there may have been a hardware change at some point? In any case you may want to see what pin yours uses and make sure your config file matches.

thanks for all reply i managed to use the pirateplayer now, but now i try to make an autostart for this application and i fail again i dunno how to do it

What type of file are you trying to autostart? I use crontab to start my python files on boot up.

Check to see if there is a file /home/pi/.config/systemd/user/pirateplayer.service
(this should have been created if you ran the install.sh script).
If not, create the file (and directories if needed) and put the following in it

Description=PiratePlayer Service



Then if you run the command
systemctl --user enable pirateplayer.service

it should then start when the pi is started.

Note: I don’t use pirateplayer myself, just just based on looking at the code in github

well crap i’m really a noob, but i can’t access /home/pi/.config/systemd/user/pirateplayer.service there isn’t a folder systemd (only those lxpanel pirateplayer user-dirs.dirs user-dirs.locale venv )

ok, to make the directory, use
mkdir -p /home/pi/.config/systemd/user/

Then create the file.

(mkdir is the command to create a directory, the -p option tells it to create all the directories in the path, so it creates any of the missing directories for you)

by the way, because .config starts with a dot, it is a hidden file, ls will not show it, ls -a will

it doesn’t seems that installed it right, there is no pirateplayer in usr/bin/

Hi @Ghurkki – did you manage to get it sorted in the end?

I too am a n00b and struggling to get PiratePlayer installed… Any help appreciated.

Hi, i sadly didn’t had enough time to find a working solution maybe u will have more time this spring to try it again

After a lot of effort and basically through trial and error, I managed to get the base install working. The steps I took are here in case you or anyone else finds them useful. Thanks to @alphanumeric and @terminalpi for their suggestions which were key to getting it working.

I plan to try an autostart too. Any pointers appreciated.

Thanks for the link, i got to the point where I could start the program via terminal, but didn’t manage to make it Autostart will try maybe in two weeks or so