Created
October 19, 2022 06:39
-
-
Save Shiroizu/f60639290790dbf0301bb34f01d71876 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import requests | |
userID = | |
login = { | |
"UserName": "", | |
"password": "" | |
} | |
songlist_file = "songs.txt" | |
date = str(datetime.datetime.now())[:10] # YYYY-MM-DD | |
songlist_title = "Song Notifications " + date | |
# --- # --- # --- # --- # | |
songlist = { | |
"songLinks": [], | |
"author": {"id": userID}, | |
"name": songlist_title | |
} | |
with open(songlist_file) as f: | |
songs = set(f.read().splitlines()) | |
order = 1 # For the songlist API | |
with requests.Session() as s: | |
p = s.post("https://vocadb.net/User/Login", data=login) | |
for song in songs: | |
songlist["songLinks"].append({"order": order, "song": {"id": int(song)}}) | |
order += 1 | |
r = s.post("https://vocadb.net/api/songLists", json=songlist) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment