feat(route): add several popular routes

This commit is contained in:
pseudoyu
2024-10-25 11:42:39 +08:00
parent 92ea6af0a1
commit 2c46c71d44
15 changed files with 160 additions and 39 deletions
+3 -2
View File
@@ -1,10 +1,11 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
export const route: Route = {
path: '/:id',
categories: ['multimedia'],
categories: ['multimedia', 'popular'],
view: ViewType.Audios,
example: '/ajmide/10603594',
parameters: { id: '播客 id,可以从播客页面 URL 中找到' },
features: {
+3 -2
View File
@@ -1,4 +1,4 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import cache from '@/utils/cache';
import { load } from 'cheerio';
import got from '@/utils/got';
@@ -7,7 +7,8 @@ import timezone from '@/utils/timezone';
export const route: Route = {
path: '/apod',
categories: ['picture'],
categories: ['picture', 'popular'],
view: ViewType.Pictures,
example: '/bjp/apod',
parameters: {},
features: {
+72 -8
View File
@@ -1,18 +1,82 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
import { config } from '@/config';
export const route: Route = {
path: '/search/:type?/:caty?/:period?/:order?/:rating?/:keyword?',
categories: ['picture'],
categories: ['picture', 'popular'],
view: ViewType.Pictures,
example: '/fantia/search/posts/all/daily',
parameters: {
type: 'Type, see the table below, `posts` by default',
caty: 'Category, see the table below, can also be found in search page URL, `すべてのクリエイター` by default',
period: 'Ranking period, see the table below, empty by default',
order: 'Sorting, see the table below, `更新の新しい順` by default',
rating: 'Rating, see the table below, `すべて` by default',
type: {
description: 'Type, see the table below, `posts` by default',
options: [
{ value: 'fanclubs', label: 'クリエイター' },
{ value: 'posts', label: '投稿' },
{ value: 'products', label: '商品' },
{ value: 'commissions', label: 'コミッション' },
],
default: 'posts',
},
caty: {
description: 'Category, see the table below, can also be found in search page URL, `すべてのクリエイター` by default',
options: [
{ value: 'all', label: 'すべてのクリエイター' },
{ value: 'illust', label: 'イラスト' },
{ value: 'comic', label: '漫画' },
{ value: 'cosplay', label: 'コスプレ' },
{ value: 'youtuber', label: 'YouTuber・配信者' },
{ value: 'vtuber', label: 'Vtuber' },
{ value: 'voice', label: '音声作品・ASMR' },
{ value: 'voiceactor', label: '声優・歌い手' },
{ value: 'idol', label: 'アイドル' },
{ value: 'anime', label: 'アニメ・映像・写真' },
{ value: '3d', label: '3D' },
{ value: 'game', label: 'ゲーム制作' },
{ value: 'music', label: '音楽' },
{ value: 'novel', label: '小説' },
{ value: 'doll', label: 'ドール' },
{ value: 'art', label: 'アート・デザイン' },
{ value: 'program', label: 'プログラム' },
{ value: 'handmade', label: '創作・ハンドメイド' },
{ value: 'history', label: '歴史・評論・情報' },
{ value: 'railroad', label: '鉄道・旅行・ミリタリー' },
{ value: 'shop', label: 'ショップ' },
{ value: 'other', label: 'その他' },
],
default: 'all',
},
period: {
description: 'Ranking period, see the table below, empty by default',
options: [
{ value: 'daily', label: 'デイリー' },
{ value: 'weekly', label: 'ウィークリー' },
{ value: 'monthly', label: 'マンスリー' },
{ value: 'all', label: '全期間' },
],
default: '',
},
order: {
description: 'Sorting, see the table below, `更新の新しい順` by default',
options: [
{ value: 'updater', label: '更新の新しい順' },
{ value: 'update_old', label: '更新の古い順' },
{ value: 'newer', label: '投稿の新しい順' },
{ value: 'create_old', label: '投稿の古い順' },
{ value: 'popular', label: 'お気に入り数順' },
],
default: 'updater',
},
rating: {
description: 'Rating, see the table below, `すべて` by default',
options: [
{ value: 'all', label: 'すべて' },
{ value: 'general', label: '一般のみ' },
{ value: 'adult', label: 'R18 のみ' },
],
default: 'all',
},
keyword: 'Keyword, empty by default',
},
features: {
@@ -24,7 +88,7 @@ export const route: Route = {
supportScihub: false,
},
name: 'Search',
maintainers: [],
maintainers: ['nczitzk'],
handler,
description: `Type
+3 -2
View File
@@ -1,4 +1,4 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import cache from '@/utils/cache';
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
@@ -6,7 +6,8 @@ import { config } from '@/config';
export const route: Route = {
path: '/user/:id',
categories: ['picture'],
categories: ['picture', 'popular'],
view: ViewType.Pictures,
example: '/fantia/user/3498',
parameters: { id: 'User id, can be found in user profile URL' },
features: {
+3 -2
View File
@@ -1,9 +1,10 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import got from '@/utils/got';
export const route: Route = {
path: '/doodles/:language?',
categories: ['picture'],
categories: ['picture', 'popular'],
view: ViewType.Pictures,
example: '/google/doodles/zh-CN',
parameters: { language: 'Language, default to `zh-CN`, for other language values, you can get it from [Google Doodles official website](https://www.google.com/doodles)' },
features: {
+15 -3
View File
@@ -1,4 +1,4 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import ofetch from '@/utils/ofetch';
import * as cheerio from 'cheerio';
import type { Context } from 'hono';
@@ -12,8 +12,20 @@ const render = (data) => art(path.join(__dirname, 'templates', 'chart.art'), dat
export const route: Route = {
path: '/chart/:chart?',
categories: ['multimedia'],
parameters: { chart: 'The chart to display, `top` by default' },
categories: ['multimedia', 'popular'],
view: ViewType.Notifications,
parameters: {
chart: {
description: 'The chart to display, `top` by default',
options: [
{ value: 'top', label: 'Top 250 Movies' },
{ value: 'moviemeter', label: 'Most Popular Movies' },
{ value: 'toptv', label: 'Top 250 TV Shows' },
{ value: 'tvmeter', label: 'Most Popular TV Shows' },
],
default: 'top',
},
},
example: '/imdb/chart',
radar: [
{
+13 -3
View File
@@ -1,13 +1,23 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import got from '@/utils/got';
import queryString from 'query-string';
export const route: Route = {
path: '/post/popular_recent/:period?',
categories: ['picture'],
categories: ['picture', 'popular'],
view: ViewType.Pictures,
example: '/konachan/post/popular_recent/1d',
parameters: {
period: '展示时间',
period: {
description: '展示时间',
options: [
{ value: '1d', label: '最近 24 小时' },
{ value: '1w', label: '最近一周' },
{ value: '1m', label: '最近一月' },
{ value: '1y', label: '最近一年' },
],
default: '1d',
},
},
radar: [
{
+3 -2
View File
@@ -1,4 +1,4 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import cache from '@/utils/cache';
import parser from '@/utils/rss-parser';
import ofetch from '@/utils/ofetch';
@@ -6,7 +6,8 @@ import { load } from 'cheerio';
const host = 'https://www.magnumphotos.com';
export const route: Route = {
path: '/magazine',
categories: ['picture'],
categories: ['picture', 'popular'],
view: ViewType.Pictures,
example: '/magnumphotos/magazine',
parameters: {},
features: {
+14 -3
View File
@@ -1,4 +1,4 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import { getCurrentPath } from '@/utils/helpers';
const __dirname = getCurrentPath(import.meta.url);
@@ -10,9 +10,20 @@ import path from 'node:path';
export const route: Route = {
path: '/search/:q/:order?',
categories: ['picture'],
categories: ['picture', 'popular'],
view: ViewType.Pictures,
example: '/pixabay/search/cat',
parameters: { q: 'Search term', order: 'Order, `popular` or `latest`, `latest` by default' },
parameters: {
q: 'Search term',
order: {
description: 'Order',
options: [
{ value: 'popular', label: 'popular' },
{ value: 'latest', label: 'latest' },
],
default: 'latest',
},
},
features: {
requireConfig: [
{
+3 -2
View File
@@ -1,10 +1,11 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import { load } from 'cheerio';
import ofetch from '@/utils/ofetch'; // 统一使用的请求库
export const route: Route = {
path: '/explore',
categories: ['multimedia'],
categories: ['multimedia', 'popular'],
view: ViewType.Audios,
example: '/podwise/explore',
radar: [
{
+3 -2
View File
@@ -1,4 +1,4 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
import apiKey from './api-key';
@@ -6,7 +6,8 @@ import { handleDescription } from './utils';
export const route: Route = {
path: '/tv/:id/seasons/:lang?',
categories: ['multimedia'],
categories: ['multimedia', 'popular'],
view: ViewType.Notifications,
example: '/themoviedb/tv/70593/seasons/en-US',
parameters: { id: 'TV show ID', lang: 'Language' },
features: {
+3 -2
View File
@@ -1,4 +1,4 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import { getCurrentPath } from '@/utils/helpers';
const __dirname = getCurrentPath(import.meta.url);
@@ -12,7 +12,8 @@ import { getClientVal, sign } from './utils';
export const route: Route = {
path: '/program/:programId',
categories: ['multimedia'],
categories: ['multimedia', 'popular'],
view: ViewType.Audios,
example: '/tingtingfm/program/M7VJv6Jj4R',
parameters: { programId: '节目 ID,可以在 URL 中找到' },
features: {
+1 -1
View File
@@ -234,7 +234,7 @@ export const TabParam = {
export const CommonRouteProperties: Pick<Route, 'url' | 'categories' | 'maintainers' | 'view'> = {
url: 'voronoiapp.com',
categories: ['picture'],
categories: ['picture', 'popular'],
view: ViewType.Pictures,
maintainers: ['Cesaryuan'],
};
+18 -3
View File
@@ -1,4 +1,4 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import cache from '@/utils/cache';
import got from '@/utils/got';
import { load } from 'cheerio';
@@ -9,9 +9,24 @@ const baseURL = 'https://yysub.net';
export const route: Route = {
path: '/article/:type?',
categories: ['multimedia'],
categories: ['multimedia', 'popular'],
view: ViewType.Articles,
example: '/yyets/article',
parameters: { type: '[' },
parameters: {
type: {
description: '类型',
options: [
{ value: 'all', label: '全部' },
{ value: 'news', label: '影视资讯' },
{ value: 'report', label: '收视快报' },
{ value: 'm_review', label: '人人影评' },
{ value: 't_review', label: '人人剧评' },
{ value: 'new_review', label: '新剧评测' },
{ value: 'recom', label: '片单推荐' },
],
default: 'all',
},
},
features: {
requireConfig: false,
requirePuppeteer: false,
+3 -2
View File
@@ -1,10 +1,11 @@
import { Route } from '@/types';
import { Route, ViewType } from '@/types';
import got from '@/utils/got';
import { load } from 'cheerio';
export const route: Route = {
path: '/today',
categories: ['multimedia'],
categories: ['multimedia', 'popular'],
view: ViewType.Notifications,
example: '/yyets/today',
parameters: {},
features: {