mirror of
https://github.com/AIsouler/GKD_subscription.git
synced 2025-12-19 16:25:09 +08:00
update: 快照链接校验
This commit is contained in:
@@ -130,7 +130,7 @@ export async function* walk(dirPath: string) {
|
|||||||
|
|
||||||
export const validSnapshotUrl = (s: string) => {
|
export const validSnapshotUrl = (s: string) => {
|
||||||
const u = new URL(s);
|
const u = new URL(s);
|
||||||
return u.pathname.startsWith('/import/');
|
return u.pathname.startsWith('/import/') || u.pathname.startsWith('/i/');
|
||||||
};
|
};
|
||||||
|
|
||||||
export const checkConfig = (newConfig: RawSubscription) => {
|
export const checkConfig = (newConfig: RawSubscription) => {
|
||||||
@@ -284,7 +284,7 @@ export const checkConfig = (newConfig: RawSubscription) => {
|
|||||||
groupKey: g.key,
|
groupKey: g.key,
|
||||||
});
|
});
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`invalid snapshotUrls: ${u}\nit should like https://i.gkd.li/import/12506571`,
|
`invalid snapshotUrls: ${u}\nit should like https://i.gkd.li/import/12506571 or https://i.gkd.li/i/14362119`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -299,7 +299,7 @@ export const checkConfig = (newConfig: RawSubscription) => {
|
|||||||
ruleKey: r.key,
|
ruleKey: r.key,
|
||||||
});
|
});
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`invalid snapshotUrls: ${u}\nit should like https://i.gkd.li/import/12506571`,
|
`invalid snapshotUrls: ${u}\nit should like https://i.gkd.li/import/12506571 or https://i.gkd.li/i/14362119`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user