diff --git a/websitemodule.py b/websitemodule.py index 7b6e5af..34e78d6 100644 --- a/websitemodule.py +++ b/websitemodule.py @@ -2,14 +2,13 @@ import os import random import requests -# Ana kod Halhadus tarafından yazılmış ve DeepSeek-R1 tarafından optimize ve stilize edilmiştir. +# Main code written by Halhadus, optimized and stylized by DeepSeek-R1 -def randomize(listurl): - # Veri çekme ve temizleme +def randomize(listurl): # Data fetching and cleaning musiclist = requests.get(listurl).text.split("\n") musiclist = [m.strip() for m in musiclist if m.strip() != ""] - # HTML başlangıç template'i + # HTML base template html = """ @@ -69,21 +68,20 @@ def randomize(listurl):
- [ 📜 Source Code & History ]
-

Music List

- - + +
- - @@ -92,24 +90,24 @@ def randomize(listurl): random.shuffle(musiclist) musiccount = 0 - # Müzik kartları oluşturma + # Music cards creation for music in musiclist: try: parts = music.split(" --- ") if len(parts) != 3: continue - + title, vid, platform = parts musiccount += 1 - - # Thumbnail URL'si + + # Thumbnail URL thumbnail_url = f"https://img.youtube.com/vi/{vid}/hqdefault.jpg" - # Platforma göre URL belirleme + # Determine URL based on platform base_url = "music.youtube.com" if platform == "YTM" else "www.youtube.com" yt_url = f"https://{base_url}/watch?v={vid}" - - # HTML blok + + # HTML block html += f"""
@@ -119,16 +117,16 @@ def randomize(listurl): {platform} →
- {title} Cover Art
""" - + except Exception as e: print(f"Error processing: {music} - {str(e)}") - - # Footer kısmı + + # Footer section html += f"""
@@ -138,5 +136,5 @@ def randomize(listurl):
""" - - return html + + return html \ No newline at end of file