import os
import random
import requests
def randomize(listurl):
# Please don't refresh too fast and kill my website and git server...
musiclist = requests.get(listurl).text.split("\n")
musiclist = [music for music in musiclist if music != ""]
html = "\n\n
\n\n\n\n\n"
html += "\n"
html += "Halhadus' Music List\n"
html += "\n"
html += "\n"
html += "\n"
html += "\n"
html += "\n"
html += "\n"
random.shuffle(musiclist)
html += "
\n"""
musiccount = 0
for music in musiclist:
musiccount += 1
music = music.strip().split(" --- ")
if music[2] == "YTM":
html += f"{musiccount}.{music[0]} \n"
elif music[2] == "YT":
html += f"{musiccount}.{music[0]} \n"
else:
print("Invalid provider")
html += f"Count: {musiccount}\n\n"
return html