From 9e351ea4ac1dc3c97e1b755a9bb34ebd1edb0d7f Mon Sep 17 00:00:00 2001 From: Halhadus Date: Mon, 25 Nov 2024 03:37:43 +0300 Subject: [PATCH] File dependency of randomizer module removed --- randomizermodule.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/randomizermodule.py b/randomizermodule.py index b55f066..b7c7581 100644 --- a/randomizermodule.py +++ b/randomizermodule.py @@ -1,14 +1,10 @@ import os import random +import requests -if not os.path.exists("musiclist.txt"): - print("musiclist.txt not found") - exit() - -with open("musiclist.txt", "r") as f: - musiclist = f.readlines() - -def randomize(): +def randomize(listurl): + # Please don't refresh too fast and kill my website and git server... + musiclist = requests.get(listurl).text.split("\n") html = "\n\n\n\n\n\n\n" html += "\n" html += "Halhadus' Music List\n"