File dependency of randomizer module removed
This commit is contained in:
parent
ed739b3d8a
commit
9e351ea4ac
1 changed files with 4 additions and 8 deletions
|
@ -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 = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"UTF-8\">\n<link href=\"https://fonts.googleapis.com/css2?family=Jetbrains+Mono:wght@400;700&display=swap\" rel=\"stylesheet\">\n</head>\n<body style=\"background-color: #1f1f1f; color: #ffffff; font-family: 'Jetbrains Mono', monospace;\">\n"
|
||||
html += "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n"
|
||||
html += "<title>Halhadus' Music List</title>\n"
|
||||
|
|
Loading…
Reference in a new issue