mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 12:00:06 +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;
|
var downloadURLOrAlertErrorInterval;
|
||||||
function downloadURLOrAlertError(jsonURL, data, filename, progress) {
|
function downloadURLOrAlertError(jsonURL, data, filename, FFMpegProgress) {
|
||||||
modal.showPleaseWait();
|
modal.showPleaseWait();
|
||||||
avideoToastInfo('Converting');
|
avideoToastInfo('Converting');
|
||||||
downloadURLOrAlertErrorInterval = setInterval(function(){
|
checkFFMPEGProgress(FFMpegProgress);
|
||||||
$.ajax({
|
|
||||||
url: progress,
|
|
||||||
success: function (response) {
|
|
||||||
console.log(response);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},1000);
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: jsonURL,
|
url: jsonURL,
|
||||||
method: 'POST',
|
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) {
|
function startGoogleAd(selector) {
|
||||||
if (isVisibleAndInViewport(selector)) {
|
if (isVisibleAndInViewport(selector)) {
|
||||||
console.log('startGoogleAd', selector);
|
console.log('startGoogleAd', selector);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue