Skip to content

Commit 16a785c

Browse files
committed
account for new urls
1 parent 46ac5ec commit 16a785c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/webpage/media.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ class MediaPlayer {
503503
} catch (e) {
504504
console.error(e);
505505
} finally {
506-
output.filename = url.split("/").at(-1);
506+
output.filename = new URL(url).pathname.split("/").at(-1);
507507
prog.close();
508508
if (!output.length) {
509509
output.length = new Promise<number>(async (res) => {

src/webpage/utils/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,9 @@ export async function getapiurls(str: string): Promise<
588588
return false;
589589
}
590590
function isAnimated(src: string) {
591+
try {
592+
src = new URL(src).pathname;
593+
} catch {}
591594
return src.endsWith(".apng") || src.endsWith(".gif");
592595
}
593596
const staticImgMap = new Map<string, string | Promise<string>>();

0 commit comments

Comments
 (0)