From 1fa59e4c57ff29a0493dcdadcc3b33241731e7d4 Mon Sep 17 00:00:00 2001 From: Ceres Date: Sun, 11 Jan 2026 23:33:55 +0000 Subject: [PATCH] first commit --- Scrobbles/Tape/13 Commandments | 13 +++++ Scrobbles/Tape/Low Energy Sad | 12 ++++ Scrobbles/Tape/Mara | 19 +++++++ Scrobbles/Tape/Sleep Token Download 2025 | 15 +++++ scrobble | 70 ++++++++++++++++++++++++ 5 files changed, 129 insertions(+) create mode 100644 Scrobbles/Tape/13 Commandments create mode 100644 Scrobbles/Tape/Low Energy Sad create mode 100644 Scrobbles/Tape/Mara create mode 100644 Scrobbles/Tape/Sleep Token Download 2025 create mode 100755 scrobble diff --git a/Scrobbles/Tape/13 Commandments b/Scrobbles/Tape/13 Commandments new file mode 100644 index 0000000..eb1bf3a --- /dev/null +++ b/Scrobbles/Tape/13 Commandments @@ -0,0 +1,13 @@ +A,Square Hammer,Ghost,Popestar +A,Year Zero,Ghost,Infestissumam +A,Mary on a Cross,Ghost,Seven Inches of Satanic Panic +A,Call Me Little Sunshine,Ghost,Impera +A,Darkness at the Heart of My Love,Ghost,Impera +A,Dance Macabre,Ghost,Prequelle +A,Rats,Ghost,Prequelle +A,Spillways,Ghost,Impera +A,Cirice,Ghost,Meliora +A,If You Have Ghosts,Ghost,If You Have Ghost +B,He Is,Ghost,Meliora +B,Zenith,Ghost,Meliora +B,Phantom of the Opera,Ghost,Phantomime diff --git a/Scrobbles/Tape/Low Energy Sad b/Scrobbles/Tape/Low Energy Sad new file mode 100644 index 0000000..e77e420 --- /dev/null +++ b/Scrobbles/Tape/Low Energy Sad @@ -0,0 +1,12 @@ +A,"GRIS, Pt. 1",Berlinist,Gris (Original Game Soundtrack) +A,end of a life,Mori Calliope,end of a life +A,Rayleigh Scattering,acloudyskye,Blood Rushing Like Current Through a Powerline +A,"Endless Ocre (You look lonely, I can fix that)",Aloboi,"Endless Ocre (You look lonely, I can fix that)" +A,Glimpse of Us,Joji,SMITHEREENS +A,Instrument of Surrender,Sea Power, Disco Elysium +A,Mandus,Jessica Curry,Amnesia: A Machine for Pigs +A,Neon Gravestones,twenty one pilots,Trench +A,Blood Sport (from the room below),Sleep Token,Sundowning +A,The Smallest Church in Saint-Saƫns,Sea Power,Disco Elysium +A,As the World Caves In,Matt Maltese,As the World Caves In +A,"GRIS, Pt. 2",Berlinist,Gris (Original Game Soundtrack) diff --git a/Scrobbles/Tape/Mara b/Scrobbles/Tape/Mara new file mode 100644 index 0000000..b6eaeb7 --- /dev/null +++ b/Scrobbles/Tape/Mara @@ -0,0 +1,19 @@ +A,Space Oddity,David Bowie,David Bowie +A,Dream On,Depeche Mode,Exciter +A,Masochist II,Die Form,Histories +A,Gallowdance,Lebanon Hanover,Tomb for Two +A,Lucretia My Reflection,The Sisters of Mercy,Floodland +A,The Great Commandment,Camouflage,Voices & Images +A,"Another Brick in the Wall, Part 2",Pink Floyd,The Wall +A,Little Dark Age,MGMT,Little Dark Age +A,Gaia,KingGizzard & the Lizard Wizard,Omnium Gatherum +B,THE DEATH OF PEACE OF MIND,Bad Omens,THE DEATH OF PEACE OF MIND +B,Satanic Suicide Sex Cult,Lesbian Bed Death,Midnight Lust +B,I-E-A-I-A-I-O,System of a Down,Steal This Album! +B,Sugar,Sleep Token,Sundowning +B,Emergence,Sleep Token,Even in Arcadia +B,John the Revelator,Depech Mode,Playing the Angel +B,My Girlfriend's Girlfriend,Type O Negative,October Rust +B,Spellbound,Siouxsie and the Banshees,Juju +B,A Kind of Magic,Queen,"Greatest Hits I, II & III" +B,Pain,Boy Harsher,Lesser Man diff --git a/Scrobbles/Tape/Sleep Token Download 2025 b/Scrobbles/Tape/Sleep Token Download 2025 new file mode 100644 index 0000000..d760338 --- /dev/null +++ b/Scrobbles/Tape/Sleep Token Download 2025 @@ -0,0 +1,15 @@ +A,Look to Windward,Sleep Token,Even in Arcadia +A,The Offering,Sleep Token,Sundowning +A,Vore,Sleep Token,Take Me Back to Eden +A,Emergence,Sleep Token,Even in Arcadia +A,Alkaline,Sleep Token,This Place Will Become Your Tomb +A,Hypnosis,Sleep Token,This Place Will Become Your Tomb +A,Rain,Sleep Token,Take Me Back to Eden +A,Caramel,Sleep Token,Even in Arcadia +B,The Summoning,Sleep Token,Take Me Back to Eden +B,Granite,Sleep Token,Take Me Back to Eden +B,The Love You Want,Sleep Token,This Place Will Become Your Tomb +B,Higher,Sleep Token,Sundowning +B,Damocles,Sleep Token,Even in Arcadia +B,Thread the Needle,Sleep Token,One +B,Take Me Back to Eden,Sleep Token,Take Me Back to Eden diff --git a/scrobble b/scrobble new file mode 100755 index 0000000..3832c55 --- /dev/null +++ b/scrobble @@ -0,0 +1,70 @@ +#!/usr/bin/python + +from time import time +import requests +import argparse +import csv +import os.path + +parser = argparse.ArgumentParser( + prog='Scrobbler', + description='Scrobbles Tapes and Vinyl to a Listenbrainz API') + +parser.add_argument('list') +requiredNamed = parser.add_argument_group('Required Arguments') +requiredNamed.add_argument('-t', '--type', help='Whether the list is from a tape or vinyl', required=True) +parser.add_argument('-s', '--side', help='Specify a side', nargs='+') +args = parser.parse_args() + +# Set DEBUG to True to test local dev server. +# API keys for local dev server and the real server are different. +DEBUG = True +ROOT = 'https://scrobbles.ceressees.dev/apis/listenbrainz' +ROOT_FOLDER = '/home/ceres/Scrobbles' +PATH = f'{ROOT_FOLDER}/{args.type.title()}/{args.list}' +SONGS = [] +song_num = 0 +if not os.path.isfile(PATH): + raise Exception("Please specify a valid list") + +with open(PATH) as list_file: + list_data = csv.reader(list_file, delimiter=',') + for row in list_data: + if args.side == None or row[0] in args.side: + SONGS.append([row[1], row[2], row[3]]) + +def submit_listen(listen_type, payload, token): + response = requests.post( + url="{0}/1/submit-listens".format(ROOT), + json={ + "listen_type": listen_type, + "payload": payload, + }, + headers={ + "Authorization": "Token {0}".format(token) + } + ) + + response.raise_for_status() + + return response.json() + + +if __name__ == "__main__": + for song in SONGS: + PAYLOAD = [ + { + "listened_at": int(time()), + "track_metadata": { + "artist_name": f"{song[1]}", + "track_name": f"{song[0]}", + "release_name": f"{song[2]}" + } + } + ] + + token = 'QAE42y-vs3pwpJex1tPRCIulCdbnSHpL4tIuYZrB2bevBHze' + json_response = submit_listen(listen_type='single', payload=PAYLOAD, token=token) + + print("Response was: {0}".format(json_response)) + print(f'Scrobbled {song[0]}')