Package: maloja-lib
MalojaSimple self-hosted music scrobble database to create personal listening statistics. No recommendations, no social network, no nonsense.You can checkmy own Maloja pageto see what it looks like (it's down fairly often because I use it as staging environment, that doesn't reflect the stability of the Maloja software!).IMPORTANT: With the update 2.7, the backend has been reworked to use a password. With a normal installation, you are asked to provide a password on setup. If you use docker or skip the setup for other reasons, you need to provide the environment variableMALOJA_FORCE_PASSWORDon first startup.IMPORTANT: With the update 2.9, the API endpoints have changed. All old endpoints should be redirected properly, but I recommend updating your clients to use the new ones.Table of ContentsFeaturesHow to installEnvironmentNew InstallationUpdateDockerHow to useBasic controlDataCustomizationHow to scrobbleNative supportNative APIStandard-compliant APIManualHow to extendFeaturesSelf-hosted: You will always be able to access your data in an easily-parseable format. Your library is not synced with any public or official music database, so you can follow your own tagging schema.Associated Artists: Compare different artist's popularity in your listening habits including subunits, collaboration projects or solo performances by their members. Change these associations at any time without losing any information.Multi-Artist Tracks: Some artists often collaborate with others or are listed under "featuring" in the track title. Instead of tracking each combination of artists, each individual artist competes in your charts.Custom Images: Don't rely on the community to select the best pictures for your favorite artists. Upload your own so that your start page looks like you want it to look.Proxy Scrobble: No need to fully commit or set up every client twice - you can configure your Maloja server to forward your scrobbles to other services.Standard-compliant API: Use existing, mature apps or extensions to scrobble to your Maloja server.Manual Scrobbling: Listening to vinyl or elevator background music? Simply submit a scrobble with the web interface.Keep it Simple: Unlike Last.fm and similar alternatives, Maloja doesn't have social networking, radios, recommendations or any other gimmicks. It's a tool to keep track of your listening habits over time.How to installEnvironmentI can support you with issues best if you useAlpine Linux. In my experience,2 GB RAMshould do nicely, but higher amounts allow more caching and reduce page load times for complicated statistics. My personal recommendation is using a dedicated LXC container (e.g. on Proxmox), but of course Maloja will also run on a VM, in Docker or on bare metal.New InstallationMake sure you have Python 3.5 or higher installed. You also need some basic packages that should be present on most systems, but I've provided simple shell scripts for Alpine and Ubuntu to get everything you need.If you'd like to display images, you will need API keys forLast.fmandSpotify. These are free of charge!Download Maloja with the commandpip install malojaserver. Make sure to use the correct python version (Usepip3if necessary).(Recommended) Put your server behind a reverse proxy for SSL encryption. Make sure that you're proxying to the IPv6 address unless you changed your settings to use IPv4. If you're running Maloja in a container, make sure to expose port 32400 (or whichever port you have chosen in your settings).(Optional) You can set up a cronjob to start your server on system boot, and potentially restart it on a regular basis:@reboot sleep 15 && maloja start
42 0 7 * * maloja restartUpdateIf you use a version before 2.0 (1.x), install the package as described above, then manually copy all your user data to your/etc/malojafolder.Otherwise, simply run the commandmaloja updateor usepips update mechanic.DockerThere is a Dockerfile in the repo that should work by itself. You can also use the unofficialDockerhub repositorykindly provided by joniator.You might want to set the environment variablesMALOJA_FORCE_PASSWORD,MALOJA_SKIP_SETUPandMALOJA_DATA_DIRECTORY.How to useBasic controlStart and stop the server withmaloja start
maloja stop
maloja restartIf something is not working, you can trymaloja debugto run the server in the foreground.DataIf you would like to import all your previous last.fm scrobbles, usebenfoxall's website(GitHub page). Use the commandmaloja import *filename*to import the downloaded file into Maloja.To backup your data, runmaloja backupor, to only backup essential data (no artwork etc),maloja backup -l minimal.To fix your database (e.g. after you've added new rules), usemaloja fix.CustomizationHave a look at theavailable settingsand specifiy your choices in/etc/maloja/settings/settings.ini. You can also set each of these settings as an environment variable with the prefixMALOJA_(e.g.MALOJA_SKIP_SETUP).If you have activated admin mode in your web interface, you can upload custom images for artists or tracks by simply dragging them onto the existing image on the artist or track page. You can also manage custom images directly in the file system - consultimages.infoin the/var/lib/maloja/imagesfolder.To specify custom rules, consult therules.infofile in/etc/maloja/rules. You can also apply some predefined rules on the/setuppage of your server.How to scrobbleYou can set up any amount of API keys in the fileauthenticated_machines.tsvin the/etc/maloja/clientsfolder. It is recommended to define a different API key for every scrobbler you use.Native supportThese solutions allow you to directly setup scrobbling to your Maloja server:TauonDesktop PlayerWeb ScrobblerBrowser ExtensionMulti ScrobblerDesktop ApplicationCmus-maloja-scrobblerScriptOngakuKirokuDesktop Application (Mac)AlbulaMusic ServerMaloja ScrobblerChromium Extension (also included in the repository) for Plex Web, Spotify, Bandcamp, Soundcloud or Youtube MusicNative APIIf you want to implement your own method of scrobbling, it's very simple: You only need one POST request to/apis/mlj_1/newscrobblewith the keysartist,titleandkey(and optionallyalbum,duration(in seconds) andtime(for cached scrobbles)) - either as form-data or json.If you're the maintainer of a music player or server and would like to implement native Maloja scrobbling, feel free to reach out - I'll try my best to help.Standard-compliant APIYou can use any third-party scrobbler that supports the audioscrobbler (GNUFM) or the ListenBrainz protocol. This is still very experimental, but give it a try with these settings:GNU FMGnukebox URLYour Maloja URL followed by/apis/audioscrobblerUsernameDoesn't matterPasswordAny of your API keysListenBrainzAPI URLYour Maloja URL followed by/apis/listenbrainzUsernameDoesn't matterAuth TokenAny of your API keysAudioscrobbler v1.2Server URLYour Maloja URL followed by/apis/audioscrobbler_legacyUsernameDoesn't matterPasswordAny of your API keysKnown working scrobblers:Pano Scrobblerfor AndroidSimple Scrobblerfor AndroidAirsonic Advanced(requires you to supply the full endpoint (yoururl.tld/apis/listenbrainz/1/submit-listens))Funkwhale(use the legacy APIyoururl.tld/apis/audioscrobbler_legacy)mpdscribble(use the legacy APIyoururl.tld/apis/audioscrobbler_legacy)I'm thankful for any feedback whether other scrobblers work!ManualIf you can't automatically scrobble your music, you can always do it manually on the/admin_manualpage of your Maloja server.How to extendIf you'd like to implement anything on top of Maloja, visit/api_explorer.