Englishized

This commit is contained in:
Halhadus 2025-02-07 17:23:54 -05:00
parent 9425079a2b
commit da16480e75

View file

@ -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 = """<!DOCTYPE html>
<html lang="en">
<head>
@ -69,21 +68,20 @@ def randomize(listurl):
<div style="max-width: 800px; margin: 0 auto; padding: 20px;">
<!-- Source Banner -->
<div class="source-banner">
<a href="https://git.halhadus.rocks/Halhadus/my-music-list"
<a href="https://git.halhadus.rocks/Halhadus/my-music-list"
style="color: #ffffff; text-decoration: none;">
[ 📜 Source Code & History ]
</a>
</div>
<h1>Music List</h1>
<!-- Kontrol Butonları -->
<!-- Control Buttons -->
<div style="margin-bottom: 30px; display: flex; gap: 10px;">
<button onclick="window.location.href = 'https://halhadus.rocks/index.html'"
<button onclick="window.location.href = 'https://halhadus.rocks/index.html'"
class="play-button">
Main Page
</button>
<button onclick="window.open(document.links[Math.floor(Math.random() * document.links.length)].href)"
<button onclick="window.open(document.links[Math.floor(Math.random() * document.links.length)].href)"
class="play-button">
Random Track
</button>
@ -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"""
<div class="music-card">
<div style="margin-bottom: 10px; display: flex; align-items: center;">
@ -119,16 +117,16 @@ def randomize(listurl):
{platform}
</button>
</div>
<img src="{thumbnail_url}"
class="thumbnail"
alt="{title} Cover Art"
<img src="{thumbnail_url}"
class="thumbnail"
alt="{title} Cover Art"
onerror="this.style.display='none'">
</div>"""
except Exception as e:
print(f"Error processing: {music} - {str(e)}")
# Footer kısmı
# Footer section
html += f"""
<div style="margin-top: 40px; text-align: center; color: #666;">
<div style="margin-bottom: 15px;">
@ -138,5 +136,5 @@ def randomize(listurl):
</div>
</body>
</html>"""
return html
return html