fix(route): customs (#17204)

* fix(route): customs

* docs: add back warning
This commit is contained in:
Tony
2024-10-21 05:06:30 +08:00
committed by GitHub
parent 23341247b8
commit f20428cde6
2 changed files with 12 additions and 2 deletions
+5 -2
View File
@@ -31,8 +31,8 @@ export const route: Route = {
handler,
url: 'www.customs.gov.cn/',
description: `:::warning
由于区域限制,建议在国内 IP 的机器上自建
:::`,
由于区域限制,建议在国内 IP 的机器上自建
:::`,
};
async function handler(ctx) {
@@ -81,6 +81,9 @@ async function handler(ctx) {
const out = await Promise.all(
list.map((info) =>
cache.tryGet(info.link, async () => {
if (info.link.endsWith('.pdf') || info.link.endsWith('.doc')) {
return info;
}
const response = await puppeteerGet(info.link, browser);
const $ = load(response);
let date;
+7
View File
@@ -0,0 +1,7 @@
import type { Namespace } from '@/types';
export const namespace: Namespace = {
name: '中华人民共和国海关总署',
url: 'www.customs.gov.cn',
categories: ['government'],
};