account for new urls
This commit is contained in:
@@ -503,7 +503,7 @@ class MediaPlayer {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
} finally {
|
} finally {
|
||||||
output.filename = url.split("/").at(-1);
|
output.filename = new URL(url).pathname.split("/").at(-1);
|
||||||
prog.close();
|
prog.close();
|
||||||
if (!output.length) {
|
if (!output.length) {
|
||||||
output.length = new Promise<number>(async (res) => {
|
output.length = new Promise<number>(async (res) => {
|
||||||
|
@@ -588,6 +588,9 @@ export async function getapiurls(str: string): Promise<
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
function isAnimated(src: string) {
|
function isAnimated(src: string) {
|
||||||
|
try {
|
||||||
|
src = new URL(src).pathname;
|
||||||
|
} catch {}
|
||||||
return src.endsWith(".apng") || src.endsWith(".gif");
|
return src.endsWith(".apng") || src.endsWith(".gif");
|
||||||
}
|
}
|
||||||
const staticImgMap = new Map<string, string | Promise<string>>();
|
const staticImgMap = new Map<string, string | Promise<string>>();
|
||||||
|
Reference in New Issue
Block a user