2024-06-29 22:49:36 +01:00
|
|
|
import os
|
|
|
|
|
|
|
|
os.system('git pull')
|
2024-06-10 20:48:19 +01:00
|
|
|
|
2024-06-29 22:22:44 +01:00
|
|
|
filelist = os.listdir()
|
|
|
|
jsonfile = open("songs.json", "w", encoding="utf-8")
|
|
|
|
jsonfile.write('{\n "songs":[\n')
|
2024-06-10 20:48:19 +01:00
|
|
|
i = 0
|
|
|
|
|
2024-06-29 22:22:44 +01:00
|
|
|
for file in filelist:
|
2024-06-10 20:48:19 +01:00
|
|
|
i += 1
|
|
|
|
if file[-4:] != ".ogg":
|
|
|
|
continue
|
2024-06-29 22:22:44 +01:00
|
|
|
jsonfile.write(" {\n" + ' "name":' + '"' + file.replace(".ogg","") + '",' + "\n")
|
|
|
|
jsonfile.write(' "url":' + '"' + 'https://github.com/patrlim/musicshite/raw/main/' + file.replace(" ","%20") + '"' + "\n }")
|
2024-06-10 20:48:19 +01:00
|
|
|
if i != len(os.listdir()):
|
2024-06-29 22:22:44 +01:00
|
|
|
jsonfile.write(",")
|
|
|
|
jsonfile.write("\n")
|
2024-06-29 22:49:36 +01:00
|
|
|
jsonfile.write(' ]\n}')
|