mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Trying a new approach
This commit is contained in:
@@ -972,17 +972,20 @@ var List = {
|
|||||||
attr = ".vote-container";
|
attr = ".vote-container";
|
||||||
del_attr = "delete_button";
|
del_attr = "delete_button";
|
||||||
|
|
||||||
var url = "https://zoff.me:8081/https://img.youtube.com/vi/"+video_id+"/mqdefault.jpg";
|
$.getJSON('https://www.googleapis.com/youtube/v3/videos?id=' + video_id
|
||||||
$.ajax({
|
+ "&key=" + api_key + "&part=snippet",
|
||||||
type: "HEAD",
|
function (data, status, xhr) {
|
||||||
url: url,
|
if (data.items.length == 0) {
|
||||||
error: function(e) {
|
|
||||||
if(e.status == 404) {
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
socket.emit("error_video", {channel: chan.toLowerCase(), id: video_id, title: video_title});
|
socket.emit("error_video", {channel: chan.toLowerCase(), id: video_id, title: video_title});
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
}).error(function (xhr, errorType, exception) {
|
||||||
|
var errorMessage = exception || xhr.statusText || xhr.responseText;
|
||||||
|
setTimeout(function() {
|
||||||
|
socket.emit("error_video", {channel: chan.toLowerCase(), id: video_id, title: video_title});
|
||||||
|
}, 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
var _temp_duration = Helper.secondsToOther(_song_info.duration);
|
var _temp_duration = Helper.secondsToOther(_song_info.duration);
|
||||||
|
|||||||
Reference in New Issue
Block a user