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 += "

Music List


\n" html += "

Click on the music to listen


\n" html += "

\n" html += "

List is randomized. To see history of list and source codes of scripts which I used to generate this list, click here


\n" 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