diff options
Diffstat (limited to 'bandcamp.py')
-rwxr-xr-x | bandcamp.py | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/bandcamp.py b/bandcamp.py index 29f2b2b..2d76b22 100755 --- a/bandcamp.py +++ b/bandcamp.py @@ -56,9 +56,6 @@ class Bandcamp: irc_string = "[\x0304BandCamp\x03] \x0307ERROR:\x0308 got no data from server! \x0315(check your URL for typos!)\x03" ansi_string = "[\x1b[31mBandCamp\x1b[0m] \x1b[33;2mERROR:\x1b[33;1m got no data from server! \x1b[37;2m(check your URL for typos!)\x1b[0m" data = json.loads(Bandcamp.ldjson) - # print(data) - # for i in data: - # print(i) try: type = data["@type"] except KeyError: @@ -68,11 +65,6 @@ class Bandcamp: name = data["name"] date = data["datePublished"] artists = data["byArtist"]["name"] - # artists=artists.removeprefix(f'Listen to {name} on Spotify').removeprefix('.').strip().removeprefix('· ') - # if artists.startswith("Song · "): artists=artists.removeprefix("Song · ") - # elif artists.startswith("Album · "): - # artists=artists.removeprefix("Album · ")[::-1].split(" · ",1)[1][::-1] #removes the "10 songs" part from album - # artists=artists.removesuffix(f" · {date[:4]}") #remove the year too irc_string = f"[\x0303BandCamp\x03] \x02{name}\x02 by \x1d{artists}\x1d published on {date}" ansi_string = f"[\x1b[32mBandCamp\x1b[0m] \x1b[1m{name}\x1b[0m by \x1b[03m{artists}\x1b[0m published on {date}" # print(("Song: " if type=="MusicRecording" else "Album: " if type=="MusicAlbum" else f"Unknown type ({type}): ")+'"'+name+'"'+" by "+'"'+artists+'"'+" released on "+date) @@ -83,5 +75,5 @@ class Bandcamp: if __name__ == "__main__": import sys - #Bandcamp.bandcamp(Bandcamp, sys.argv[1]) + # Bandcamp.bandcamp(Bandcamp, sys.argv[1]) Bandcamp().bandcamp(sys.argv[1]) |