summaryrefslogtreecommitdiff
path: root/app/client/api
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-30 14:38:57 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-30 14:38:57 +0200
commit4361ca701337c22796c8054f8051fc286554c349 (patch)
tree9321c4b327f140bedf5fc4b2640bea1ced08fe9a /app/client/api
parentcba34c1ff3fc4fa3e4444884133a9140443bb233 (diff)
fix yt
Diffstat (limited to 'app/client/api')
-rw-r--r--app/client/api/parser.js13
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) {