Spaces:
Paused
Paused
Update ccc.py
Browse files
ccc.py
CHANGED
|
@@ -3,15 +3,14 @@ import requests
|
|
| 3 |
import random
|
| 4 |
from bs4 import BeautifulSoup
|
| 5 |
import os
|
| 6 |
-
import sys
|
| 7 |
|
| 8 |
# Get webhook URL from environment variable
|
| 9 |
WEBHOOK_URL = os.environ['web']
|
| 10 |
BASE_URL = "https://tidal.com/browse/track/"
|
| 11 |
-
TRACK_CHECK_INTERVAL = 0.1 # Reduced to 0.1 seconds for much faster checking
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
START_TRACK_ID =
|
|
|
|
| 15 |
|
| 16 |
def send_webhook_message(track_link, track_info):
|
| 17 |
data = {
|
|
@@ -39,7 +38,7 @@ def check_tidal_track(track_id):
|
|
| 39 |
if title_element:
|
| 40 |
# Try to find artist information
|
| 41 |
artist_element = soup.find('a', class_="artist-link")
|
| 42 |
-
artist_name = artist_element.text if artist_element else " Artist"
|
| 43 |
|
| 44 |
track_info = f"{title_element.text}\n{artist_name}"
|
| 45 |
return True, track_info
|
|
|
|
| 3 |
import random
|
| 4 |
from bs4 import BeautifulSoup
|
| 5 |
import os
|
|
|
|
| 6 |
|
| 7 |
# Get webhook URL from environment variable
|
| 8 |
WEBHOOK_URL = os.environ['web']
|
| 9 |
BASE_URL = "https://tidal.com/browse/track/"
|
|
|
|
| 10 |
|
| 11 |
+
# Configuration - Edit these values as needed
|
| 12 |
+
START_TRACK_ID = 128449033 # Change this to your desired starting track ID
|
| 13 |
+
TRACK_CHECK_INTERVAL = 0.5 # Speed of checking in seconds (lower = faster)
|
| 14 |
|
| 15 |
def send_webhook_message(track_link, track_info):
|
| 16 |
data = {
|
|
|
|
| 38 |
if title_element:
|
| 39 |
# Try to find artist information
|
| 40 |
artist_element = soup.find('a', class_="artist-link")
|
| 41 |
+
artist_name = artist_element.text if artist_element else "Unknown Artist"
|
| 42 |
|
| 43 |
track_info = f"{title_element.text}\n{artist_name}"
|
| 44 |
return True, track_info
|