mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Multi-word channel-names and API-fixes
- Spaces and signs allowed in channel-name - Added missing functioncalls in RESTApi
This commit is contained in:
@@ -11,7 +11,7 @@ var request = require('request');
|
||||
var db = require(pathThumbnails + '/handlers/db.js');
|
||||
|
||||
function get_correct_info(song_generated, channel, broadcast, callback) {
|
||||
channel = channel.replace(/ /g,'');
|
||||
//channel = channel.replace(/ /g,'');
|
||||
request({
|
||||
type: "GET",
|
||||
url: "https://www.googleapis.com/youtube/v3/videos?part=contentDetails,snippet,id&key="+key+"&id=" + song_generated.id,
|
||||
@@ -85,7 +85,7 @@ function check_error_video(msg, channel) {
|
||||
return;
|
||||
}
|
||||
if(msg.source == "soundcloud") return;
|
||||
channel = channel.replace(/ /g,'');
|
||||
//channel = channel.replace(/ /g,'');
|
||||
request({
|
||||
type: "GET",
|
||||
url: "https://www.googleapis.com/youtube/v3/videos?part=id&key="+key+"&id=" + msg.id,
|
||||
@@ -103,7 +103,7 @@ function check_error_video(msg, channel) {
|
||||
}
|
||||
|
||||
function findSimilar(msg, channel, broadcast, callback) {
|
||||
channel = channel.replace(/ /g,'');
|
||||
//channel = channel.replace(/ /g,'');
|
||||
var yt_url = "https://www.googleapis.com/youtube/v3/search?key="+key+"&videoEmbeddable=true&part=id&type=video&order=viewCount&safeSearch=none&maxResults=5&q=" + encodeURIComponent(msg.title);
|
||||
request({
|
||||
method: "GET",
|
||||
|
||||
Reference in New Issue
Block a user