Skip to content

Commit 6fd8fea

Browse files
author
hoang.tran12
committed
fix insta
1 parent 613326f commit 6fd8fea

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/insta_GLOBAL.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ export function getBiggestMediaFromNode(node) {
1717
}
1818
}
1919
export function getUniversalCdnUrl(cdnLink) {
20-
const cdn = new URL(cdnLink);
21-
cdn.host = "scontent.cdninstagram.com";
22-
return cdn.href;
20+
try {
21+
const cdn = new URL(cdnLink);
22+
cdn.host = "scontent.cdninstagram.com";
23+
return cdn.href;
24+
} catch (e) {
25+
return cdnLink;
26+
}
2327
}
2428
export async function getAllMedia({ uid, progressCallback, limit = 0 }) {
2529
let all_urls = [];

0 commit comments

Comments
 (0)