Attempt to add pleroma scrobble

master
trémeur 3 months ago
parent e6043132f8
commit 44a6ddc5f1

@ -1,4 +1,4 @@
import pylast,random,re,sys,time import pylast,random,re,sys,time,requests
import albums import albums
network = pylast.LastFMNetwork(api_key=albums.apikey, api_secret=albums.apisecret, username="litrovers", password_hash=pylast.md5(albums.pw)) # https://input.sh/scrobbling-live-sets-into-last-fm-using-python/ network = pylast.LastFMNetwork(api_key=albums.apikey, api_secret=albums.apisecret, username="litrovers", password_hash=pylast.md5(albums.pw)) # https://input.sh/scrobbling-live-sets-into-last-fm-using-python/
@ -32,6 +32,10 @@ def scrobble(thealbum):
else: else:
if tracklist[item] > 29: if tracklist[item] > 29:
last_api_call = network.scrobble(theartist,thetrack,int(time.time())) last_api_call = network.scrobble(theartist,thetrack,int(time.time()))
try:
requests.post("https://ple.praze.net/api/v1/pleroma/scrobble",data = {"artist":theartist,"length":int(time.time()),"title":thetrack},auth = ("tre",albums.plepass))
except:
pass
print("Scrobbled " + thetrack) print("Scrobbled " + thetrack)
else: else:
print("Skipped " + thetrack) print("Skipped " + thetrack)

Loading…
Cancel
Save