A simple script to return YandexMusic scrobbling
-
Obtain a YandexMusic token:
- Follow the link, log into your Yandex account and after refreshing the page, copy the access_token value from the address bar as soon as possible before you are transferred to the web player.
-
Clone the repository, install requirements and run the setup script
git clone https://github.com/just-mn/YandexMusicScrobbler.git && cd YandexMusicScrobbler && pip install -r requirements.txt && python setup.py
(or if you use Windows PowerShell)
git clone https://github.com/just-mn/YandexMusicScrobbler.git ; cd YandexMusicScrobbler ; pip install -r requirements.txt ; python setup.py
-
Start scrobbler:
python scrobbler.py
- Open the systemd service file with the following command:
sudo nano /etc/systemd/system/scrobbler.service
- Copy and paste the following configuration into the file:
Replace
[Unit] Description=Scrobbler Service After=network.target [Service] User=<your_username> WorkingDirectory=/home/<your_username>/YandexMusicScrobbler/ ExecStart=/usr/bin/python3 /home/<your_username>/YandexMusicScrobbler/scrobbler.py Restart=always [Install] WantedBy=multi-user.target
<your_username>
with your Linux username. - Save the file and reload the systemd daemon:
sudo systemctl daemon-reload
- Enable and start the scrobbler service:
sudo systemctl enable scrobbler.service sudo systemctl start scrobbler.service