diff options
Diffstat (limited to 'app/client/api')
| -rw-r--r-- | app/client/api/parser.js | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/app/client/api/parser.js b/app/client/api/parser.js index 2530410..e116767 100644 --- a/app/client/api/parser.js +++ b/app/client/api/parser.js @@ -88,15 +88,14 @@ export const integrations = [ var thumb = "https://i.ytimg.com/vi/" + id + "/hqdefault.jpg" const jsonp_url = new URL('https://www.googleapis.com/youtube/v3/videos') - if (data) { - Object.keys({ - id: id, - key: "AIzaSyCaLRGY-hxs92045X-Jew7w1FgQPkStHgc", - part: "id,contentDetails,snippet,status", - }).forEach(key => jsonp_url.searchParams.append(key, data[key])) + const data = { + id: id, + key: "AIzaSyCaLRGY-hxs92045X-Jew7w1FgQPkStHgc", + part: "id,contentDetails,snippet,status", } + Object.keys(data).forEach(key => jsonp_url.searchParams.append(key, data[key])) - fetchJsonp(jsonp_url) + fetchJsonp(jsonp_url.toString()) .then(result => result.json()) .then(result => { if (! result || ! result.items.length) { |
