diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..59dd477 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +music +.venv +.env diff --git a/__pycache__/downloader.cpython-312.pyc b/__pycache__/downloader.cpython-312.pyc new file mode 100644 index 0000000..617a4d8 Binary files /dev/null and b/__pycache__/downloader.cpython-312.pyc differ diff --git a/index.html b/index.html index 0ca66f4..852d1be 100644 --- a/index.html +++ b/index.html @@ -470,4 +470,4 @@ - \ No newline at end of file + diff --git a/script.js b/script.js index bfcbeca..a66a2e8 100644 --- a/script.js +++ b/script.js @@ -1517,17 +1517,20 @@ window.addEventListener('DOMContentLoaded', () => { updateManualGlow('A', settings.glowA); updateManualGlow('B', settings.glowB); - // Dual-Port Logic: Port 5001 is for Listeners, 5000 is for DJs + // Check if this is the listener page based on hostname or port const isListenerPort = window.location.port === '5001'; + const isListenerHostname = window.location.hostname.startsWith('music.') || window.location.hostname.startsWith('listen.'); const urlParams = new URLSearchParams(window.location.search); - if (isListenerPort || urlParams.get('listen') === 'true') { + if (isListenerPort || isListenerHostname || urlParams.get('listen') === 'true') { initListenerMode(); } - if (!isListenerPort) { - // Set stream URL to the dedicated listener port (5001) - const streamUrl = `${window.location.protocol}//${window.location.hostname}:5001`; + if (!isListenerPort && !isListenerHostname) { + // Set stream URL to the listener domain + const streamUrl = window.location.hostname.startsWith('dj.') + ? `${window.location.protocol}//music.${window.location.hostname.split('.').slice(1).join('.')}` + : `${window.location.protocol}//${window.location.hostname}:5001`; const streamInput = document.getElementById('stream-url'); if (streamInput) streamInput.value = streamUrl; } diff --git a/server.py b/server.py index afd6b19..12be00e 100644 --- a/server.py +++ b/server.py @@ -120,10 +120,12 @@ def setup_shared_routes(app): if not file.filename.endswith('.mp3'): return jsonify({"success": False, "error": "Only MP3 files are allowed"}), 400 - # Sanitize filename + # Sanitize filename (keep extension) import re - filename = re.sub(r'[^\w\s-]', '', file.filename) - filename = re.sub(r'[-\s]+', '-', filename) + name_without_ext = os.path.splitext(file.filename)[0] + name_without_ext = re.sub(r'[^\w\s-]', '', name_without_ext) + name_without_ext = re.sub(r'[-\s]+', '-', name_without_ext) + filename = f"{name_without_ext}.mp3" filepath = os.path.join(MUSIC_FOLDER, filename) diff --git a/style.css b/style.css index 46d6457..6a5efea 100644 --- a/style.css +++ b/style.css @@ -3789,4 +3789,4 @@ body.listening-active .landscape-prompt { position: relative; padding-left: 40px; padding-right: 40px; -} \ No newline at end of file +} diff --git a/youtube_cookies.txt b/youtube_cookies.txt new file mode 100644 index 0000000..79e1134 --- /dev/null +++ b/youtube_cookies.txt @@ -0,0 +1,25 @@ +# Netscape HTTP Cookie File +# This file is generated by yt-dlp. Do not edit. + +.youtube.com TRUE / TRUE 1801589734 LOGIN_INFO AFmmF2swRAIgHdagSv3AtixYxCW7IHLf47R0KcQaW8NADbzvMuNuy3gCIDXXOJZWFSfAZ1jxxCUVVFuFyf1xoS3OhZtjQRiRGtaD:QUQ3MjNmeERNNlZib3lnSWN5ZkVWMWllUVpYNmNhMFROXzd3YWl2TnVMdHIyTlU2ZE92Z2R4aEJDZDRWb0RVZ01XMXUwSGlueTZYRU0zV1RNRXdJdzdhQmU1MlMwN1NaeXd0S2RBbUNQMU1UbVpuRmNqeC1Nekgxb01zajZCdnBZTkpPNVpOV3J3RDZ1QVNyNGpud3lCRTZjSUhpeVpwNFBn +.youtube.com TRUE / FALSE 1801593439 SID g.a0005AjCJ-US8_6a2mKBHcNy8J5xGdIRFU5-3J24Rh__ueKgYF87AJIWypIb2Ik6XVFT5EqrnwACgYKATgSARcSFQHGX2MiGk_57qzeI-IPJkM8tmm03xoVAUF8yKpSfHahHvTEK-ia_rVzU4Yi0076 +.youtube.com TRUE / TRUE 1801593439 __Secure-1PSID g.a0005AjCJ-US8_6a2mKBHcNy8J5xGdIRFU5-3J24Rh__ueKgYF87qT1WAfdS7sFekPiWVXKIfAACgYKAUMSARcSFQHGX2MiuiQpTAzra30LEmDxkHp2-RoVAUF8yKpWWOikkri1UB3MugOGq6e_0076 +.youtube.com TRUE / TRUE 1801593439 __Secure-3PSID g.a0005AjCJ-US8_6a2mKBHcNy8J5xGdIRFU5-3J24Rh__ueKgYF87tL2jiqzMehdfEubeYBuVTQACgYKAYUSARcSFQHGX2MiLLWEo22MP59Bv_AQnTvuIhoVAUF8yKo2FXEl9xZI7eV_iJwo3c9t0076 +.youtube.com TRUE / FALSE 1801593439 HSID AB0zrN4IKxe-HrA0n +.youtube.com TRUE / TRUE 1801593439 SSID Ab6kKLl9bmrQL_Hni +.youtube.com TRUE / FALSE 1801593439 APISID 22L8tjFyV2jsGKge/AZ2PhPO3ivukTdkWs +.youtube.com TRUE / TRUE 1801593439 SAPISID trR-s5Kb4rJZa0jz/AMQf8wrRhlN1gozvu +.youtube.com TRUE / TRUE 1801593439 __Secure-1PAPISID trR-s5Kb4rJZa0jz/AMQf8wrRhlN1gozvu +.youtube.com TRUE / TRUE 1801593439 __Secure-3PAPISID trR-s5Kb4rJZa0jz/AMQf8wrRhlN1gozvu +.youtube.com TRUE / FALSE 0 PREF f6=80&repeat=NONE&tz=UTC&hl=en +.youtube.com TRUE / TRUE 1801508383 __Secure-YENID 12.YTE=S5qLwonI5Vef0tWqM9BVf_no2FGqTz8wCQjAEW6w_bCkldGIesWCVwHjY7lM6hILbuvAm-SQkWeGzqXn42Lz12xLJSRy8ew3DZjHDIsihRhcJx1mdRMlEBrUFZh0kguQ_VAyva8GIrM_3szB4UBUh5EYpiuJcnTFieCEA7vsvEOygkM2bVO-aDcvDCo2KkjcorJ0rFrozxvjNG1gIdgRZb-_eCqLmrHRPrSaBMqSjIQVCYr0UURNAt7jnY4u_ngRfd4gedGFAAigASCRq64Hg0PoA3jlZrRVq-ZTFXrXnAdKDoCJ4NQM_k29X8DLLGPNTtrAzxKn7_u7PeWbeHWfKg +.youtube.com TRUE / TRUE 1801508384 __Secure-YEC CgtfZncxejAtTU92ZyjJruDKBjInCgJFUxIhEh0SGwsMDg8QERITFBUWFxgZGhscHR4fICEiIyQlJiAVYuACCt0CMTIuWVRFPVM1cUx3b25JNVZlZjB0V3FNOUJWZl9ubzJGR3FUejh3Q1FqQUVXNndfYkNrbGRHSWVzV0NWd0hqWTdsTTZoSUxidXZBbS1TUWtXZUd6cVhuNDJMejEyeExKU1J5OGV3M0RaakhESXNpaFJoY0p4MW1kUk1sRUJyVUZaaDBrZ3VRX1ZBeXZhOEdJck1fM3N6QjRVQlVoNUVZcGl1SmNuVEZpZUNFQTd2c3ZFT3lna00yYlZPLWFEY3ZEQ28yS2tqY29ySjByRnJvenh2ak5HMWdJZGdSWmItX2VDcUxtckhSUHJTYUJNcVNqSVFWQ1lyMFVVUk5BdDdqblk0dV9uZ1JmZDRnZWRHRkFBaWdBU0NScTY0SGcwUG9BM2psWnJSVnEtWlRGWHJYbkFkS0RvQ0o0TlFNX2syOVg4RExMR1BOVHRyQXp4S243X3U3UGVXYmVIV2ZLZw%3D%3D +.youtube.com TRUE / TRUE 1798916391 __Secure-1PSIDTS sidts-CjQBflaCdeAx2SdtKMD9zUQdw365y09bcjcMAEVt7wunyzZ8vOXra2-sNlYpujrgrSAB4Oi4EAA +.youtube.com TRUE / TRUE 1798916391 __Secure-3PSIDTS sidts-CjQBflaCdeAx2SdtKMD9zUQdw365y09bcjcMAEVt7wunyzZ8vOXra2-sNlYpujrgrSAB4Oi4EAA +.youtube.com TRUE / FALSE 1798916809 SIDCC AKEyXzXV3xIB5WrVkJilMKV2wq5se8ySH9nuVzyMGS1n32jUeRk4DlqdxAUye7CFMbOYvnuCNA +.youtube.com TRUE / TRUE 1798916809 __Secure-1PSIDCC AKEyXzUqPSmDU8y0QdEdwdIXdKqwnLgAhdkYJPvfudfujzh-JsXcj61JSiUbYmuaxQDVi9COJQ +.youtube.com TRUE / TRUE 1798916809 __Secure-3PSIDCC AKEyXzWBfqFbiZ36NLiL0rulHLMnJZUo5BiDTKTXTkSWCUq15QRHigVH3ZZK9gghuCUVnqfZKw +.youtube.com TRUE / TRUE 1767381013 CONSISTENCY APeVyi9ugkVMpG4vJpUcbJphFq3pD5vJDWaAdsKzDA5ewHpf3ooaflF7egA5RflAGECOzj2iLWP_rYEjQo86XJgjJmh9rD0AUqm6RY1w3FqyfXz7wQ0glrBVgLqqAlmsCb6LVxECHmznH21ZZq88PVQ9m6xdY_IWj6a47_ISRqGIOtOuPztFCXy1bYh78qR8RWJ6DnEPGyI5l8cB0W3O_Q2o11gU35e7MY-ycVMjnt0zq48T +.youtube.com TRUE / TRUE 1782911361 __Secure-ROLLOUT_TOKEN COHd58SY0cK-vgEQqK6mtKvjkQMYi7Ss1_bskQM%3D +.youtube.com TRUE / TRUE 0 YSC Z10UFLfjCRM +.youtube.com TRUE / TRUE 1801508809 VISITOR_PRIVACY_METADATA CgJFUxIhEh0SGwsMDg8QERITFBUWFxgZGhscHR4fICEiIyQlJiAV