mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-10-24 02:08:55 +08:00
fix(route): add pdf files of nidc papers (#19478)
This commit is contained in:
@@ -62,6 +62,22 @@ async function handler(ctx) {
|
||||
const content = load(detailResponse.data);
|
||||
item.description = content('div.qrd-content').html();
|
||||
|
||||
const $enclosureEl = content('div.report-bottom a').first();
|
||||
const enclosureUrl = $enclosureEl.attr('href');
|
||||
|
||||
if (enclosureUrl) {
|
||||
const enclosureItem = {
|
||||
enclosure_url: new URL(enclosureUrl, rootUrl).href,
|
||||
enclosure_type: `application/${enclosureUrl.split(/\./).pop() ?? 'pdf'}`,
|
||||
enclosure_title: $enclosureEl.prev().text(),
|
||||
};
|
||||
|
||||
item = {
|
||||
...item,
|
||||
...enclosureItem,
|
||||
};
|
||||
}
|
||||
|
||||
return item;
|
||||
})
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user