From 44a6ddc5f1486eb6cb11b33f53d6692e6e3fe2dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tr=C3=A9meur?= Date: Sat, 31 Aug 2024 10:02:54 +0100 Subject: [PATCH] Attempt to add pleroma scrobble --- scrobble.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scrobble.py b/scrobble.py index 32db791..ba2ae6d 100644 --- a/scrobble.py +++ b/scrobble.py @@ -1,4 +1,4 @@ -import pylast,random,re,sys,time +import pylast,random,re,sys,time,requests 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/ @@ -32,6 +32,10 @@ def scrobble(thealbum): else: if tracklist[item] > 29: 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) else: print("Skipped " + thetrack)