GithubHelp home page GithubHelp logo

dbeley / mpdscrobble Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 1.0 91 KB

mpdscrobble: a simple Last.fm scrobbler for MPD. Also compatible with ListenBrainz and Maloja.

License: MIT License

Python 98.70% Nix 1.30%
lastfm scrobble scrobbler scrobbling last-fm lastfm-scrobbler mpd listenbrainz maloja

mpdscrobble's Introduction

mpdscrobble

A simple Last.fm scrobbler for MPD.

On top of Last.fm, mpdscrobble is also compatible with those services:

If you are searching for a mpd-compatible Last.fm scrobbler, check out first mpdscribble, as mpdscrobble has less features than mpdscribble:

  • no journal of failed scrobbles
  • it needs a pair of Last.fm API key/secret instead of just username/password

If you need to scrobble tracks from an existing mpdscribble journal file, you can use the mpdscribble_history.py script.

Requirements

  • httpx
  • mpd-python2
  • pylast

Installation

Classic installation :

pip install mpdscrobble
mpdscrobble -h

You will then need to create a config file (see the Configuration section).

If you want the systemd-service, you will have to install it manually (see the Scheduling section).

Run from source

First method

git clone https://github.com/dbeley/mpdscrobble
cd mpdscrobble
python setup.py install --user
mpdscrobble -h

Second method (with pipenv)

git clone https://github.com/dbeley/mpdscrobble
cd mpdscrobble
pipenv install '-e .'
pipenv run mpdscrobble -h

On Archlinux

If you are an Archlinux user, you can install the AUR package mpdscrobble-git.

yay -S mpdscrobble-git

The systemd service file will be automatically installed.

Configuration

See mpdscrobble.example.conf for an example.

By default, mpdscrobble search a config file at ~/.config/mpdscrobble/mpdscrobble.conf, but you can override the default location with the -c/--config flag (see the Usage section).

Scheduling

If you installed the AUR package on Archlinux, the systemd service is automatically installed.

systemctl --user enable --now mpdscrobble
systemctl --user status mpdscrobble

Otherwise you will need to manually install the systemd service.

curl https://raw.githubusercontent.com/dbeley/mpdscrobble/main/systemd-service/mpdscrobble.service > ~/.config/systemd/user/mpdscrobble.service
systemctl --user daemon-reload
systemctl --user enable --now mpdscrobble
systemctl --user status mpdscrobble

Usage

usage: mpdscrobble [-h] [--debug] [-c CONFIG_FILE] [--dry-run]

A simple Last.fm scrobbler for MPD.

optional arguments:
  -h, --help            Show this help message and exit.
  --debug               Display debugging information.
  -c CONFIG_FILE, --config_file CONFIG_FILE
                        Config file (default: ~/.config/mpdscrobble/mpdscrobble.conf).
  --dry-run             Disable scrobbling.

mpdscrobble's People

Contributors

dbeley avatar jbmfg avatar nikohonu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jbmfg

mpdscrobble's Issues

Config error on Termux when specifying a port

Hello,

Thanks for this much simpler utility. It has been working well on my computers so I decided to bring to the phone as well using Termux.
On launch I get the following:

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/data/data/com.termux/files/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/data/data/com.termux/files/home/.local/lib/python3.9/site-packages/mpdscrobble-0.2.6-py3.9.egg/mpdscrobble/__main__.py", line 112, in <module>
  File "/data/data/com.termux/files/home/.local/lib/python3.9/site-packages/mpdscrobble-0.2.6-py3.9.egg/mpdscrobble/__main__.py", line 53, in main
  File "/data/data/com.termux/files/home/.local/lib/python3.9/site-packages/mpdscrobble-0.2.6-py3.9.egg/mpdscrobble/utils.py", line 21, in create_network
  File "/data/data/com.termux/files/usr/lib/python3.9/configparser.py", line 1257, in __getitem__
    raise KeyError(key)
KeyError: 'username'

I am using the same config file as my desktop except that I have to add a [mpdscrobble] section to be able to specify a port.
Specifying a port/host on my desktop returns the same error as well so it doesn't seem to be Termux specific.

Unreliable scobbling

Sometimes it scrobbles, sometimes it doesnt. Seems like its pretty reliable for the first song played but then after that it just seems to not submit them:
debug.txt

You can see in the log that the first song, "Happier When You're Gone" gets scrobbled. The next song is seen but a now playing is not sent nor is an actual completed scobble

Edit: Installed with pip in case that is important

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.