1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

Improve download from CDN

This commit is contained in:
DanieL 2022-06-27 13:12:26 -03:00
parent fc693f0450
commit a43ca7f0b5
7 changed files with 186 additions and 6 deletions

View file

@ -2242,14 +2242,24 @@ function downloadURL(url, filename) {
});
}
function downloadURLOrAlertError(jsonURL, data, filename) {
var downloadURLOrAlertErrorInterval;
function downloadURLOrAlertError(jsonURL, data, filename, progress) {
modal.showPleaseWait();
avideoToastInfo('Converting');
downloadURLOrAlertErrorInterval = setInterval(function(){
$.ajax({
url: progress,
success: function (response) {
console.log(response);
}
});
});
$.ajax({
url: jsonURL,
method: 'POST',
data: data,
success: function (response) {
clearInterval(downloadURLOrAlertErrorInterval);
if (response.error) {
avideoAlertError(response.msg);
modal.hidePleaseWait();