We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2556817 commit b6ac119Copy full SHA for b6ac119
scripts/download.js
@@ -20,8 +20,12 @@ const resources = [
20
'films',
21
];
22
23
+function replaceHttp(url) {
24
+ return url.replace(/http:\/\//g, 'https://');
25
+}
26
+
27
function normalizeUrl(url) {
- return new URL(url).toString();
28
+ return replaceHttp(new URL(url).toString());
29
}
30
31
/**
@@ -38,7 +42,9 @@ async function cacheResources() {
38
42
while (url != null) {
39
43
console.error(url);
40
44
const response = await fetch(url, { agent });
41
- const data = await response.json();
45
+ const text = await response.text();
46
47
+ const data = JSON.parse(replaceHttp(text));
48
49
cache[normalizeUrl(url)] = data;
50
for (const obj of data.results || []) {
0 commit comments