From 81d0d42598000cd721444612b5575af9489d8927 Mon Sep 17 00:00:00 2001 From: patrlim <81219610+patrlim@users.noreply.github.com> Date: Mon, 10 Jun 2024 21:48:19 +0200 Subject: [PATCH] RUN THIS TO GENERATE SONG LIST --- main.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..14d4024 --- /dev/null +++ b/main.py @@ -0,0 +1,16 @@ +import os + +json = open("songs.json", "w", encoding="utf-8") +json.write('{\n "songs":[\n') +i = 0 + +for file in os.listdir(): + i += 1 + if file[-4:] != ".ogg": + continue + json.write(" {\n" + ' "name":' + '"' + file.replace(".ogg","") + '",' + "\n") + json.write(' "url":' + '"' + 'https://github.com/patrlim/musicshite/raw/main/' + file.replace(" ","%20") + '"' + "\n }") + if i != len(os.listdir()): + json.write(",") + json.write("\n") +json.write(' ]\n}') \ No newline at end of file