Merge branch 'feature/registry'
This commit is contained in:
@@ -8,7 +8,6 @@ Dockerfile*
|
||||
LICENSE
|
||||
Procfile
|
||||
app-minimal
|
||||
assets
|
||||
coverage
|
||||
node_modules
|
||||
test
|
||||
|
||||
@@ -34,7 +34,13 @@ jobs:
|
||||
- name: Install dependencies (yarn)
|
||||
run: pnpm i
|
||||
- name: Build assets
|
||||
run: npm run build:all
|
||||
run: npm run build
|
||||
- name: Commit files
|
||||
run: |
|
||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git status
|
||||
git diff-index --quiet HEAD || (git commit -m "chore: auto build" -a --no-verify && git push "https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" HEAD:master)
|
||||
- name: Deploy
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
|
||||
@@ -104,32 +104,6 @@ jobs:
|
||||
run: pnpm run vitest puppeteer
|
||||
env: ${{ fromJSON(matrix.chromium.environment) }}
|
||||
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [ 18, 20, 21 ]
|
||||
defaults:
|
||||
run:
|
||||
working-directory: website
|
||||
name: Build docs on Node ${{ matrix.node-version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: pnpm/action-setup@v3
|
||||
with:
|
||||
version: 8
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: website/pnpm-lock.yaml
|
||||
- run: pnpm i
|
||||
- name: Build docs
|
||||
run: pnpm run build
|
||||
working-directory: website
|
||||
|
||||
all:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
@@ -149,7 +123,7 @@ jobs:
|
||||
cache: 'pnpm'
|
||||
- run: pnpm i
|
||||
- name: Build radar and maintainer
|
||||
run: npm run build:all
|
||||
run: npm run build
|
||||
|
||||
automerge:
|
||||
if: github.triggering_actor == 'dependabot[bot]' && github.event_name == 'pull_request'
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
*.iml
|
||||
|
||||
app-minimal/
|
||||
assets/build/
|
||||
coverage
|
||||
docs/.vuepress/dist
|
||||
node_modules
|
||||
|
||||
+6
-5
@@ -39,17 +39,17 @@ WORKDIR /ver
|
||||
COPY ./package.json /app/
|
||||
RUN \
|
||||
set -ex && \
|
||||
grep -Po '(?<="puppeteer": ")[^\s"]*(?=")' /app/package.json | tee /ver/.puppeteer_version && \
|
||||
grep -Po '(?<="@vercel/nft": ")[^\s"]*(?=")' /app/package.json | tee /ver/.nft_version && \
|
||||
grep -Po '(?<="fs-extra": ")[^\s"]*(?=")' /app/package.json | tee /ver/.fs_extra_version
|
||||
grep -Po '(?<="puppeteer": ")[^\s"]*(?=")' /app/package.json | tee /ver/.puppeteer_version
|
||||
# grep -Po '(?<="@vercel/nft": ")[^\s"]*(?=")' /app/package.json | tee /ver/.nft_version && \
|
||||
# grep -Po '(?<="fs-extra": ")[^\s"]*(?=")' /app/package.json | tee /ver/.fs_extra_version
|
||||
|
||||
# ---------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
FROM node:21-bookworm-slim AS docker-minifier
|
||||
# The stage is used to further reduce the image size by removing unused files.
|
||||
|
||||
WORKDIR /minifier
|
||||
COPY --from=dep-version-parser /ver/* /minifier/
|
||||
WORKDIR /app
|
||||
# COPY --from=dep-version-parser /ver/* /minifier/
|
||||
|
||||
# ARG USE_CHINA_NPM_REGISTRY=0
|
||||
# RUN \
|
||||
@@ -73,6 +73,7 @@ RUN \
|
||||
# rm -rf /app/node_modules /app/scripts && \
|
||||
# mv /app/app-minimal/node_modules /app/ && \
|
||||
# rm -rf /app/app-minimal && \
|
||||
npm run build && \
|
||||
ls -la /app && \
|
||||
du -hd1 /app
|
||||
|
||||
|
||||
+2
-2
@@ -15,8 +15,8 @@ import parameter from '@/middleware/parameter';
|
||||
|
||||
import logger from '@/utils/logger';
|
||||
|
||||
import initRoutes from '@/init-routes';
|
||||
import { notFoundHandler, errorHandler } from '@/errors';
|
||||
import registry from '@/registry';
|
||||
|
||||
process.on('uncaughtException', (e) => {
|
||||
logger.error('uncaughtException: ' + e);
|
||||
@@ -36,7 +36,7 @@ app.use(antiHotlink);
|
||||
app.use(parameter);
|
||||
app.use(cache);
|
||||
|
||||
initRoutes(app);
|
||||
registry(app);
|
||||
|
||||
app.notFound(notFoundHandler);
|
||||
app.onError(errorHandler);
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
import { directoryImport } from 'directory-import';
|
||||
import type { Hono, Handler } from 'hono';
|
||||
import { serveStatic } from '@hono/node-server/serve-static';
|
||||
import * as path from 'node:path';
|
||||
|
||||
import index from '@/routes/index';
|
||||
import robotstxt from '@/routes/robots.txt';
|
||||
import test from '@/routes/test/router';
|
||||
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
type Root = {
|
||||
get: (routePath: string, filePath: string) => void;
|
||||
};
|
||||
|
||||
const routes: Record<string, (root: Root) => void> = {};
|
||||
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
routes.test = test;
|
||||
} else {
|
||||
const imports = directoryImport({
|
||||
targetDirectoryPath: path.join(__dirname, './routes'),
|
||||
importPattern: /router\.ts$/,
|
||||
});
|
||||
for (const path in imports) {
|
||||
const name = path.split('/').find(Boolean);
|
||||
if (name) {
|
||||
routes[name] = (
|
||||
imports[path] as {
|
||||
default: (root: Root) => void;
|
||||
}
|
||||
).default;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default function (app: Hono) {
|
||||
for (const name in routes) {
|
||||
const subApp = app.basePath(`/${name}`);
|
||||
routes[name]({
|
||||
get: (routePath, filePath) => {
|
||||
const wrapedHandler: Handler = async (ctx, ...args) => {
|
||||
if (!ctx.get('data')) {
|
||||
const { default: handler } = await import(path.join(__dirname, 'routes', name, filePath));
|
||||
await handler(ctx, ...args);
|
||||
}
|
||||
};
|
||||
subApp.get(routePath, wrapedHandler);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// routes without rss data
|
||||
app.get('/', index);
|
||||
app.get('/robots.txt', robotstxt);
|
||||
|
||||
app.use(
|
||||
'/*',
|
||||
serveStatic({
|
||||
root: './lib/assets',
|
||||
rewriteRequestPath: (path) => (path === '/favicon.ico' ? '/favicon.png' : path),
|
||||
})
|
||||
);
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
import type { Namespace, Route } from '@/types';
|
||||
import { directoryImport } from 'directory-import';
|
||||
import type { Hono, Handler } from 'hono';
|
||||
import * as path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { serveStatic } from '@hono/node-server/serve-static';
|
||||
|
||||
import index from '@/routes/index';
|
||||
import robotstxt from '@/routes/robots.txt';
|
||||
import { namespace as testNamespace } from './routes/test/namespace';
|
||||
import { route as testRoute } from '@/routes/test/index';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
let modules: Record<string, { route: Route } | { namespace: Namespace }> = {};
|
||||
let namespaces: Record<
|
||||
string,
|
||||
Namespace & {
|
||||
routes: Record<
|
||||
string,
|
||||
Route & {
|
||||
location: string;
|
||||
}
|
||||
>;
|
||||
}
|
||||
> = {};
|
||||
|
||||
switch (process.env.NODE_ENV) {
|
||||
case 'test':
|
||||
modules = {
|
||||
'/test/namespace.ts': {
|
||||
namespace: testNamespace,
|
||||
},
|
||||
'/test/index.ts': {
|
||||
route: testRoute,
|
||||
},
|
||||
};
|
||||
break;
|
||||
case 'production':
|
||||
// eslint-disable-next-line n/no-unpublished-require
|
||||
namespaces = require('../assets/build/routes.json');
|
||||
break;
|
||||
default:
|
||||
modules = directoryImport({
|
||||
targetDirectoryPath: path.join(__dirname, './routes'),
|
||||
importPattern: /\.ts$/,
|
||||
}) as typeof modules;
|
||||
}
|
||||
|
||||
if (Object.keys(modules).length) {
|
||||
for (const module in modules) {
|
||||
const content = modules[module] as
|
||||
| {
|
||||
route: Route;
|
||||
}
|
||||
| {
|
||||
namespace: Namespace;
|
||||
};
|
||||
const namespace = module.split('/')[1];
|
||||
if ('namespace' in content) {
|
||||
namespaces[namespace] = Object.assign(
|
||||
{
|
||||
routes: {},
|
||||
},
|
||||
namespaces[namespace],
|
||||
content.namespace
|
||||
);
|
||||
} else if ('route' in content) {
|
||||
if (!namespaces[namespace]) {
|
||||
namespaces[namespace] = {
|
||||
name: namespace,
|
||||
routes: {},
|
||||
};
|
||||
}
|
||||
if (Array.isArray(content.route.path)) {
|
||||
for (const path of content.route.path) {
|
||||
namespaces[namespace].routes[path] = {
|
||||
...content.route,
|
||||
location: module.split('/').slice(2).join('/'),
|
||||
};
|
||||
}
|
||||
} else {
|
||||
namespaces[namespace].routes[content.route.path] = {
|
||||
...content.route,
|
||||
location: module.split('/').slice(2).join('/'),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { namespaces };
|
||||
|
||||
export default function (app: Hono) {
|
||||
for (const namespace in namespaces) {
|
||||
const subApp = app.basePath(`/${namespace}`);
|
||||
for (const path in namespaces[namespace].routes) {
|
||||
const wrapedHandler: Handler = async (ctx) => {
|
||||
if (!ctx.get('data')) {
|
||||
if (typeof namespaces[namespace].routes[path].handler !== 'function') {
|
||||
const { route } = await import(`./routes/${namespace}/${namespaces[namespace].routes[path].location}`);
|
||||
namespaces[namespace].routes[path].handler = route.handler;
|
||||
}
|
||||
ctx.set('data', await namespaces[namespace].routes[path].handler(ctx));
|
||||
}
|
||||
};
|
||||
subApp.get(path, wrapedHandler);
|
||||
}
|
||||
}
|
||||
|
||||
// routes without rss data
|
||||
app.get('/', index);
|
||||
app.get('/robots.txt', robotstxt);
|
||||
|
||||
app.use(
|
||||
'/*',
|
||||
serveStatic({
|
||||
root: './lib/assets',
|
||||
rewriteRequestPath: (path) => (path === '/favicon.ico' ? '/favicon.png' : path),
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -1,10 +1,32 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
import timezone from '@/utils/timezone';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/:listId?',
|
||||
categories: ['shopping'],
|
||||
example: '/0818tuan',
|
||||
parameters: { listId: '活动分类,见下表,默认为 `1`' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '分类',
|
||||
maintainers: ['TonyRL'],
|
||||
handler,
|
||||
description: `| 最新线报 | 实测活动 | 优惠券 |
|
||||
| -------- | -------- | ------ |
|
||||
| 1 | 2 | 3 |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const baseUrl = 'http://www.0818tuan.com';
|
||||
const listId = ctx.req.param('listId') || '1';
|
||||
const url = `${baseUrl}/list-${listId}-0.html`;
|
||||
@@ -39,10 +61,10 @@ export default async (ctx) => {
|
||||
)
|
||||
);
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: $('head title').text(),
|
||||
link: url,
|
||||
image: 'http://www.0818tuan.com/favicon.ico',
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export default {
|
||||
'/:listId?': ['TonyRL'],
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '0818 团',
|
||||
url: '0818tuan.com',
|
||||
};
|
||||
@@ -1,13 +0,0 @@
|
||||
export default {
|
||||
'0818tuan.com': {
|
||||
_name: '0818 团',
|
||||
'.': [
|
||||
{
|
||||
title: '分类',
|
||||
docs: 'https://docs.rsshub.app/routes/shopping#0818-tuan',
|
||||
source: ['/:listId', '/'],
|
||||
target: (params) => `/0818tuan${params.listId ? '/' + params.listId.replace('list-', '').replace('-0.html', '') : ''}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
export default (router) => {
|
||||
router.get('/:listId?', './index');
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -49,7 +50,25 @@ function getStationInfo(stationName) {
|
||||
});
|
||||
}
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/:date/:from/:to/:type?',
|
||||
categories: ['travel'],
|
||||
example: '/12306/2022-02-19/重庆/永川东',
|
||||
parameters: { date: '时间,格式为(YYYY-MM-DD)', from: '始发站', to: '终点站', type: '售票类型,成人和学生可选,默认为成人' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '售票信息',
|
||||
maintainers: ['Fatpandac'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const date = ctx.req.param('date');
|
||||
const fromStationInfo = await getStationInfo(ctx.req.param('from'));
|
||||
const toStationInfo = await getStationInfo(ctx.req.param('to'));
|
||||
@@ -104,9 +123,9 @@ export default async (ctx) => {
|
||||
};
|
||||
});
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `${fromStationInfo.name} → ${toStationInfo.name} ${date}`,
|
||||
link: linkUrl,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
export default {
|
||||
'/:date/:from/:to/:type?': ['Fatpandac'],
|
||||
'/zxdt/:id?': ['LogicJake'],
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '12306',
|
||||
url: 'kyfw.12306.cn',
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
export default {
|
||||
'12306.cn': {
|
||||
_name: '12306',
|
||||
kyfw: [
|
||||
{
|
||||
title: '售票信息',
|
||||
docs: 'https://docs.rsshub.app/routes/travel#12306-shou-shu-piao-piao-xin-shen-xi',
|
||||
source: ['/', '/otn/leftTicket/init'],
|
||||
target: (params, url) => {
|
||||
const searchParams = new URL(url).searchParams;
|
||||
const from = searchParams.get('fs').split(',')[0];
|
||||
const to = searchParams.get('ts').split(',')[0];
|
||||
const date = searchParams.get('date');
|
||||
|
||||
return `/12306/${date}/${from}/${to}`;
|
||||
},
|
||||
},
|
||||
],
|
||||
www: [
|
||||
{
|
||||
title: '最新动态',
|
||||
docs: 'https://docs.rsshub.app/routes/travel#12306-zui-cuo-xin-dong-tai',
|
||||
source: ['/', '/mormhweb/1/:id/index_fl.html'],
|
||||
target: '/12306/zxdt/:id',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -1,4 +0,0 @@
|
||||
export default (router) => {
|
||||
router.get('/:date/:from/:to/:type?', './index');
|
||||
router.get('/zxdt/:id?', './zxdt');
|
||||
};
|
||||
@@ -1,9 +1,33 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
import * as url from 'node:url';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/zxdt/:id?',
|
||||
categories: ['travel'],
|
||||
example: '/12306/zxdt',
|
||||
parameters: { id: '铁路局id,可在 URL 中找到,不填默认显示所有铁路局动态' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['www.12306.cn/', 'www.12306.cn/mormhweb/1/:id/index_fl.html'],
|
||||
target: '/zxdt/:id',
|
||||
},
|
||||
name: '最新动态',
|
||||
maintainers: ['LogicJake'],
|
||||
handler,
|
||||
url: 'www.12306.cn/',
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id') || -1;
|
||||
|
||||
const link = id === -1 ? 'https://www.12306.cn/mormhweb/zxdt/index_zxdt.html' : `https://www.12306.cn/mormhweb/1/${id}/index_fl.html`;
|
||||
@@ -51,9 +75,9 @@ export default async (ctx) => {
|
||||
})
|
||||
);
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `${name}最新动态`,
|
||||
link,
|
||||
item: out,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -8,7 +9,14 @@ import { parseDate } from '@/utils/parse-date';
|
||||
import { art } from '@/utils/render';
|
||||
import * as path from 'node:path';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '*',
|
||||
name: 'Unknown',
|
||||
maintainers: [],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const rootUrl = 'https://www.141jav.com';
|
||||
const currentUrl = `${rootUrl}${getSubPath(ctx)}`;
|
||||
|
||||
@@ -67,9 +75,9 @@ export default async (ctx) => {
|
||||
};
|
||||
});
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `141JAV - ${$('title').text().split('-')[0].trim()}`,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export default {
|
||||
'/:type?/:keyword?': ['cgkings', 'nczitzk'],
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '141JAV',
|
||||
url: '141jav.com',
|
||||
description: `:::tip
|
||||
官方提供的订阅源不支持 BT 下载订阅,地址为 [https://141jav.com/feeds/](https://141jav.com/feeds/)
|
||||
:::`,
|
||||
};
|
||||
@@ -1,40 +0,0 @@
|
||||
export default {
|
||||
'141jav.com': {
|
||||
_name: '141JAV',
|
||||
'.': [
|
||||
{
|
||||
title: '今日种子',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#141jav',
|
||||
source: '/',
|
||||
target: (params, url, document) => {
|
||||
const today = document.querySelector('div.card.mb-1.card-overview').dataset.date.replaceAll('-', '');
|
||||
return `/141jav/day/${today}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '今日演员',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#141jav',
|
||||
source: '/',
|
||||
target: (params, url, document) => {
|
||||
const star = document.querySelector('div.card-content > div > a').getAttribute('href');
|
||||
return `/141jav${star}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '页面种子',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#141jav',
|
||||
source: ['/:type', '/:type/:key', '/:type/:key/:morekey'],
|
||||
target: (params, url, document) => {
|
||||
const itype = params.morekey === undefined ? params.type : params.type === 'tag' ? 'tag' : 'day';
|
||||
let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`;
|
||||
if (ikey === '' && itype === 'tag') {
|
||||
ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replaceAll('/', '%2F');
|
||||
} else if (ikey === '' && itype === 'actress') {
|
||||
ikey = document.querySelector('div.card > a').getAttribute('href').replace('/actress/', '');
|
||||
}
|
||||
return `/141jav/${itype}/${ikey}`;
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
export default (router) => {
|
||||
router.get('*', './index');
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -8,7 +9,14 @@ import { parseDate } from '@/utils/parse-date';
|
||||
import { art } from '@/utils/render';
|
||||
import * as path from 'node:path';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '*',
|
||||
name: 'Unknown',
|
||||
maintainers: [],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const rootUrl = 'https://www.141ppv.com';
|
||||
const currentUrl = `${rootUrl}${getSubPath(ctx)}`;
|
||||
|
||||
@@ -70,9 +78,9 @@ export default async (ctx) => {
|
||||
};
|
||||
});
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `141PPV - ${$('title').text().split('-')[0].trim()}`,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export default {
|
||||
'/:type?/:keyword?': ['cgkings', 'nczitzk'],
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '141PPV',
|
||||
url: '141ppv.com',
|
||||
description: `:::tip
|
||||
官方提供的订阅源不支持 BT 下载订阅,地址为 [https://141ppv.com/feeds/](https://141ppv.com/feeds/)
|
||||
:::`,
|
||||
};
|
||||
@@ -1,40 +0,0 @@
|
||||
export default {
|
||||
'141ppv.com': {
|
||||
_name: '141JAV',
|
||||
'.': [
|
||||
{
|
||||
title: '今日种子',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#141ppv',
|
||||
source: '/',
|
||||
target: (params, url, document) => {
|
||||
const today = document.querySelector('div.card.mb-1.card-overview').dataset.date.replaceAll('-', '');
|
||||
return `/141ppv/day/${today}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '今日演员',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#141ppv',
|
||||
source: '/',
|
||||
target: (params, url, document) => {
|
||||
const star = document.querySelector('div.card-content > div > a').getAttribute('href');
|
||||
return `/141ppv${star}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '页面种子',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#141ppv',
|
||||
source: ['/:type', '/:type/:key', '/:type/:key/:morekey'],
|
||||
target: (params, url, document) => {
|
||||
const itype = params.morekey === undefined ? params.type : params.type === 'tag' ? 'tag' : 'day';
|
||||
let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`;
|
||||
if (ikey === '' && itype === 'tag') {
|
||||
ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replaceAll('/', '%2F');
|
||||
} else if (ikey === '' && itype === 'actress') {
|
||||
ikey = document.querySelector('div.card > a').getAttribute('href').replace('/actress/', '');
|
||||
}
|
||||
return `/141ppv/${itype}/${ikey}`;
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
export default (router) => {
|
||||
router.get('*', './index');
|
||||
};
|
||||
+26
-4
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -8,7 +9,28 @@ import * as path from 'node:path';
|
||||
|
||||
const root_url = 'https://inf.ds.163.com';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/ds/:id',
|
||||
categories: ['game'],
|
||||
example: '/163/ds/63dfbaf4117741daaf73404601165843',
|
||||
parameters: { id: '用户ID' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['ds.163.com/user/:id'],
|
||||
},
|
||||
name: '用户发帖',
|
||||
maintainers: ['luyuhuang'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id');
|
||||
|
||||
const current_url = `${root_url}/v1/web/feed/basic/getSomeOneFeeds?feedTypes=1,2,3,4,6,7,10,11&someOneUid=${id}`;
|
||||
@@ -28,9 +50,9 @@ export default async (ctx) => {
|
||||
pubDate: parseDate(feed.updateTime),
|
||||
}));
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `${response.data.result.userInfos[0].user.nick} 的动态`,
|
||||
link: `https://ds.163.com/user/${id}`,
|
||||
item: list,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
+26
-4
@@ -1,10 +1,32 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
import timezone from '@/utils/timezone';
|
||||
import { parseDyArticle } from './utils';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/dy/:id',
|
||||
categories: ['new-media'],
|
||||
example: '/163/dy/W4983108759592548559',
|
||||
parameters: { id: '网易号 ID' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '更新',
|
||||
maintainers: ['HendricksZheng'],
|
||||
handler,
|
||||
description: `1. 在[网易号搜索页面](https://dy.163.com/v2/media/tosearch.html) 搜索想要订阅的网易号。
|
||||
2. 打开网易号的任意文章。
|
||||
3. 查看源代码,搜索 \`data-wemediaid\`,查看紧随其后的引号内的属性值(类似 \`W1966190042455428950\`)即为网易号 ID。`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id');
|
||||
|
||||
const response = await got(`https://dy.163.com/v2/article/list.do?pageNo=1&wemediaId=${id}&size=10`);
|
||||
@@ -20,11 +42,11 @@ export default async (ctx) => {
|
||||
|
||||
const items = await Promise.all(list.map((e) => parseDyArticle(charset, e, cache.tryGet)));
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `网易号 - ${list[0].author}`,
|
||||
link: items[0].feedLink,
|
||||
description: items[0].feedDescription,
|
||||
image: items[0].feedImage,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
+25
-4
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
@@ -6,7 +7,27 @@ import { parseDate } from '@/utils/parse-date';
|
||||
import timezone from '@/utils/timezone';
|
||||
import { parseDyArticle } from './utils';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/dy2/:id',
|
||||
categories: ['new-media'],
|
||||
example: '/163/dy2/T1555591616739',
|
||||
parameters: { id: 'id,该网易号主页网址最后一项html的文件名' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: true,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '网易号(通用)',
|
||||
maintainers: ['mjysci'],
|
||||
handler,
|
||||
description: `优先使用方法一,若是网易号搜索页面搜不到的小众网易号(文章页面不含\`data-wemediaid\`)则可使用此法。
|
||||
触发反爬会只抓取到标题,建议自建。`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id');
|
||||
const limit = ctx.req.query('limit') ?? 30;
|
||||
const url = `https://www.163.com/dy/media/${id}.html`;
|
||||
@@ -32,12 +53,12 @@ export default async (ctx) => {
|
||||
|
||||
const items = await Promise.all(list.map((item) => parseDyArticle(charset, item, cache.tryGet)));
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `${$('head title').text()} - 网易号`,
|
||||
link: url,
|
||||
description: $('.icon_line.desc').text(),
|
||||
image: $('.head_img').attr('src'),
|
||||
item: items,
|
||||
author: $('h2').text(),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -76,7 +77,46 @@ const ids = {
|
||||
},
|
||||
};
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/exclusive/:id?',
|
||||
categories: ['new-media'],
|
||||
example: '/163/exclusive/qsyk',
|
||||
parameters: { id: '栏目, 默认为首页' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['3g.163.com/touch/exclusive/sub/:id'],
|
||||
},
|
||||
name: '栏目',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
description: `| 分类 | 编号 |
|
||||
| -------- | ---- |
|
||||
| 首页 | |
|
||||
| 轻松一刻 | qsyk |
|
||||
| 槽值 | cz |
|
||||
| 人间 | rj |
|
||||
| 大国小民 | dgxm |
|
||||
| 三三有梗 | ssyg |
|
||||
| 数读 | sd |
|
||||
| 看客 | kk |
|
||||
| 下划线 | xhx |
|
||||
| 谈心社 | txs |
|
||||
| 哒哒 | dd |
|
||||
| 胖编怪聊 | pbgl |
|
||||
| 曲一刀 | qyd |
|
||||
| 今日之声 | jrzs |
|
||||
| 浪潮 | lc |
|
||||
| 沸点 | fd |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id') ?? '';
|
||||
|
||||
const rootUrl = 'https://3g.163.com';
|
||||
@@ -144,9 +184,9 @@ export default async (ctx) => {
|
||||
)
|
||||
);
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `网易独家 - ${ids[id].title}`,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
export default {
|
||||
'/exclusive/:id?': ['nczitzk'],
|
||||
'/ds/:id': ['luyuhuang'],
|
||||
'/dy/:id': ['HendricksZheng'],
|
||||
'/dy2/:id': ['mjysci'],
|
||||
|
||||
'/music/artist/:id': ['metowolf'],
|
||||
'/music/artist/songs/:id': ['ZhongMingKun'],
|
||||
'/music/djradio/:id': ['magic-akari'],
|
||||
'/music/playlist/:id': ['DIYgod'],
|
||||
'/music/user/events/:id': ['Master-Hash'],
|
||||
'/music/user/playlist/:uid': ['DIYgod'],
|
||||
'/music/user/playrecords/:uid/:type?': ['alfredcai'],
|
||||
|
||||
'/news/rank/:category?/:type?/:time?': ['nczitzk'],
|
||||
'/news/special/:type?': ['nczitzk'],
|
||||
'/open/vip': ['hoilc'],
|
||||
'/renjian/:category?': ['nczitzk'],
|
||||
'/today/:need_content?': ['nczitzk'],
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -5,7 +6,25 @@ import got from '@/utils/got';
|
||||
import { art } from '@/utils/render';
|
||||
import * as path from 'node:path';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/music/artist/songs/:id',
|
||||
categories: ['multimedia'],
|
||||
example: '/163/music/artist/songs/2116',
|
||||
parameters: { id: '歌手 id, 可在歌手详情页 URL 中找到' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '歌手歌曲',
|
||||
maintainers: ['ZhongMingKun'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id');
|
||||
|
||||
const { data } = await got(`https://music.163.com/api/v1/artist/songs`, {
|
||||
@@ -33,10 +52,10 @@ export default async (ctx) => {
|
||||
link: `https://music.163.com/#/song?id=${song.id}`,
|
||||
}));
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `${artist.name} - 歌手歌曲`,
|
||||
link: `https://music.163.com/#/artist?id=${id}`,
|
||||
description: `网易云音乐 - 歌手歌曲 - ${artist.name}`,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -5,7 +6,25 @@ import got from '@/utils/got';
|
||||
import { art } from '@/utils/render';
|
||||
import * as path from 'node:path';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/music/artist/:id',
|
||||
categories: ['multimedia'],
|
||||
example: '/163/music/artist/2116',
|
||||
parameters: { id: '歌手 id, 可在歌手详情页 URL 中找到' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '歌手专辑',
|
||||
maintainers: ['metowolf'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id');
|
||||
|
||||
const response = await got(`https://music.163.com/api/artist/albums/${id}`, {
|
||||
@@ -16,7 +35,7 @@ export default async (ctx) => {
|
||||
|
||||
const data = response.data;
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: data.artist.name,
|
||||
link: `https://music.163.com/#/artist/album?id=${id}`,
|
||||
description: `网易云音乐歌手专辑 - ${data.artist.name}`,
|
||||
@@ -38,5 +57,5 @@ export default async (ctx) => {
|
||||
author: singer,
|
||||
};
|
||||
}),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -6,7 +7,25 @@ import { parseDate } from '@/utils/parse-date';
|
||||
import { art } from '@/utils/render';
|
||||
import * as path from 'node:path';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/music/djradio/:id',
|
||||
categories: ['multimedia'],
|
||||
example: '/163/music/djradio/347317067',
|
||||
parameters: { id: '节目 id, 可在电台节目页 URL 中找到' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: true,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '电台节目',
|
||||
maintainers: ['magic-akari'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id');
|
||||
|
||||
const ProcessFeed = (limit, offset) =>
|
||||
@@ -65,7 +84,7 @@ export default async (ctx) => {
|
||||
})
|
||||
);
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: radio.name,
|
||||
link: `https://music.163.com/djradio?id=${id}`,
|
||||
subtitle: radio.desc,
|
||||
@@ -77,5 +96,5 @@ export default async (ctx) => {
|
||||
itunes_author: dj.nickname,
|
||||
itunes_category: radio.category,
|
||||
item: items.flat(),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export default {
|
||||
'/user/events/:id': ['Master-Hash'],
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -6,7 +7,25 @@ import { config } from '@/config';
|
||||
import { art } from '@/utils/render';
|
||||
import * as path from 'node:path';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/music/playlist/:id',
|
||||
categories: ['multimedia'],
|
||||
example: '/163/music/playlist/35798529',
|
||||
parameters: { id: '歌单 id, 可在歌单页 URL 中找到' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: true,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '歌单歌曲',
|
||||
maintainers: ['DIYgod'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
if (!config.ncm || !config.ncm.cookies) {
|
||||
throw new Error('163 Music RSS is disabled due to the lack of <a href="https://docs.rsshub.app/install/#pei-zhi-bu-fen-rss-mo-kuai-pei-zhi">relevant config</a>');
|
||||
}
|
||||
@@ -34,7 +53,7 @@ export default async (ctx) => {
|
||||
});
|
||||
const songs = songinfo.data.songs;
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: data.name,
|
||||
link: `https://music.163.com/#/playlist?id=${id}`,
|
||||
description: `网易云音乐歌单 - ${data.name}`,
|
||||
@@ -54,5 +73,5 @@ export default async (ctx) => {
|
||||
author: singer,
|
||||
};
|
||||
}),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -6,7 +7,14 @@ import got from '@/utils/got';
|
||||
import { art } from '@/utils/render';
|
||||
const renderDescription = (info) => art(path.join(__dirname, '../templates/music/userevents.art'), info);
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/music/user/events/:id',
|
||||
name: 'Unknown',
|
||||
maintainers: ['Master-Hash'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id');
|
||||
|
||||
const response = await got(`https://music.163.com/api/event/get/${id}`, {
|
||||
@@ -18,7 +26,7 @@ export default async (ctx) => {
|
||||
const { data } = response;
|
||||
const { nickname, signature, avatarUrl } = data.events[0].user;
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `${nickname}的云村动态`,
|
||||
link: `https://music.163.com/#/user/event?id=${id}`,
|
||||
description: `网易云音乐用户动态 - ${signature}`,
|
||||
@@ -51,5 +59,5 @@ export default async (ctx) => {
|
||||
comments: item.info.commentCount,
|
||||
};
|
||||
}),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -5,7 +6,25 @@ import got from '@/utils/got';
|
||||
import { art } from '@/utils/render';
|
||||
import * as path from 'node:path';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/music/user/playlist/:uid',
|
||||
categories: ['multimedia'],
|
||||
example: '/163/music/user/playlist/45441555',
|
||||
parameters: { uid: '用户 uid, 可在用户主页 URL 中找到' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '用户歌单',
|
||||
maintainers: ['DIYgod'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const uid = ctx.req.param('uid');
|
||||
|
||||
const response = await got.post('https://music.163.com/api/user/playlist', {
|
||||
@@ -25,7 +44,7 @@ export default async (ctx) => {
|
||||
|
||||
const { nickname, signature, avatarUrl } = creator;
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `${nickname} 的所有歌单`,
|
||||
link: `https://music.163.com/user/home?id=${uid}`,
|
||||
subtitle: signature,
|
||||
@@ -55,5 +74,5 @@ export default async (ctx) => {
|
||||
category: pl.tags,
|
||||
};
|
||||
}),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -40,7 +41,25 @@ function getItem(records) {
|
||||
});
|
||||
}
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/music/user/playrecords/:uid/:type?',
|
||||
categories: ['multimedia'],
|
||||
example: '/163/music/user/playrecords/45441555/1',
|
||||
parameters: { uid: '用户 uid, 可在用户主页 URL 中找到', type: '排行榜类型,0所有时间(默认),1最近一周' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '用户听歌排行',
|
||||
maintainers: ['alfredcai'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const uid = ctx.req.param('uid');
|
||||
const type = Number.parseInt(ctx.req.param('type')) || 0;
|
||||
|
||||
@@ -49,10 +68,10 @@ export default async (ctx) => {
|
||||
|
||||
const records = type === 1 ? response.data.weekData : response.data.allData;
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `${type === 1 ? '听歌榜单(最近一周)' : '听歌榜单(所有时间}'} - ${uid}}`,
|
||||
link: `https://music.163.com/user/home?id=${uid}`,
|
||||
updated: response.headers.date,
|
||||
item: getItem(records),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '网易公开课',
|
||||
url: '163.com',
|
||||
description: `:::tip
|
||||
部分歌单及听歌排行信息为登陆后可见,自建时将环境变量\`NCM_COOKIES\`设为登陆后的 Cookie 值,即可正常获取。
|
||||
:::`,
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
@@ -76,7 +77,42 @@ const timeRange = {
|
||||
},
|
||||
};
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/news/rank/:category?/:type?/:time?',
|
||||
categories: ['new-media'],
|
||||
example: '/163/news/rank/whole/click/day',
|
||||
parameters: {
|
||||
category: '新闻分类,参见下表,默认为“全站”',
|
||||
type: '排行榜类型,“点击榜”对应`click`,“跟贴榜”对应`follow`,默认为“点击榜”',
|
||||
time: '统计时间,“1小时”对应`hour`,“24小时”对应`day`,“本周”对应`week`,“本月”对应`month`,默认为“24小时”',
|
||||
},
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '排行榜',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
description: `:::tip
|
||||
全站新闻 **点击榜** 的统计时间仅包含 “24 小时”、“本周”、“本月”,不包含 “1 小时”。即可用的\`time\`参数为\`day\`、\`week\`、\`month\`。
|
||||
|
||||
其他分类 **点击榜** 的统计时间仅包含 “1 小时”、“24 小时”、“本周”。即可用的\`time\`参数为\`hour\`、\`day\`、\`week\`。
|
||||
|
||||
而所有分类(包括全站)的 **跟贴榜** 的统计时间皆仅包含 “24 小时”、“本周”、“本月”。即可用的\`time\`参数为\`day\`、\`week\`、\`month\`。
|
||||
:::
|
||||
|
||||
新闻分类:
|
||||
|
||||
| 全站 | 新闻 | 娱乐 | 体育 | 财经 | 科技 | 汽车 | 女人 | 房产 | 游戏 | 旅游 | 教育 |
|
||||
| ----- | ---- | ------------- | ------ | ----- | ---- | ---- | ---- | ----- | ---- | ------ | ---- |
|
||||
| whole | news | entertainment | sports | money | tech | auto | lady | house | game | travel | edu |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const category = ctx.req.param('category') || 'whole';
|
||||
const type = ctx.req.param('type') || 'click';
|
||||
const time = ctx.req.param('time') || 'day';
|
||||
@@ -148,9 +184,9 @@ export default async (ctx) => {
|
||||
)
|
||||
);
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `网易新闻${timeRange[time].title}${type === 'click' ? '点击' : '跟帖'}榜 - ${cfg.title}`,
|
||||
link: currentUrl,
|
||||
item: items.filter(Boolean),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
@@ -19,7 +20,28 @@ const typeMap = {
|
||||
14: '浪潮',
|
||||
15: '沸点',
|
||||
};
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/news/special/:type?',
|
||||
categories: ['new-media'],
|
||||
example: '/163/news/special/1',
|
||||
parameters: { type: '栏目' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '专栏',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
description: `| 轻松一刻 | 槽值 | 人间 | 大国小民 | 三三有梗 | 数读 | 看客 | 下划线 | 谈心社 | 哒哒 | 胖编怪聊 | 曲一刀 | 今日之声 | 浪潮 | 沸点 |
|
||||
| -------- | ---- | ---- | -------- | -------- | ---- | ---- | ------ | ------ | ---- | -------- | ------ | -------- | ---- | ---- |
|
||||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
if (!ctx.req.param('type')) {
|
||||
throw new Error('Bad parameter. See <a href="https://docs.rsshub.app/routes/game#wang-yi-da-shen">https://docs.rsshub.app/routes/game#wang-yi-da-shen</a>');
|
||||
}
|
||||
@@ -107,9 +129,9 @@ export default async (ctx) => {
|
||||
|
||||
const selectedTypeName = typeMap[selectedType];
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: selectedTypeName ? `${selectedTypeName} - 网易专栏` : '网易专栏',
|
||||
link: 'https://3g.163.com/touch/exclusive/?referFrom=163',
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -8,7 +9,29 @@ import { parseDate } from '@/utils/parse-date';
|
||||
import { art } from '@/utils/render';
|
||||
import * as path from 'node:path';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/open/vip',
|
||||
categories: ['study'],
|
||||
example: '/163/open/vip',
|
||||
parameters: {},
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['vip.open.163.com/'],
|
||||
},
|
||||
name: '精品课程',
|
||||
maintainers: ['hoilc'],
|
||||
handler,
|
||||
url: 'vip.open.163.com/',
|
||||
};
|
||||
|
||||
async function handler() {
|
||||
const url = 'https://vip.open.163.com';
|
||||
|
||||
const list_response = await got(url);
|
||||
@@ -59,9 +82,9 @@ export default async (ctx) => {
|
||||
)
|
||||
);
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: '网易公开课 - 精品课程',
|
||||
link: url,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
const dy2 = {
|
||||
title: '网易号(通用)',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#wang-yi-hao',
|
||||
source: ['/dy/media/:id', '/news/sub/:id'],
|
||||
target: (params) => `/163/dy2/${params.id.replace('.html', '')}`,
|
||||
};
|
||||
|
||||
export default {
|
||||
'163.com': {
|
||||
_name: '网易',
|
||||
'.': [dy2],
|
||||
'3g': [
|
||||
dy2,
|
||||
{
|
||||
title: '独家栏目',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#wang-yi-du-jia-lan-mu',
|
||||
source: ['/touch/exclusive/sub/:id'],
|
||||
target: '/163/exclusive/:id?',
|
||||
},
|
||||
],
|
||||
'c.m': [dy2],
|
||||
ds: [
|
||||
{
|
||||
title: '大神',
|
||||
docs: 'https://docs.rsshub.app/routes/game#wang-yi-da-shen',
|
||||
source: '/user/:id',
|
||||
target: '/163/ds/:id',
|
||||
},
|
||||
],
|
||||
m: [
|
||||
{
|
||||
title: '今日关注',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#wang-yi-xin-wen-jin-ri-guan-zhu',
|
||||
source: ['/'],
|
||||
target: '/163/today',
|
||||
},
|
||||
],
|
||||
music: [
|
||||
{
|
||||
title: '云音乐 - 用户歌单',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#wang-yi-yun-yin-yue',
|
||||
source: '/',
|
||||
target: (params, url) => {
|
||||
const id = new URL(url).hash.match(/home\?id=(.*)/)[1];
|
||||
return id ? `/163/music/user/playlist/${id}` : '';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '云音乐 - 歌单歌曲',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#wang-yi-yun-yin-yue',
|
||||
source: '/',
|
||||
target: (params, url) => {
|
||||
const id = new URL(url).hash.match(/playlist\?id=(.*)/)[1];
|
||||
return id ? `/163/music/playlist/${id}` : '';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '云音乐 - 歌手专辑',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#wang-yi-yun-yin-yue',
|
||||
source: '/',
|
||||
target: (params, url) => {
|
||||
const id = new URL(url).hash.match(/album\?id=(.*)/)[1];
|
||||
return id ? `/163/music/artist/${id}` : '';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '云音乐 - 歌手歌曲',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#wang-yi-yun-yin-yue',
|
||||
source: '/',
|
||||
target: (_params, url) => {
|
||||
const id = new URL(url).hash.match(/artist\?id=(.*)/)[1];
|
||||
return id ? `/163/music/artist/songs/${id}` : '';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '云音乐 - 电台节目',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#wang-yi-yun-yin-yue',
|
||||
source: '/',
|
||||
target: (params, url) => {
|
||||
const id = new URL(url).hash.match(/djradio\?id=(.*)/)[1];
|
||||
return id ? `/163/music/djradio/${id}` : '';
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '用户动态',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#wang-yi-yun-yin-yue-yong-hu-dong-tai',
|
||||
source: ['/'],
|
||||
target: (_, url) => {
|
||||
const id = new URL(url).hash.match(/event\?id=(.*)/)[1];
|
||||
return id ? `/163/music/user/events/${id}` : '';
|
||||
},
|
||||
},
|
||||
],
|
||||
news: [
|
||||
{
|
||||
title: '排行榜',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#wang-yi-xin-wen-pai-hang-bang',
|
||||
},
|
||||
],
|
||||
renjian: [
|
||||
{
|
||||
title: '人间',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#wang-yi-xin-wen-ren-jian',
|
||||
source: ['/:category', '/'],
|
||||
target: '/163/renjian/:category?',
|
||||
},
|
||||
],
|
||||
'vip.open': [
|
||||
{
|
||||
title: '公开课 精品课程',
|
||||
docs: 'https://docs.rsshub.app/routes/study#wang-yi-gong-kai-ke',
|
||||
source: ['/'],
|
||||
target: '/163/open/vip',
|
||||
},
|
||||
],
|
||||
'wp.m': [
|
||||
{
|
||||
title: '今日关注',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#wang-yi-xin-wen',
|
||||
source: ['/163/html/newsapp/todayFocus/index.html', '/'],
|
||||
target: '/163/today',
|
||||
},
|
||||
],
|
||||
'y.music': [
|
||||
{
|
||||
title: '云音乐 - 用户歌单',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#wang-yi-yun-yin-yue',
|
||||
source: '/m/user',
|
||||
target: (params, url) => `/163/music/user/playlist/${new URL(url).searchParams.get('id')}`,
|
||||
},
|
||||
{
|
||||
title: '云音乐 - 歌单歌曲',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#wang-yi-yun-yin-yue',
|
||||
source: '/m/playlist',
|
||||
target: (params, url) => `/163/music/playlist/${new URL(url).searchParams.get('id')}`,
|
||||
},
|
||||
{
|
||||
title: '云音乐 - 歌手专辑',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#wang-yi-yun-yin-yue',
|
||||
source: '/m/album',
|
||||
target: (params, url) => `/163/music/artist/${new URL(url).searchParams.get('id')}`,
|
||||
},
|
||||
{
|
||||
title: '云音乐 - 电台节目',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#wang-yi-yun-yin-yue',
|
||||
source: ['/m/radio', '/m/djradio'],
|
||||
target: (params, url) => `/163/music/djradio/${new URL(url).searchParams.get('id')}`,
|
||||
},
|
||||
{
|
||||
title: '用户动态',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#wang-yi-yun-yin-yue-yong-hu-dong-tai',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
@@ -13,7 +14,31 @@ const titles = {
|
||||
kanke: '看客',
|
||||
};
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/renjian/:category?',
|
||||
categories: ['new-media'],
|
||||
example: '/163/renjian/texie',
|
||||
parameters: { category: '分类,见下表,默认为特写' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['renjian.163.com/:category', 'renjian.163.com/'],
|
||||
},
|
||||
name: '人间',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
description: `| 特写 | 记事 | 大写 | 好读 | 看客 |
|
||||
| ----- | ----- | ----- | ----- | ----- |
|
||||
| texie | jishi | daxie | haodu | kanke |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const category = ctx.req.param('category') ?? 'texie';
|
||||
|
||||
const rootUrl = 'https://renjian.163.com';
|
||||
@@ -70,9 +95,9 @@ export default async (ctx) => {
|
||||
)
|
||||
);
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `人间 - ${titles[category]} - 网易新闻`,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
export default (router) => {
|
||||
router.get('/exclusive/:id?', './exclusive');
|
||||
router.get('/ds/:id', './ds');
|
||||
router.get('/dy/:id', './dy');
|
||||
router.get('/dy2/:id', './dy2');
|
||||
|
||||
router.get('/music/artist/:id', './music/artist');
|
||||
router.get('/music/artist/songs/:id', './music/artist-songs');
|
||||
router.get('/music/djradio/:id', './music/djradio');
|
||||
router.get('/music/playlist/:id', './music/playlist');
|
||||
router.get('/music/user/events/:id', './music/userevents');
|
||||
router.get('/music/user/playlist/:uid', './music/userplaylist');
|
||||
router.get('/music/user/playrecords/:uid/:type?', './music/userplayrecords');
|
||||
|
||||
router.get('/news/rank/:category?/:type?/:time?', './news/rank');
|
||||
router.get('/news/special/:type?', './news/special');
|
||||
router.get('/open/vip', './open/vip');
|
||||
router.get('/renjian/:category?', './renjian');
|
||||
router.get('/today/:need_content?', './today');
|
||||
};
|
||||
+31
-4
@@ -1,10 +1,37 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
import timezone from '@/utils/timezone';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/today/:need_content?',
|
||||
categories: ['new-media'],
|
||||
example: '/163/today',
|
||||
parameters: { need_content: '需要获取全文,填写 true/yes 表示需要,默认需要' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['wp.m.163.com/163/html/newsapp/todayFocus/index.html', 'wp.m.163.com/'],
|
||||
target: '/today',
|
||||
},
|
||||
name: '今日关注',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
url: 'wp.m.163.com/163/html/newsapp/todayFocus/index.html',
|
||||
description: `:::tip
|
||||
参数 **需要获取全文** 设置为 \`true\` \`yes\` \`t\` \`y\` 等值后,RSS 会携带该新闻条目的对应全文。
|
||||
:::`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const needContent = /t|y/i.test(ctx.req.param('need_content') ?? 'true');
|
||||
|
||||
const rootUrl = 'https://gw.m.163.com';
|
||||
@@ -48,9 +75,9 @@ export default async (ctx) => {
|
||||
);
|
||||
}
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: '今日关注 - 网易新闻',
|
||||
link: 'https://wp.m.163.com/163/html/newsapp/todayFocus/index.html',
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
@@ -5,7 +6,32 @@ import { parseDate } from '@/utils/parse-date';
|
||||
|
||||
import { defaultDomain, getRootUrl } from './utils';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/album/:id',
|
||||
categories: ['anime'],
|
||||
example: '/18comic/album/292282',
|
||||
parameters: { id: '专辑 id,可在专辑页 URL 中找到' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: true,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['jmcomic.group/'],
|
||||
},
|
||||
name: '专辑',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
url: 'jmcomic.group/',
|
||||
description: `:::tip
|
||||
专辑 id 不包括 URL 中标题的部分。
|
||||
:::`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id');
|
||||
const { domain = defaultDomain } = ctx.req.query();
|
||||
const rootUrl = getRootUrl(domain);
|
||||
@@ -70,10 +96,10 @@ export default async (ctx) => {
|
||||
)
|
||||
);
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: $('title').text(),
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
description: $('meta[property="og:description"]').attr('content'),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
@@ -5,7 +6,34 @@ import { parseDate } from '@/utils/parse-date';
|
||||
|
||||
import { defaultDomain, getRootUrl } from './utils';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/blogs/:category?',
|
||||
categories: ['anime'],
|
||||
example: '/18comic/blogs',
|
||||
parameters: { category: '分类,见下表,默认为空即全部' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: true,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['jmcomic.group/'],
|
||||
},
|
||||
name: '文庫',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
url: 'jmcomic.group/',
|
||||
description: `分类
|
||||
|
||||
| 全部 | 紳夜食堂 | 遊戲文庫 | JG GAMES | 模型山下 |
|
||||
| ---- | -------- | -------- | -------- | -------- |
|
||||
| | dinner | raiders | jg | figure |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const category = ctx.req.param('category') ?? '';
|
||||
const { domain = defaultDomain } = ctx.req.query();
|
||||
const rootUrl = getRootUrl(domain);
|
||||
@@ -56,12 +84,12 @@ export default async (ctx) => {
|
||||
)
|
||||
);
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: $('title')
|
||||
.text()
|
||||
.replace(/最新的/, $('.article-nav .active').text()),
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
description: $('meta[property="og:description"]').attr('content'),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,51 @@
|
||||
import { Route } from '@/types';
|
||||
import { defaultDomain, getRootUrl, ProcessItems } from './utils';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/:category?/:time?/:order?/:keyword?',
|
||||
categories: ['anime'],
|
||||
example: '/18comic',
|
||||
parameters: { category: '分类,见下表,默认为 `all` 即全部', time: '时间范围,见下表,默认为 `a` 即全部', order: '排列顺序,见下表,默认为 `mr` 即最新', keyword: '关键字,见下表,默认为空' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: true,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['jmcomic.group/'],
|
||||
},
|
||||
name: '成人 A 漫',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
url: 'jmcomic.group/',
|
||||
description: `分类
|
||||
|
||||
| 全部 | 其他漫畫 | 同人 | 韓漫 | 美漫 | 短篇 | 单本 |
|
||||
| ---- | -------- | ------ | ------ | ------ | ----- | ------ |
|
||||
| all | another | doujin | hanman | meiman | short | single |
|
||||
|
||||
时间范围
|
||||
|
||||
| 全部 | 今天 | 这周 | 本月 |
|
||||
| ---- | ---- | ---- | ---- |
|
||||
| a | t | w | m |
|
||||
|
||||
排列顺序
|
||||
|
||||
| 最新 | 最多点阅的 | 最多图片 | 最高评分 | 最多评论 | 最多爱心 |
|
||||
| ---- | ---------- | -------- | -------- | -------- | -------- |
|
||||
| mr | mv | mp | tr | md | tf |
|
||||
|
||||
关键字(供参考)
|
||||
|
||||
| YAOI | 女性向 | NTR | 非 H | 3D | 獵奇 |
|
||||
| ---- | ------ | --- | ---- | -- | ---- |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const category = ctx.req.param('category') ?? 'all';
|
||||
const keyword = ctx.req.param('keyword') ?? '';
|
||||
const time = ctx.req.param('time') ?? 'a';
|
||||
@@ -11,4 +56,4 @@ export default async (ctx) => {
|
||||
const currentUrl = `${rootUrl}/albums${category === 'all' ? '' : `/${category}`}${keyword ? `?screen=${keyword}` : '?'}${time === 'a' ? '' : `&t=${time}`}${order === 'mr' ? '' : `&o=${order}`}`;
|
||||
|
||||
ctx.set('data', await ProcessItems(ctx, currentUrl, rootUrl));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
export default {
|
||||
'/album/:id': ['nczitzk'],
|
||||
'/blogs/:category?': ['nczitzk'],
|
||||
'/search/:option?/:category?/:time?/:order?/:keyword?': ['nczitzk'],
|
||||
'/:category?/:time?/:order?/:keyword?': ['nczitzk'],
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '禁漫天堂',
|
||||
url: '18comic.org',
|
||||
description: `:::tip
|
||||
禁漫天堂有多个备用域名,本路由默认使用域名 \`https://jmcomic.me\`,若该域名无法访问,可以通过在路由最后加上 \`?domain=<域名>\` 指定路由访问的域名。如指定备用域名为 \`https://jmcomic1.me\`,则在所有禁漫天堂路由最后加上 \`?domain=jmcomic1.me\` 即可,此时路由为 [\`/18comic?domain=jmcomic1.me\`](https://rsshub.app/18comic?domain=jmcomic1.me)
|
||||
:::`,
|
||||
};
|
||||
@@ -1,41 +0,0 @@
|
||||
const _18comic = {
|
||||
_name: '禁漫天堂',
|
||||
'.': [
|
||||
{
|
||||
title: '成人 A 漫',
|
||||
docs: 'https://docs.rsshub.app/routes/anime#jin-man-tian-tang-cheng-ren-a-man',
|
||||
source: ['/'],
|
||||
target: '/18comic/:category?/:time?/:order?/:keyword?',
|
||||
},
|
||||
{
|
||||
title: '搜索',
|
||||
docs: 'https://docs.rsshub.app/routes/anime#jin-man-tian-tang-sou-suo',
|
||||
source: ['/'],
|
||||
target: '/18comic/search/:option?/:category?:keyword?/:time?/:order?',
|
||||
},
|
||||
{
|
||||
title: '专辑',
|
||||
docs: 'https://docs.rsshub.app/routes/anime#jin-man-tian-tang-zhuan-ji',
|
||||
source: ['/'],
|
||||
target: '/18comic/album/:id',
|
||||
},
|
||||
{
|
||||
title: '文庫',
|
||||
docs: 'https://docs.rsshub.app/routes/anime#jin-man-tian-tang-wen-ku',
|
||||
source: ['/'],
|
||||
target: '/18comic/blogs/:category?',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default {
|
||||
'18comic.org': _18comic,
|
||||
'18comic.vip': _18comic,
|
||||
//
|
||||
'jmcomic.me': _18comic,
|
||||
'jmcomic1.me': _18comic,
|
||||
//
|
||||
'jmcomic.rocks': _18comic,
|
||||
'jmcomic1.rocks': _18comic,
|
||||
'jmcomic.group': _18comic,
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
export default (router) => {
|
||||
router.get('/album/:id', './album');
|
||||
router.get('/blogs/:category?', './blogs');
|
||||
router.get('/search/:option?/:category?/:keyword?/:time?/:order?', './search');
|
||||
router.get('/:category?/:time?/:order?/:keyword?', './index');
|
||||
};
|
||||
@@ -1,6 +1,39 @@
|
||||
import { Route } from '@/types';
|
||||
import { defaultDomain, getRootUrl, ProcessItems } from './utils';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/search/:option?/:category?/:keyword?/:time?/:order?',
|
||||
categories: ['anime'],
|
||||
example: '/18comic/search/photos/all/NTR',
|
||||
parameters: {
|
||||
option: '选项,可选 `video` 和 `photos`,默认为 `photos`',
|
||||
category: '分类,同上表,默认为 `all` 即全部',
|
||||
keyword: '关键字,同上表,默认为空',
|
||||
time: '时间范围,同上表,默认为 `a` 即全部',
|
||||
order: '排列顺序,同上表,默认为 `mr` 即最新',
|
||||
},
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: true,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['jmcomic.group/'],
|
||||
target: '/:category?/:time?/:order?/:keyword?',
|
||||
},
|
||||
name: '搜索',
|
||||
maintainers: [],
|
||||
handler,
|
||||
url: 'jmcomic.group/',
|
||||
description: `:::tip
|
||||
关键字必须超过两个字,这是来自网站的限制。
|
||||
:::`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const option = ctx.req.param('option') ?? 'photos';
|
||||
const category = ctx.req.param('category') ?? 'all';
|
||||
const keyword = ctx.req.param('keyword') ?? '';
|
||||
@@ -12,4 +45,4 @@ export default async (ctx) => {
|
||||
const currentUrl = `${rootUrl}/search/${option}${category === 'all' ? '' : `/${category}`}${keyword ? `?search_query=${keyword}` : '?'}${time === 'a' ? '' : `&t=${time}`}${order === 'mr' ? '' : `&o=${order}`}`;
|
||||
|
||||
ctx.set('data', await ProcessItems(ctx, currentUrl, rootUrl));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
@@ -15,7 +16,40 @@ const setCookie = function (cookieName, cookieValue, seconds, path, domain, secu
|
||||
return [encodeURI(cookieName), '=', encodeURI(cookieValue), expires ? '; expires=' + expires.toGMTString() : '', path ? '; path=' + path : '/', domain ? '; domain=' + domain : '', secure ? '; secure' : ''].join('');
|
||||
};
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/:city?',
|
||||
categories: ['bbs'],
|
||||
example: '/19lou/jiaxing',
|
||||
parameters: { city: '分类,见下表,默认为 www,即杭州' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '头条',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
description: `| 杭州 | 台州 | 嘉兴 | 宁波 | 湖州 |
|
||||
| ---- | ------- | ------- | ------ | ------ |
|
||||
| www | taizhou | jiaxing | ningbo | huzhou |
|
||||
|
||||
| 绍兴 | 湖州 | 温州 | 金华 | 舟山 |
|
||||
| -------- | ------ | ------- | ------ | -------- |
|
||||
| shaoxing | huzhou | wenzhou | jinhua | zhoushan |
|
||||
|
||||
| 衢州 | 丽水 | 义乌 | 萧山 | 余杭 |
|
||||
| ------ | ------ | ---- | -------- | ------ |
|
||||
| quzhou | lishui | yiwu | xiaoshan | yuhang |
|
||||
|
||||
| 临安 | 富阳 | 桐庐 | 建德 | 淳安 |
|
||||
| ----- | ------ | ------ | ------ | ------ |
|
||||
| linan | fuyang | tonglu | jiande | chunan |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const city = ctx.req.param('city') ?? 'www';
|
||||
if (!isValidHost(city)) {
|
||||
throw new Error('Invalid city');
|
||||
@@ -71,9 +105,9 @@ export default async (ctx) => {
|
||||
)
|
||||
);
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: $('title').text().split('-')[0],
|
||||
link: rootUrl,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export default {
|
||||
'/:city?': ['nczitzk'],
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '19 楼',
|
||||
url: '19lou.com',
|
||||
};
|
||||
@@ -1,29 +0,0 @@
|
||||
export default {
|
||||
'19lou.com': {
|
||||
_name: '19 楼',
|
||||
'.': [
|
||||
{
|
||||
title: '头条',
|
||||
docs: 'https://docs.rsshub.app/routes/bbs#19-lou-tou-tiao',
|
||||
source: ['/'],
|
||||
target: (params, url) => `/19lou/${new URL(url).toString().match(/\/\/(.*?)\.19lou/)[1]}`,
|
||||
},
|
||||
],
|
||||
www: [
|
||||
{
|
||||
title: '头条',
|
||||
docs: 'https://docs.rsshub.app/routes/bbs#19-lou-tou-tiao',
|
||||
source: ['/'],
|
||||
target: '/19lou/www',
|
||||
},
|
||||
],
|
||||
jiaxing: [
|
||||
{
|
||||
title: '头条',
|
||||
docs: 'https://docs.rsshub.app/routes/bbs#19-lou-tou-tiao',
|
||||
source: ['/'],
|
||||
target: '/19lou/jiaxing',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
export default (router) => {
|
||||
router.get('/:city?', './index');
|
||||
};
|
||||
@@ -1,10 +1,42 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
import timezone from '@/utils/timezone';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/:path?',
|
||||
categories: ['multimedia'],
|
||||
example: '/1lou/search-繁花.htm',
|
||||
parameters: { path: '路径信息在URL里找到,主页为 index' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['1lou.me/:path'],
|
||||
target: '/:path',
|
||||
},
|
||||
name: '搜索',
|
||||
maintainers: ['falling'],
|
||||
handler,
|
||||
description: `:::tip
|
||||
将 1lou.me/ 后的内容作为参数传入到 path 即可
|
||||
|
||||
[www.1lou.me/search - 繁花.htm](http://www.1lou.me/search-繁花.htm) --> /1lou/search - 繁花.htm
|
||||
|
||||
[www.1lou.me/forum-1.htm](http://www.1lou.me/forum-1.htm) --> /1lou/forum-1.htm
|
||||
|
||||
[www.1lou.me/](http://www.1lou.me/) --> /1lou/
|
||||
:::`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const path = ctx.req.param('path') ?? '';
|
||||
const rootUrl = `https://www.1lou.me`;
|
||||
const currentUrl = `${rootUrl}/${path}`;
|
||||
@@ -46,9 +78,9 @@ export default async (ctx) => {
|
||||
})
|
||||
)
|
||||
);
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: '1Lou',
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export default {
|
||||
'/:path?': ['falling'],
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: 'BT 之家 1LOU 站',
|
||||
url: '1lou.me',
|
||||
};
|
||||
@@ -1,13 +0,0 @@
|
||||
export default {
|
||||
'1lou.me': {
|
||||
_name: 'BT之家 1LOU站',
|
||||
'.': [
|
||||
{
|
||||
title: '搜索',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#bt-zhi-jia-1lou-zhan',
|
||||
source: ['/:path'],
|
||||
target: '/1lou/:path',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
export default (router) => {
|
||||
router.get('/:path?', './index');
|
||||
};
|
||||
@@ -1,8 +1,33 @@
|
||||
import { Route } from '@/types';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/blog/:category?',
|
||||
categories: ['bbs'],
|
||||
example: '/1point3acres/blog',
|
||||
parameters: { category: '分类,见下表,可在对应分类页 URL 中找到' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['blog.1point3acres.com/:category'],
|
||||
},
|
||||
name: '博客',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
description: `| 留学申请 | 找工求职 | 生活攻略 | 投资理财 | 签证移民 | 时政要闻 |
|
||||
| ---------- | -------- | --------- | -------- | -------- | -------- |
|
||||
| studyinusa | career | lifestyle | invest | visa | news |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const categoryMap = {
|
||||
studyinusa: {
|
||||
title: '留学申请',
|
||||
@@ -59,9 +84,9 @@ export default async (ctx) => {
|
||||
};
|
||||
});
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `${category ? `${categoryMap[category].title} | ` : ''}美国留学就业生活攻略`,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,44 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import { rootUrl, apiRootUrl, types, ProcessThreads } from './utils';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/category/:id?/:type?/:order?',
|
||||
categories: ['bbs'],
|
||||
example: '/1point3acres/category/h1b',
|
||||
parameters: { id: '标签 id,默认为全部', type: '帖子分类, 见下表,默认为 hot,即热门帖子', order: '排序方式,见下表,默认为空,即最新回复' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['instant.1point3acres.com/section/:id', 'instant.1point3acres.com/'],
|
||||
},
|
||||
name: '标签',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
description: `:::tip
|
||||
更多标签可以在 [标签列表](https://instant.1point3acres.com/tags) 中找到。
|
||||
:::
|
||||
|
||||
分类
|
||||
|
||||
| 热门帖子 | 最新帖子 |
|
||||
| -------- | -------- |
|
||||
| hot | new |
|
||||
|
||||
排序方式
|
||||
|
||||
| 最新回复 | 最新发布 |
|
||||
| -------- | -------- |
|
||||
| | post |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id') ?? '';
|
||||
const type = ctx.req.param('type') ?? 'hot';
|
||||
const order = ctx.req.param('order') ?? '';
|
||||
@@ -10,9 +47,9 @@ export default async (ctx) => {
|
||||
const currentUrl = `${rootUrl}${id ? `/category/${id}` : ''}`;
|
||||
const apiUrl = `${apiRootUrl}/api${id ? `/tags/${id}/` : ''}threads?type=${type}&includes=tags,forum_name,summary&ps=${limit}&pg=1&order=${order === '' ? '' : 'time_desc'}&is_groupid=1`;
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `一亩三分地 - ${id}${types[type]}`,
|
||||
link: currentUrl,
|
||||
item: await ProcessThreads(cache.tryGet, apiUrl, order),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
export default {
|
||||
'/blog/:category?': ['nczitzk'],
|
||||
'/category/:id?/:type?/:order?': ['nczitzk'],
|
||||
'/offer/:year?/:major?/:school?': ['EthanWng97'],
|
||||
'/post/:type?/:order?': ['EthanWng97', 'DIYgod', 'nczitzk'],
|
||||
'/section/:id?/:type?/:order?': ['nczitzk'],
|
||||
'/user/:id/posts': ['Maecenas'],
|
||||
'/user/:id/threads': ['Maecenas'],
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '一亩三分地',
|
||||
url: 'blog.1point3acres.com',
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -6,7 +7,38 @@ import { art } from '@/utils/render';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
import * as path from 'node:path';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/offer/:year?/:major?/:school?',
|
||||
categories: ['bbs'],
|
||||
example: '/1point3acres/offer/12/null/CMU',
|
||||
parameters: { year: '录取年份 id,空为null', major: '录取专业 id,空为null', school: '录取学校 id,空为null' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['offer.1point3acres.com/'],
|
||||
target: '/offer',
|
||||
},
|
||||
name: '录取结果',
|
||||
maintainers: ['EthanWng97'],
|
||||
handler,
|
||||
url: 'offer.1point3acres.com/',
|
||||
description: `:::tip[三个 id 获取方式]
|
||||
1. 打开 [https://offer.1point3acres.com](https://offer.1point3acres.com)
|
||||
2. 打开控制台
|
||||
3. 切换到 Network 面板
|
||||
4. 点击 搜索 按钮
|
||||
5. 点击 results?ps=15\&pg=1 POST 请求
|
||||
6. 找到 Request Payload 请求参数,例如 \`filters: {planyr: "13", planmajor: "1", outname_w: "ACADIAU"}\` ,则三个 id 分别为: 13,1,ACADIAU
|
||||
:::`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
// year 2017-2022
|
||||
// 2017:6 2018:11 2019:12 2020:13 2021:14 2022:15
|
||||
// CS:1 MIS:2
|
||||
@@ -56,7 +88,7 @@ export default async (ctx) => {
|
||||
// },
|
||||
// });
|
||||
// const tid = responseBasic_1.data.background.tid;
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: '录取结果 - 一亩三分地',
|
||||
link: 'https://offer.1point3acres.com',
|
||||
item: data.map((item) => ({
|
||||
@@ -68,5 +100,5 @@ export default async (ctx) => {
|
||||
link: 'https://offer.1point3acres.com',
|
||||
guid: `1point3acres:offer:${year}:${major}:${school}:${item.id}`,
|
||||
})),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
export default {
|
||||
'1point3acres.com': {
|
||||
_name: '一亩三分地',
|
||||
blog: [
|
||||
{
|
||||
title: '博客',
|
||||
docs: 'https://docs.rsshub.app/routes/bbs#yi-mu-san-fen-di',
|
||||
source: ['/:category'],
|
||||
target: '/1point3acres/blog/:category?',
|
||||
},
|
||||
],
|
||||
instant: [
|
||||
{
|
||||
title: '帖子',
|
||||
docs: 'https://docs.rsshub.app/routes/bbs#yi-mu-san-fen-di',
|
||||
source: ['/'],
|
||||
target: '/1point3acres/thread/:type?/:order?',
|
||||
},
|
||||
{
|
||||
title: '分区',
|
||||
docs: 'https://docs.rsshub.app/routes/bbs#yi-mu-san-fen-di',
|
||||
source: ['/section/:id', '/'],
|
||||
target: '/1point3acres/section/:id?/:type?/:order?',
|
||||
},
|
||||
{
|
||||
title: '标签',
|
||||
docs: 'https://docs.rsshub.app/routes/bbs#yi-mu-san-fen-di',
|
||||
source: ['/section/:id', '/'],
|
||||
target: '/1point3acres/category/:id?/:type?/:order?',
|
||||
},
|
||||
{
|
||||
title: '用户主题帖',
|
||||
docs: 'https://docs.rsshub.app/routes/bbs#yi-mu-san-fen-di',
|
||||
source: ['/profile/:id', '/'],
|
||||
target: '/1point3acres/user/:id/threads',
|
||||
},
|
||||
{
|
||||
title: '用户回帖',
|
||||
docs: 'https://docs.rsshub.app/routes/bbs#yi-mu-san-fen-di',
|
||||
source: ['/profile/:id', '/'],
|
||||
target: '/1point3acres/user/:id/posts',
|
||||
},
|
||||
],
|
||||
offer: [
|
||||
{
|
||||
title: '录取结果',
|
||||
docs: 'https://docs.rsshub.app/routes/bbs#yi-mu-san-fen-di',
|
||||
source: ['/'],
|
||||
target: '/1point3acres/offer',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -1,10 +0,0 @@
|
||||
export default (router) => {
|
||||
router.get('/blog/:category?', './blog');
|
||||
router.get('/category/:id?/:type?/:order?', './category');
|
||||
router.get('/offer/:year?/:major?/:school?', './offer');
|
||||
router.get('/post/:type?/:order?', './thread');
|
||||
router.get('/section/:id?/:type?/:order?', './section');
|
||||
router.get('/thread/:type?/:order?', './thread');
|
||||
router.get('/user/:id/posts', './user/post');
|
||||
router.get('/user/:id/threads', './user/thread');
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import { rootUrl, apiRootUrl, types, ProcessThreads } from './utils';
|
||||
|
||||
@@ -12,7 +13,52 @@ const sections = {
|
||||
265: '签证移民',
|
||||
};
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/section/:id?/:type?/:order?',
|
||||
categories: ['bbs'],
|
||||
example: '/1point3acres/section/345',
|
||||
parameters: { id: '分区 id,见下表,默认为全部', type: '帖子分类, 见下表,默认为 hot,即热门帖子', order: '排序方式,见下表,默认为空,即最新回复' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['instant.1point3acres.com/section/:id', 'instant.1point3acres.com/'],
|
||||
},
|
||||
name: '分区',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
description: `分区
|
||||
|
||||
| 分区 | id |
|
||||
| -------- | --- |
|
||||
| 留学申请 | 257 |
|
||||
| 世界公民 | 379 |
|
||||
| 投资理财 | 400 |
|
||||
| 生活干货 | 31 |
|
||||
| 职场达人 | 345 |
|
||||
| 人际关系 | 391 |
|
||||
| 海外求职 | 38 |
|
||||
| 签证移民 | 265 |
|
||||
|
||||
分类
|
||||
|
||||
| 热门帖子 | 最新帖子 |
|
||||
| -------- | -------- |
|
||||
| hot | new |
|
||||
|
||||
排序方式
|
||||
|
||||
| 最新回复 | 最新发布 |
|
||||
| -------- | -------- |
|
||||
| | post |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id') ?? '';
|
||||
const type = ctx.req.param('type') ?? 'hot';
|
||||
const order = ctx.req.param('order') ?? '';
|
||||
@@ -21,9 +67,9 @@ export default async (ctx) => {
|
||||
const currentUrl = `${rootUrl}${id ? (isNaN(id) ? `/category/${id}` : `/section/${id}`) : ''}`;
|
||||
const apiUrl = `${apiRootUrl}/api${id ? (isNaN(id) ? `/tags/${id}/` : `/forums/${id}/`) : ''}threads?type=${type}&includes=tags,forum_name,summary&ps=${limit}&pg=1&order=${order === '' ? '' : 'time_desc'}&is_groupid=1`;
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `一亩三分地 - ${Object.hasOwn(sections, id) ? sections[id] : id}${types[type]}`,
|
||||
link: currentUrl,
|
||||
item: await ProcessThreads(cache.tryGet, apiUrl, order),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,16 +1,36 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import { rootUrl, apiRootUrl, types, ProcessThreads } from './utils';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: ['/post/:type?/:order?', '/thread/:type?/:order?'],
|
||||
name: 'Unknown',
|
||||
maintainers: ['EthanWng97', 'DIYgod', 'nczitzk'],
|
||||
handler,
|
||||
url: 'instant.1point3acres.com/',
|
||||
description: `分类
|
||||
|
||||
| 热门帖子 | 最新帖子 |
|
||||
| -------- | -------- |
|
||||
| hot | new |
|
||||
|
||||
排序方式
|
||||
|
||||
| 最新回复 | 最新发布 |
|
||||
| -------- | -------- |
|
||||
| | post |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const type = ctx.req.param('type') ?? 'hot';
|
||||
const order = ctx.req.param('order') ?? '';
|
||||
const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 10;
|
||||
|
||||
const apiUrl = `${apiRootUrl}/api/threads?type=${type}&includes=tags,forum_name,summary&ps=${limit}&pg=1&order=${order === '' ? '' : 'time_desc'}&is_groupid=1`;
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `一亩三分地 - ${types[type]}`,
|
||||
link: rootUrl,
|
||||
item: await ProcessThreads(cache.tryGet, apiUrl, order),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,12 +1,34 @@
|
||||
import { Route } from '@/types';
|
||||
import got from '@/utils/got';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/user/:id/posts',
|
||||
categories: ['bbs'],
|
||||
example: '/1point3acres/user/1/posts',
|
||||
parameters: { id: '用户 id,可在 Instant 版网站的个人主页 URL 找到' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['instant.1point3acres.com/profile/:id', 'instant.1point3acres.com/'],
|
||||
},
|
||||
name: '用户回帖',
|
||||
maintainers: ['Maecenas'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id');
|
||||
|
||||
const { posts } = (await got.get(`https://instant.1point3acres.com/v2/api/user/post?pg=1&ps=10&user_id=${id}`)).data;
|
||||
const [{ author_name: author }] = posts;
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `${author}的回复 - 一亩三分地`,
|
||||
link: `https://instant.1point3acres.com/profile/${id}`,
|
||||
description: `${author}的回复 - 一亩三分地`,
|
||||
@@ -17,5 +39,5 @@ export default async (ctx) => {
|
||||
pubDate: new Date(item.create_time + ' GMT+8').toUTCString(),
|
||||
link: `https://instant.1point3acres.com/thread/${item.thread_id}/post/${item.id}`,
|
||||
})),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,12 +1,34 @@
|
||||
import { Route } from '@/types';
|
||||
import got from '@/utils/got';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/user/:id/threads',
|
||||
categories: ['bbs'],
|
||||
example: '/1point3acres/user/1/threads',
|
||||
parameters: { id: '用户 id,可在 Instant 版网站的个人主页 URL 找到' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['instant.1point3acres.com/profile/:id', 'instant.1point3acres.com/'],
|
||||
},
|
||||
name: '用户主题帖',
|
||||
maintainers: ['Maecenas'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id');
|
||||
|
||||
const { threads } = (await got.get(`https://instant.1point3acres.com/v2/api/user/thread?pg=1&ps=10&user_id=${id}`)).data;
|
||||
const [{ author_name: author }] = threads;
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `${author}的主题帖 - 一亩三分地`,
|
||||
link: `https://instant.1point3acres.com/profile/${id}`,
|
||||
description: `${author}的主题帖 - 一亩三分地`,
|
||||
@@ -17,5 +39,5 @@ export default async (ctx) => {
|
||||
pubDate: new Date(item.update_time + ' GMT+8').toUTCString(),
|
||||
link: `https://instant.1point3acres.com/thread/${item.id}`,
|
||||
})),
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getCurrentPath } from '@/utils/helpers';
|
||||
const __dirname = getCurrentPath(import.meta.url);
|
||||
|
||||
@@ -9,7 +10,60 @@ import { parseDate } from '@/utils/parse-date';
|
||||
import { art } from '@/utils/render';
|
||||
import * as path from 'node:path';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/:id?',
|
||||
categories: ['multimedia'],
|
||||
example: '/2048/2',
|
||||
parameters: { id: '板块 ID, 见下表,默认为最新合集,即 `3`,亦可在 URL 中找到, 例如, `thread.php?fid-3.html`中, 板块 ID 为`3`' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: true,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
name: '论坛',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
description: `| 最新合集 | 亞洲無碼 | 日本騎兵 | 歐美新片 | 國內原創 | 中字原創 | 三級寫真 |
|
||||
| -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| 3 | 4 | 5 | 13 | 15 | 16 | 18 |
|
||||
|
||||
| 有碼.HD | 亞洲 SM.HD | 日韓 VR/3D | 歐美 VR/3D | S-cute / Mywife / G-area |
|
||||
| ------- | ---------- | ---------- | ---------- | ------------------------ |
|
||||
| 116 | 114 | 96 | 97 | 119 |
|
||||
|
||||
| 網友自拍 | 亞洲激情 | 歐美激情 | 露出偷窺 | 高跟絲襪 | 卡通漫畫 | 原創达人 |
|
||||
| -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| 23 | 24 | 25 | 26 | 27 | 28 | 135 |
|
||||
|
||||
| 唯美清純 | 网络正妹 | 亞洲正妹 | 素人正妹 | COSPLAY | 女优情报 | Gif 动图 |
|
||||
| -------- | -------- | -------- | -------- | ------- | -------- | -------- |
|
||||
| 21 | 274 | 276 | 277 | 278 | 29 | |
|
||||
|
||||
| 獨家拍攝 | 稀有首發 | 网络见闻 | 主播實錄 | 珍稀套圖 | 名站同步 | 实用漫画 |
|
||||
| -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| 213 | 94 | 283 | 111 | 88 | 131 | 180 |
|
||||
|
||||
| 网盘二区 | 网盘三区 | 分享福利 | 国产精选 | 高清福利 | 高清首发 | 多挂原创 |
|
||||
| -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| 72 | 272 | 195 | 280 | 79 | 216 | 76 |
|
||||
|
||||
| 磁链迅雷 | 正片大片 | H-GAME | 有声小说 | 在线视频 | 在线快播影院 |
|
||||
| -------- | -------- | ------ | -------- | -------- | ------------ |
|
||||
| 43 | 67 | 66 | 55 | 78 | 279 |
|
||||
|
||||
| 综合小说 | 人妻意淫 | 乱伦迷情 | 长篇连载 | 文学作者 | TXT 小说打包 |
|
||||
| -------- | -------- | -------- | -------- | -------- | ------------ |
|
||||
| 48 | 103 | 50 | 54 | 100 | 109 |
|
||||
|
||||
| 聚友客栈 | 坛友自售 |
|
||||
| -------- | -------- |
|
||||
| 57 | 136 |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const id = ctx.req.param('id') ?? '2';
|
||||
|
||||
const rootUrl = 'https://hjd2048.com';
|
||||
@@ -108,9 +162,9 @@ export default async (ctx) => {
|
||||
)
|
||||
);
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `${$('#main #breadCrumb a').last().text()} - 2048核基地`,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export default {
|
||||
'/:id?': ['nczitzk'],
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '2048 核基地',
|
||||
url: 'hjd2048.com',
|
||||
};
|
||||
@@ -1,13 +0,0 @@
|
||||
export default {
|
||||
'hjd2048.com': {
|
||||
_name: '2048 核基地',
|
||||
'.': [
|
||||
{
|
||||
title: '论坛',
|
||||
docs: 'https://docs.rsshub.app/routes/multimedia#2048-he-ji-di',
|
||||
source: ['/2048/thread.php?fid-3.html'],
|
||||
target: (_, url) => `/2048/${url.match(/fid-(\d+?)\.html/)[1]}`,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
export default (router) => {
|
||||
router.get('/:id?', './index');
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
@@ -7,7 +8,14 @@ import iconv from 'iconv-lite';
|
||||
|
||||
// http://www.2cycd.com/forum.php?mod=forumdisplay&fid=43&orderby=dateline
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/:fid/:sort?',
|
||||
name: 'Unknown',
|
||||
maintainers: ['shelken'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const fid = ctx.req.param('fid') ?? '43';
|
||||
const sort = ctx.req.param('sort') ?? 'dateline';
|
||||
|
||||
@@ -50,9 +58,9 @@ export default async (ctx) => {
|
||||
})
|
||||
)
|
||||
);
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: $('title').text(),
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export default {
|
||||
'/:fid/:sort?': ['shelken'],
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '二次元虫洞',
|
||||
url: '2cycd.com',
|
||||
};
|
||||
@@ -1,25 +0,0 @@
|
||||
export default {
|
||||
'2cycd.com': {
|
||||
_name: '二次元虫洞',
|
||||
'.': [
|
||||
{
|
||||
title: '板块',
|
||||
docs: 'https://docs.rsshub.app/routes/bbs#er-ci-yuan-chong-dong',
|
||||
source: '/:path',
|
||||
target: (params, url) => {
|
||||
let pid, sort;
|
||||
const static_matched = params.path.match(/forum-(\d+)-\d+.html/);
|
||||
if (static_matched) {
|
||||
pid = static_matched[1];
|
||||
} else if (params.path === 'forum.php') {
|
||||
pid = new URL(url).searchParams.get('fid');
|
||||
sort = new URL(url).searchParams.get('orderby');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return `/2cycd/${pid}/${sort ?? 'dateline'}`;
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
export default (router) => {
|
||||
router.get('/:fid/:sort?', './index');
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
@@ -23,7 +24,32 @@ const categories = {
|
||||
},
|
||||
};
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/hot-list/:category?',
|
||||
categories: ['new-media'],
|
||||
example: '/36kr/hot-list',
|
||||
parameters: { category: '分类,默认为24小时热榜' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['36kr.com/hot-list/:category', '36kr.com/'],
|
||||
target: '/hot-list/:category',
|
||||
},
|
||||
name: '资讯热榜',
|
||||
maintainers: ['nczitzk'],
|
||||
handler,
|
||||
description: `| 24 小时热榜 | 资讯人气榜 | 资讯综合榜 | 资讯收藏榜 |
|
||||
| ----------- | ---------- | ---------- | ---------- |
|
||||
| 24 | renqi | zonghe | shoucang |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const category = ctx.req.param('category') ?? '24';
|
||||
|
||||
const currentUrl = category === '24' ? rootUrl : `${rootUrl}/hot-list/catalog`;
|
||||
@@ -52,9 +78,9 @@ export default async (ctx) => {
|
||||
|
||||
items = await Promise.all(items.map((item) => ProcessItem(item, cache.tryGet)));
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `36氪 - ${categories[category].title}`,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import { getSubPath } from '@/utils/common-utils';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
@@ -15,7 +16,14 @@ const shortcuts = {
|
||||
'/information/workplace': '/information/web_zhichang',
|
||||
};
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '*',
|
||||
name: 'Unknown',
|
||||
maintainers: [],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const path = getSubPath(ctx)
|
||||
.replace(/^\/news(?!flashes)/, '/information')
|
||||
.replace(/\/search\/article/, '/search/articles');
|
||||
@@ -49,9 +57,9 @@ export default async (ctx) => {
|
||||
items = await Promise.all(items.map((item) => ProcessItem(item, cache.tryGet)));
|
||||
}
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: `36氪 - ${$('title').text().split('_')[0]}`,
|
||||
link: currentUrl,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
export default {
|
||||
'/hot-list/:category?': ['nczitzk'],
|
||||
'/information/:category?': ['nczitzk'],
|
||||
'/motif/:id': ['nczitzk'],
|
||||
'/newsflashes': ['hillerliao', 'nczitzk'],
|
||||
'/search/articles/:keyword': ['xyqfer', 'kt286', 'nczitzk'],
|
||||
'/search/newsflashes/:keyword': ['nczitzk'],
|
||||
'/topics/:id': ['nczitzk'],
|
||||
'/user/:id': ['nczitzk'],
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '36kr',
|
||||
url: '36kr.com',
|
||||
};
|
||||
@@ -1,55 +0,0 @@
|
||||
export default {
|
||||
'36kr.com': {
|
||||
_name: '36氪',
|
||||
'.': [
|
||||
{
|
||||
title: '资讯',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#36kr-zi-xun',
|
||||
source: ['/information/:category', '/'],
|
||||
target: '/36kr/information/:category',
|
||||
},
|
||||
{
|
||||
title: '快讯',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#36kr-kuai-xun',
|
||||
source: ['/newsflashes', '/'],
|
||||
target: '/36kr/newsflashes',
|
||||
},
|
||||
{
|
||||
title: '用户文章',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#36kr-yong-hu-wen-zhang',
|
||||
source: ['/user/:id', '/'],
|
||||
target: '/36kr/user/:id',
|
||||
},
|
||||
{
|
||||
title: '主题文章',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#36kr-zhu-ti-wen-zhang',
|
||||
source: ['/motif/:id', '/'],
|
||||
target: '/36kr/motif/:id',
|
||||
},
|
||||
{
|
||||
title: '专题文章',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#36kr-zhuan-ti-wen-zhang',
|
||||
source: ['/topics/:id', '/'],
|
||||
target: '/36kr/topics/:id',
|
||||
},
|
||||
{
|
||||
title: '搜索文章',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#36kr-sou-suo-wen-zhang',
|
||||
source: ['/search/articles/:keyword', '/'],
|
||||
target: '/36kr/search/articles/:keyword',
|
||||
},
|
||||
{
|
||||
title: '搜索快讯',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#36kr-sou-suo-kuai-xun',
|
||||
source: ['/search/newsflashes/:keyword', '/'],
|
||||
target: '/36kr/search/newsflashes/:keyword',
|
||||
},
|
||||
{
|
||||
title: '资讯热榜',
|
||||
docs: 'https://docs.rsshub.app/routes/new-media#36kr-zi-xun-re-bang',
|
||||
source: ['/hot-list/:category', '/'],
|
||||
target: '/36kr/hot-list/:category',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
@@ -1,4 +0,0 @@
|
||||
export default (router) => {
|
||||
router.get('/hot-list/:category?', './hot-list');
|
||||
router.get('*', './index');
|
||||
};
|
||||
@@ -1,10 +1,21 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
import { parseDate } from '@/utils/parse-date';
|
||||
import { parseArticle } from './utils';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/:name/:type?',
|
||||
radar: {
|
||||
source: ['3dmgame.com/games/:name/:type'],
|
||||
},
|
||||
name: 'Unknown',
|
||||
maintainers: ['sinchang', 'jacky2001114', 'HenryQW'],
|
||||
handler,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const { name, type = 'news' } = ctx.req.param();
|
||||
const url = `https://www.3dmgame.com/games/${name}/${type}/`;
|
||||
|
||||
@@ -26,10 +37,10 @@ export default async (ctx) => {
|
||||
|
||||
const items = await Promise.all(list.map((item) => parseArticle(item, cache.tryGet)));
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: $('head title').text().split('_')[0],
|
||||
description: $('head meta[name="Description"]').attr('content'),
|
||||
link: url,
|
||||
item: items,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
export default {
|
||||
'/news/:category?': ['zhboner'],
|
||||
'/:name/:type?': ['sinchang', 'jacky2001114', 'HenryQW'],
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { Namespace } from '@/types';
|
||||
|
||||
export const namespace: Namespace = {
|
||||
name: '3DMGame',
|
||||
url: '3dmgame.com',
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Route } from '@/types';
|
||||
import cache from '@/utils/cache';
|
||||
import got from '@/utils/got';
|
||||
import { load } from 'cheerio';
|
||||
@@ -5,7 +6,31 @@ import { parseDate } from '@/utils/parse-date';
|
||||
import timezone from '@/utils/timezone';
|
||||
import { parseArticle } from './utils';
|
||||
|
||||
export default async (ctx) => {
|
||||
export const route: Route = {
|
||||
path: '/news/:category?',
|
||||
categories: ['game'],
|
||||
example: '/3dmgame/news',
|
||||
parameters: { category: '分类名或 ID,见下表,默认为新闻推荐,ID 可从分类 URL 中找到,如 Steam 为 `22221`' },
|
||||
features: {
|
||||
requireConfig: false,
|
||||
requirePuppeteer: false,
|
||||
antiCrawler: false,
|
||||
supportBT: false,
|
||||
supportPodcast: false,
|
||||
supportScihub: false,
|
||||
},
|
||||
radar: {
|
||||
source: ['3dmgame.com/news/:category?', '3dmgame.com/news'],
|
||||
},
|
||||
name: '新闻中心',
|
||||
maintainers: ['zhboner'],
|
||||
handler,
|
||||
description: `| 新闻推荐 | 游戏新闻 | 动漫影视 | 智能数码 | 时事焦点 |
|
||||
| -------- | -------- | -------- | -------- | ----------- |
|
||||
| | game | acg | next | news\_36\_1 |`,
|
||||
};
|
||||
|
||||
async function handler(ctx) {
|
||||
const { category = '' } = ctx.req.param();
|
||||
const isArcPost = category && !isNaN(category); // https://www.3dmgame.com/news/\d+/
|
||||
const url = `https://www.3dmgame.com/${category && category !== 'news_36_1' ? 'news/' : ''}${category ?? 'news'}/`;
|
||||
@@ -34,10 +59,10 @@ export default async (ctx) => {
|
||||
|
||||
const out = await Promise.all(list.map((item) => parseArticle(item, cache.tryGet)));
|
||||
|
||||
ctx.set('data', {
|
||||
return {
|
||||
title: '3DM - ' + $('title').text().split('_')[0],
|
||||
description: $('meta[name="Description"]').attr('content'),
|
||||
link: url,
|
||||
item: out,
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user