Chrunos commited on
Commit
ddfd898
·
verified ·
1 Parent(s): 6a45bf5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -32,7 +32,7 @@ def searcht():
32
  first_song = next((song for song in search_results if 'videoId' in song and song['videoId']), {}) if search_results else {}
33
  return jsonify(first_song)
34
 
35
- async def get_track_download_url():
36
  apis = [
37
  "https://cobalt-api.ayo.tf",
38
  "http://34.107.254.11"
@@ -41,7 +41,8 @@ async def get_track_download_url():
41
  for api_url in apis:
42
  try:
43
  logger.info(f"Attempting to get download URL from: {api_url}")
44
- response = requests.post(api_url, timeout=20, json={"url": "https://youtu.be/8nBFqZppIF0"}, headers={"Accept": "application/json"})
 
45
  logger.info(f"Response status: {response.status_code}")
46
  logger.info(f"Response content: {response.content}")
47
 
 
32
  first_song = next((song for song in search_results if 'videoId' in song and song['videoId']), {}) if search_results else {}
33
  return jsonify(first_song)
34
 
35
+ async def get_track_download_url(track_id: str) -> str:
36
  apis = [
37
  "https://cobalt-api.ayo.tf",
38
  "http://34.107.254.11"
 
41
  for api_url in apis:
42
  try:
43
  logger.info(f"Attempting to get download URL from: {api_url}")
44
+ y_url = f"https://youtu.be/{track_id}"
45
+ response = requests.post(api_url, timeout=20, json={"url": y_url}, headers={"Accept": "application/json"})
46
  logger.info(f"Response status: {response.status_code}")
47
  logger.info(f"Response content: {response.content}")
48