Files
RSSHub/lib/v2/dsndsht23/radar.js
T
Ethan Shen 277dae093d fix(route): 色花堂 with duplicate magnets (#10327)
* fix(route): 色花堂 with duplicate magnets

* fix typo

* refactor: use WHATWG URL
2022-07-26 20:03:38 +05:00

20 lines
747 B
JavaScript

module.exports = {
'sehuatang.net': {
_name: '色花堂',
'.': [
{
title: '分区帖子',
docs: 'https://docs.rsshub.app/multimedia.html#se-hua-tang-fen-qu-tie-zi',
source: ['/:category', '/'],
target: (params, url) => {
const theUrl = new URL(url);
const matches = String(theUrl).match(/forum-(\d)+-\d+/);
const fid = theUrl.searchParams.get('fid') || (matches ? matches[1] : '');
const tid = theUrl.searchParams.get('typeid');
return `/dsndsht23${fid ? `/${fid}` : ''}${tid ? `/${tid}` : ''}`;
},
},
],
},
};