|
|
@ -121,7 +121,7 @@ function get_playlist(plid, retries) {
|
|
|
|
var playlist = document.getElementById('playlist');
|
|
|
|
var playlist = document.getElementById('playlist');
|
|
|
|
|
|
|
|
|
|
|
|
if (retries <= 0) {
|
|
|
|
if (retries <= 0) {
|
|
|
|
console.log('Failed to pull playlist');
|
|
|
|
console.warn('Failed to pull playlist');
|
|
|
|
playlist.innerHTML = '';
|
|
|
|
playlist.innerHTML = '';
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -194,7 +194,7 @@ function get_playlist(plid, retries) {
|
|
|
|
playlist.innerHTML =
|
|
|
|
playlist.innerHTML =
|
|
|
|
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3><hr>';
|
|
|
|
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3><hr>';
|
|
|
|
|
|
|
|
|
|
|
|
console.log('Pulling playlist timed out... ' + retries + '/5');
|
|
|
|
console.warn('Pulling playlist timed out... ' + retries + '/5');
|
|
|
|
setTimeout(function () { get_playlist(plid, retries - 1); }, 1000);
|
|
|
|
setTimeout(function () { get_playlist(plid, retries - 1); }, 1000);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -203,7 +203,7 @@ function get_playlist(plid, retries) {
|
|
|
|
playlist.innerHTML =
|
|
|
|
playlist.innerHTML =
|
|
|
|
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3><hr>';
|
|
|
|
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3><hr>';
|
|
|
|
|
|
|
|
|
|
|
|
console.log('Pulling playlist timed out... ' + retries + '/5');
|
|
|
|
console.warn('Pulling playlist timed out... ' + retries + '/5');
|
|
|
|
get_playlist(plid, retries - 1);
|
|
|
|
get_playlist(plid, retries - 1);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -215,7 +215,7 @@ function get_reddit_comments(retries) {
|
|
|
|
var comments = document.getElementById('comments');
|
|
|
|
var comments = document.getElementById('comments');
|
|
|
|
|
|
|
|
|
|
|
|
if (retries <= 0) {
|
|
|
|
if (retries <= 0) {
|
|
|
|
console.log('Failed to pull comments');
|
|
|
|
console.warn('Failed to pull comments');
|
|
|
|
comments.innerHTML = '';
|
|
|
|
comments.innerHTML = '';
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -265,7 +265,7 @@ function get_reddit_comments(retries) {
|
|
|
|
comments.children[0].children[1].children[0].onclick = swap_comments;
|
|
|
|
comments.children[0].children[1].children[0].onclick = swap_comments;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if (video_data.params.comments[1] === 'youtube') {
|
|
|
|
if (video_data.params.comments[1] === 'youtube') {
|
|
|
|
console.log('Pulling comments failed... ' + retries + '/5');
|
|
|
|
console.warn('Pulling comments failed... ' + retries + '/5');
|
|
|
|
setTimeout(function () { get_youtube_comments(retries - 1); }, 1000);
|
|
|
|
setTimeout(function () { get_youtube_comments(retries - 1); }, 1000);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
comments.innerHTML = fallback;
|
|
|
|
comments.innerHTML = fallback;
|
|
|
@ -275,12 +275,12 @@ function get_reddit_comments(retries) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
xhr.onerror = function () {
|
|
|
|
xhr.onerror = function () {
|
|
|
|
console.log('Pulling comments failed... ' + retries + '/5');
|
|
|
|
console.warn('Pulling comments failed... ' + retries + '/5');
|
|
|
|
setTimeout(function () { get_reddit_comments(retries - 1); }, 1000);
|
|
|
|
setTimeout(function () { get_reddit_comments(retries - 1); }, 1000);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
xhr.ontimeout = function () {
|
|
|
|
xhr.ontimeout = function () {
|
|
|
|
console.log('Pulling comments failed... ' + retries + '/5');
|
|
|
|
console.warn('Pulling comments failed... ' + retries + '/5');
|
|
|
|
get_reddit_comments(retries - 1);
|
|
|
|
get_reddit_comments(retries - 1);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -292,7 +292,7 @@ function get_youtube_comments(retries) {
|
|
|
|
var comments = document.getElementById('comments');
|
|
|
|
var comments = document.getElementById('comments');
|
|
|
|
|
|
|
|
|
|
|
|
if (retries <= 0) {
|
|
|
|
if (retries <= 0) {
|
|
|
|
console.log('Failed to pull comments');
|
|
|
|
console.warn('Failed to pull comments');
|
|
|
|
comments.innerHTML = '';
|
|
|
|
comments.innerHTML = '';
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -349,14 +349,14 @@ function get_youtube_comments(retries) {
|
|
|
|
xhr.onerror = function () {
|
|
|
|
xhr.onerror = function () {
|
|
|
|
comments.innerHTML =
|
|
|
|
comments.innerHTML =
|
|
|
|
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
|
|
|
|
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
|
|
|
|
console.log('Pulling comments failed... ' + retries + '/5');
|
|
|
|
console.warn('Pulling comments failed... ' + retries + '/5');
|
|
|
|
setTimeout(function () { get_youtube_comments(retries - 1); }, 1000);
|
|
|
|
setTimeout(function () { get_youtube_comments(retries - 1); }, 1000);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
xhr.ontimeout = function () {
|
|
|
|
xhr.ontimeout = function () {
|
|
|
|
comments.innerHTML =
|
|
|
|
comments.innerHTML =
|
|
|
|
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
|
|
|
|
'<h3 style="text-align:center"><div class="loading"><i class="icon ion-ios-refresh"></i></div></h3>';
|
|
|
|
console.log('Pulling comments failed... ' + retries + '/5');
|
|
|
|
console.warn('Pulling comments failed... ' + retries + '/5');
|
|
|
|
get_youtube_comments(retries - 1);
|
|
|
|
get_youtube_comments(retries - 1);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -417,7 +417,7 @@ function get_youtube_replies(target, load_more, load_replies) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
xhr.ontimeout = function () {
|
|
|
|
xhr.ontimeout = function () {
|
|
|
|
console.log('Pulling comments failed.');
|
|
|
|
console.warn('Pulling comments failed.');
|
|
|
|
body.innerHTML = fallback;
|
|
|
|
body.innerHTML = fallback;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|