Update app.py
Browse files
app.py
CHANGED
|
@@ -113,7 +113,8 @@ def downloadTubeUpload(query):
|
|
| 113 |
"Content-Disposition": f"attachment; filename={video_id}.mp4"
|
| 114 |
}
|
| 115 |
aurl=best_audio_format["url"]
|
| 116 |
-
|
|
|
|
| 117 |
os.system(command)
|
| 118 |
command= f'curl --url https://www.lalal.ai/api/upload/ --data-binary @temp.mp4 --header "Content-Disposition: attachment; filename=temp.mp4"'
|
| 119 |
output=getoutput(command)
|
|
@@ -121,10 +122,10 @@ def downloadTubeUpload(query):
|
|
| 121 |
return upload_response.get("result", {}).get("id")
|
| 122 |
def split_file(file_id):
|
| 123 |
url_for_split = "https://www.lalal.ai/api/preview/"
|
| 124 |
-
headers={'x-csrftoken':'fdH0XaNK6YCAUnSgaNK2hEzKvTv7UcXj'}
|
| 125 |
|
| 126 |
query_args = {'id': file_id, 'splitter': "phoenix"}
|
| 127 |
-
response = requests.post(url_for_split, data=query_args
|
| 128 |
split_result = response.json()
|
| 129 |
if split_result["status"] == "error":
|
| 130 |
raise RuntimeError(split_result["error"])
|
|
|
|
| 113 |
"Content-Disposition": f"attachment; filename={video_id}.mp4"
|
| 114 |
}
|
| 115 |
aurl=best_audio_format["url"]
|
| 116 |
+
print(aurl)
|
| 117 |
+
command = f'wget "{aurl}" -O temp.mp4'
|
| 118 |
os.system(command)
|
| 119 |
command= f'curl --url https://www.lalal.ai/api/upload/ --data-binary @temp.mp4 --header "Content-Disposition: attachment; filename=temp.mp4"'
|
| 120 |
output=getoutput(command)
|
|
|
|
| 122 |
return upload_response.get("result", {}).get("id")
|
| 123 |
def split_file(file_id):
|
| 124 |
url_for_split = "https://www.lalal.ai/api/preview/"
|
| 125 |
+
#headers={'x-csrftoken':'fdH0XaNK6YCAUnSgaNK2hEzKvTv7UcXj'}
|
| 126 |
|
| 127 |
query_args = {'id': file_id, 'splitter': "phoenix"}
|
| 128 |
+
response = requests.post(url_for_split, data=query_args)#headers=headers
|
| 129 |
split_result = response.json()
|
| 130 |
if split_result["status"] == "error":
|
| 131 |
raise RuntimeError(split_result["error"])
|