Skip to content

Instantly share code, notes, and snippets.

@Shiroizu
Created October 19, 2022 06:39
Show Gist options
  • Save Shiroizu/f60639290790dbf0301bb34f01d71876 to your computer and use it in GitHub Desktop.
Save Shiroizu/f60639290790dbf0301bb34f01d71876 to your computer and use it in GitHub Desktop.
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