Package: gather-scrobble
Inspired bygathertown/mod-spotify-as-status.Scrobble yourlast.fmorSpotifyactivity to theGatherstatus.gather-scrobblegather-statusInstallationpipinstallgather-scrobbleAs this library has a CLI, you may have permissions issues when
installing, so try it with the--userflag:pipinstallgather-scrobble--userDocumentationConfigurationIt’s necessary to configure the following credentials:Gather CredentialsAccessGather API keisto get yourAPI_KEY.last.fm CredentialsIf you will scrobble from last.fm.Create alast.fm API
accountto get yourAPI_KEYandAPI_SECRET.Spotify CredentialsIf you will scrobble from Spotify.Access yourSpotify account
dashboardand
create a new app (in case you don’t have one or do not want to use an
existing one). And get yourCLIENT_IDandCLIENT_SECRET.Also add a redirect URI in theEdit Settings. Suggested value:http://127.0.0.1:9090.The spotispy will instantiate a server to receive the access token. More
infohere.You can configure your credentials in 4 ways and with respective
priorities:keyring (recommended)keyringsetgather-scrobbleGATHER_API_KEYkeyringsetgather-scrobbleLASTFM_API_KEYkeyringsetgather-scrobbleLASTFM_API_SECRETkeyringsetgather-scrobbleLASTFM_USERNAMEkeyringsetgather-scrobbleSPOTIFY_CLIENT_IDkeyringsetgather-scrobbleSPOTIFY_CLIENT_SECRETkeyringsetgather-scrobbleSPOTIFY_CLIENT_REDIRECT_URIenvironment variablesexportGATHER_API_KEY=<GATHER_API_KEY>exportLASTFM_API_KEY=<LASTFM_API_KEY>exportLASTFM_API_SECRET=<LASTFM_API_SECRET>exportLASTFM_USERNAME=<LASTFM_USERNAME>exportSPOTIFY_CLIENT_ID=<SPOTIFY_CLIENT_ID>exportSPOTIFY_CLIENT_SECRET=<SPOTIFY_CLIENT_SECRET>exportSPOTIFY_CLIENT_REDIRECT_URI=<SPOTIFY_CLIENT_REDIRECT_URI>.ini file[settings]GATHER_API_KEY=<GATHER_API_KEY>LASTFM_API_KEY=<LASTFM_API_KEY>LASTFM_API_SECRET=<LASTFM_API_SECRET>LASTFM_USERNAME=<LASTFM_USERNAME>SPOTIFY_CLIENT_ID=<SPOTIFY_CLIENT_ID>SPOTIFY_CLIENT_SECRET=<SPOTIFY_CLIENT_SECRET>SPOTIFY_CLIENT_REDIRECT_URI=<SPOTIFY_CLIENT_REDIRECT_URI>.env fileGATHER_API_KEY=<GATHER_API_KEY>
LASTFM_API_KEY=<LASTFM_API_KEY>
LASTFM_API_SECRET=<LASTFM_API_SECRET>
LASTFM_USERNAME=<LASTFM_USERNAME>
SPOTIFY_CLIENT_ID=<SPOTIFY_CLIENT_ID>
SPOTIFY_CLIENT_SECRET=<SPOTIFY_CLIENT_SECRET>
SPOTIFY_CLIENT_REDIRECT_URI=<SPOTIFY_CLIENT_REDIRECT_URI>UsageHelp$gather-scrobble--helpGatherScrobblev0.0.1Usage:gather-scrobblestart<space_id>[--sourceSOURCE][--emojisEMOJIS]gather-scrobbleinfogather-scrobbletest<space_id>Arguments:<space_id>Gatherspaceid.Options:-h--helpShowthisscreen.-s--sourceSOURCEScrobblesource,ifnotdefinedthetoolwilltryallavailablesourcesconfigured.Canbe:lastfm,spotify,orany.If'any'itwillusethefirstsourceconfiguredinthepriority:lastfm->spotify[default:any]-e--emojisEMOJISItispossibletocustomizetheemojis,bysettingthelistofemojisthatwillbechosenrandomly,andalsoyoudon'tlikeemojis,youcansetanemptystringhere.[default:🎼🎵🎶🎧📻🎷🎸🎹]InfoBefore starting, check if you have configured the services:$gather-scrobbleinfoGatherScrobble┏━━━━━━━━━━━┳━━━━━━━━━━━━━━┓┃Service┃Configured┃┣━━━━━━━━━━━╋━━━━━━━━━━━━━━┫┃Gather┃True┃┣━━━━━━━━━━━╋━━━━━━━━━━━━━━┫┃last.fm┃True┃┣━━━━━━━━━━━╋━━━━━━━━━━━━━━┫┃Spotify┃False┃┗━━━━━━━━━━━┻━━━━━━━━━━━━━━┛TestAnd test your configuration:$gather-scrobbletest"aAa0aAaAaaA0Aaaa/Name"TestingconnectionwithGather...SuccessTestingconnectionwithlast.fm...SuccessTestingconnectionwithSpotify...Success┏━━━━━━━━━━━┳━━━━━━━━━━━━┓┃Service┃Working?┃┣━━━━━━━━━━━╋━━━━━━━━━━━━┫┃Gather┃True┃┣━━━━━━━━━━━╋━━━━━━━━━━━━┫┃last.fm┃True┃┣━━━━━━━━━━━╋━━━━━━━━━━━━┫┃Spotify┃True┃┗━━━━━━━━━━━┻━━━━━━━━━━━━┛StartThe first time you scrobble for any of the sources, the user will be
asked to authorize your application to access data from the respective
scrobble sources.$gather-scrobblestart"aAa0aAaAaaA0Aaaa/Name"🎸-EvilPapagali-Massacration𝄛𝄙𝄘𝄛𝄙DockerPull$dockerpullpyanderson/gather-scrobble:0.0.7Docker ConfigurationKeyringThe most common way to manage credentials in docker containers is
through environment variables, but in this case, you can still usekeyring, through the third-partykeyrings.cryptfile,
you will need to create a file with your credentials, mount a volume
with the file in the path/root/.local/share/python_keyring/cryptfile_pass.cfgand set theKEYRING_CRYPTFILE_PASSWORDenvironment variable with the password
that you used to create the file:$dockerrun-v$(echo$HOME)/.local/share/python_keyring/cryptfile_pass.csg:/root/.local/share/python_keyring/cryptfile_pass.cfg-eKEYRING_CRYPTFILE_PASSWORD=secret_password...Env FileAdd your credentials to a .env file and use it with the –env-file
option:$dockerrun--env-file/path/to/myfile.env...CacheTo avoid being asked to authorize the last.fm/Spotify application in
every usage, you should mount a volume to save the gather-scrobble cache
folder:$dockerrun-v/path/to/save/cache:/root/.config...Docker UsageThe docker container works as an executable, so you can use the same CLI
command interface, for example, to test your configuration you can do
this:$dockerrun--env-file/path/to/myfile.env-v/path/to/save/cache:/root/.config-itpyanderson/gather-scrobble:0.0.7test"aAa0aAaAaaA0Aaaa/Name"TestingconnectionwithGather...SuccessTestingconnectionwithlast.fm...SuccessTestingconnectionwithSpotify...Success┏━━━━━━━━━━━┳━━━━━━━━━━━━┓┃Service┃Working?┃┣━━━━━━━━━━━╋━━━━━━━━━━━━┫┃Gather┃True┃┣━━━━━━━━━━━╋━━━━━━━━━━━━┫┃last.fm┃True┃┣━━━━━━━━━━━╋━━━━━━━━━━━━┫┃Spotify┃True┃┗━━━━━━━━━━━┻━━━━━━━━━━━━┛ExamplesValidate your credentials:$dockerrun-it--rm--namegather-scrobble--env-file/path/to/myfile.env-v/path/to/save/cache:/root/.configpyanderson/gather-scrobble:0.0.7test"aAa0aAaAaaA0Aaaa/Name"TestingconnectionwithGather...SuccessTestingconnectionwithlast.fm...Pleaseauthorizethisscripttoaccessyouraccount:https://www.last.fm/api/auth/?api_key=<api_key>SuccessTestingconnectionwithSpotify...GotothefollowingURL:https://accounts.spotify.com/authorize?client_id=<client_id>&response_type=code&redirect_uri=http%3A%2F%2F127.0.0.1%3A9090&scope=user-read-currently-playing+user-read-playback-stateEntertheURLyouwereredirectedto:http://127.0.0.1:9090/?code=<code>Success┏━━━━━━━━━━━┳━━━━━━━━━━━━┓┃Service┃Working?┃┣━━━━━━━━━━━╋━━━━━━━━━━━━┫┃Gather┃True┃┣━━━━━━━━━━━╋━━━━━━━━━━━━┫┃last.fm┃True┃┣━━━━━━━━━━━╋━━━━━━━━━━━━┫┃Spotify┃True┃┗━━━━━━━━━━━┻━━━━━━━━━━━━┛Run gather-scrobble in background:$dockerrun-d--restart=always--namegather-scrobble--env-file/path/to/myfile.env-v/path/to/save/cache:/root/.configpyanderson/gather-scrobble:0.0.7start"aAa0aAaAaaA0Aaaa/Name"cbe4b6c916d8e7977788462a447b8a6c9e526f46f5c9b85d7be5f843e7fd80dcCheck the logs:$dockerlogs-fgather-scrobble[2023-04-2915:39:30,637][DEBUG]loadingcredentials[2023-04-2915:39:31,427][DEBUG]startingapplication[2023-04-2915:39:32,925][DEBUG]applicationstarted[2023-04-2915:40:05,650][DEBUG]🎼-Madhouse-AnthraxStop:$dockerrm-rgather-scrobblegather-scrobbleFAQHow to get thespace_idvalue? First enter in the space you want
to scrobble, thespace_idwill be in the URL after the/app/.
E.g., in the URL “https://app.gather.town/app/aAa0aAaAaaA0Aaaa/Name”
thespace_idisaAa0aAaAaaA0Aaaa/Name.