youtube link workaround

This commit is contained in:
Lukáš Horáček 2020-04-11 16:46:17 +02:00
parent cfbce016b9
commit aedce9fc34
No known key found for this signature in database
GPG Key ID: E07D6630DBC17195
1 changed files with 2 additions and 1 deletions

View File

@ -69,7 +69,8 @@ module.exports = client => {
if(isLink) {
response = await fetch('https://www.googleapis.com/youtube/v3/search?key=' + client.config.keys.yt + '&part=id,snippet&maxResults=1&type=video&id=' + id);
} else {
response = await fetch('https://www.googleapis.com/youtube/v3/search?key=' + client.config.keys.yt + '&part=id,snippet&maxResults=1&type=video&q=' + encodeURIComponent(query));
// TODO: replace this workaround
response = await fetch('https://www.googleapis.com/youtube/v3/search?key=' + client.config.keys.yt + '&part=id,snippet&maxResults=1&type=video&q=**' + encodeURIComponent(query) + '**');
};
let parsed = await response.json();