Chrunos commited on
Commit
4b3caea
·
verified ·
1 Parent(s): 45a9c4f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -110,14 +110,13 @@ def get_spotify_token() -> str:
110
  raise HTTPException(status_code=500, detail="Internal server error")
111
 
112
  async def get_download_url(url):
113
- loop = asyncio.get_running_loop()
114
  api_url = "https://chrunos-ytdl2.hf.space/download"
115
  data = {"url": url}
116
  headers = {
117
  "Content-Type": "application/json"
118
  }
119
  try:
120
- response = await loop.run_in_executor(None, requests.post, api_url, json=data, headers=headers)
121
  if response.status_code == 200:
122
  result = response.json()
123
  return result.get('download_url')
 
110
  raise HTTPException(status_code=500, detail="Internal server error")
111
 
112
  async def get_download_url(url):
 
113
  api_url = "https://chrunos-ytdl2.hf.space/download"
114
  data = {"url": url}
115
  headers = {
116
  "Content-Type": "application/json"
117
  }
118
  try:
119
+ response = await requests.post(api_url, json=data, headers=headers)
120
  if response.status_code == 200:
121
  result = response.json()
122
  return result.get('download_url')