Englishized
This commit is contained in:
parent
9425079a2b
commit
da16480e75
1 changed files with 23 additions and 25 deletions
|
@ -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>
|
||||
|
@ -74,10 +73,9 @@ def randomize(listurl):
|
|||
[ 📜 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'"
|
||||
class="play-button">
|
||||
|
@ -92,7 +90,7 @@ def randomize(listurl):
|
|||
random.shuffle(musiclist)
|
||||
musiccount = 0
|
||||
|
||||
# Müzik kartları oluşturma
|
||||
# Music cards creation
|
||||
for music in musiclist:
|
||||
try:
|
||||
parts = music.split(" --- ")
|
||||
|
@ -102,14 +100,14 @@ def randomize(listurl):
|
|||
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;">
|
||||
|
@ -128,7 +126,7 @@ def randomize(listurl):
|
|||
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;">
|
||||
|
|
Loading…
Add table
Reference in a new issue