mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
Improve download from CDN
This commit is contained in:
parent
fb73ed0da6
commit
129d6681ee
1 changed files with 17 additions and 9 deletions
|
@ -2243,17 +2243,10 @@ function downloadURL(url, filename) {
|
|||
}
|
||||
|
||||
var downloadURLOrAlertErrorInterval;
|
||||
function downloadURLOrAlertError(jsonURL, data, filename, progress) {
|
||||
function downloadURLOrAlertError(jsonURL, data, filename, FFMpegProgress) {
|
||||
modal.showPleaseWait();
|
||||
avideoToastInfo('Converting');
|
||||
downloadURLOrAlertErrorInterval = setInterval(function(){
|
||||
$.ajax({
|
||||
url: progress,
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
}
|
||||
});
|
||||
},1000);
|
||||
checkFFMPEGProgress(FFMpegProgress);
|
||||
$.ajax({
|
||||
url: jsonURL,
|
||||
method: 'POST',
|
||||
|
@ -2280,6 +2273,21 @@ function downloadURLOrAlertError(jsonURL, data, filename, progress) {
|
|||
});
|
||||
}
|
||||
|
||||
function checkFFMPEGProgress(FFMpegProgress) {
|
||||
if(empty(FFMpegProgress)){
|
||||
return false;
|
||||
}
|
||||
$.ajax({
|
||||
url: FFMpegProgress,
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
setTimeout(function () {
|
||||
checkFFMPEGProgress(FFMpegProgress)
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function startGoogleAd(selector) {
|
||||
if (isVisibleAndInViewport(selector)) {
|
||||
console.log('startGoogleAd', selector);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue