Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,11 +26,11 @@ def addrecord(orig,pitmp3,mid,gname,ghint):
|
|
| 26 |
else:
|
| 27 |
thiskey=lastkey['next']
|
| 28 |
#upload file src
|
| 29 |
-
files.put(name=orig,path=orig)
|
| 30 |
-
files.put(name=pitmp3,path=pitmp3)
|
| 31 |
-
files.put(name=mid,path=mid)
|
| 32 |
-
records.put({"name":names,"hint":ghint,"orig":orig,"pitmp3":pitmp3,"mid":mid},str(thiskey))
|
| 33 |
-
last.put({'next':thiskey+1},'last')
|
| 34 |
return 'OK'
|
| 35 |
|
| 36 |
|
|
@@ -49,7 +49,7 @@ def downloadaud(video_id,gname,ghint):
|
|
| 49 |
formats_url = f"https://draw-8fj-staging.begin.app/api/info/{video_id}"
|
| 50 |
formats = requests.get(formats_url)
|
| 51 |
formats_response=formats.json()
|
| 52 |
-
print(formats_response["formats"])
|
| 53 |
best_audio_format = None
|
| 54 |
for fmt in formats_response.get("formats", []):
|
| 55 |
if fmt.get("hasVideo") is False and fmt.get("hasAudio") is True and fmt.get("container") == "mp4":
|
|
|
|
| 26 |
else:
|
| 27 |
thiskey=lastkey['next']
|
| 28 |
#upload file src
|
| 29 |
+
print(files.put(name=orig,path=orig))
|
| 30 |
+
print(files.put(name=pitmp3,path=pitmp3))
|
| 31 |
+
print(files.put(name=mid,path=mid))
|
| 32 |
+
print(records.put({"name":names,"hint":ghint,"orig":orig,"pitmp3":pitmp3,"mid":mid},str(thiskey)))
|
| 33 |
+
print(last.put({'next':thiskey+1},'last'))
|
| 34 |
return 'OK'
|
| 35 |
|
| 36 |
|
|
|
|
| 49 |
formats_url = f"https://draw-8fj-staging.begin.app/api/info/{video_id}"
|
| 50 |
formats = requests.get(formats_url)
|
| 51 |
formats_response=formats.json()
|
| 52 |
+
#print(formats_response["formats"])
|
| 53 |
best_audio_format = None
|
| 54 |
for fmt in formats_response.get("formats", []):
|
| 55 |
if fmt.get("hasVideo") is False and fmt.get("hasAudio") is True and fmt.get("container") == "mp4":
|