From 86e78bf1594831e9355a3ad7aaf4908712540e07 Mon Sep 17 00:00:00 2001 From: consistent-k Date: Sat, 4 Jan 2025 22:08:06 +0800 Subject: [PATCH 1/7] feat(routes): add lzzy route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增量子资源路由 --- src/routes/lzzy/category.ts | 15 +++++++++++++++ src/routes/lzzy/detail.ts | 15 +++++++++++++++ src/routes/lzzy/home.ts | 14 ++++++++++++++ src/routes/lzzy/homeVod.ts | 14 ++++++++++++++ src/routes/lzzy/namespace.ts | 7 +++++++ src/routes/lzzy/play.ts | 15 +++++++++++++++ src/routes/lzzy/search.ts | 15 +++++++++++++++ 7 files changed, 95 insertions(+) create mode 100644 src/routes/lzzy/category.ts create mode 100644 src/routes/lzzy/detail.ts create mode 100644 src/routes/lzzy/home.ts create mode 100644 src/routes/lzzy/homeVod.ts create mode 100644 src/routes/lzzy/namespace.ts create mode 100644 src/routes/lzzy/play.ts create mode 100644 src/routes/lzzy/search.ts diff --git a/src/routes/lzzy/category.ts b/src/routes/lzzy/category.ts new file mode 100644 index 0000000..9183150 --- /dev/null +++ b/src/routes/lzzy/category.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { CategoryRoute } from '@/types'; +import { handler } from '@/utils/cms/category'; + +export const route: CategoryRoute = { + path: '/category', + name: 'category', + example: '/lzzy/category', + description: `获取分类列表`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/lzzy/detail.ts b/src/routes/lzzy/detail.ts new file mode 100644 index 0000000..abd3617 --- /dev/null +++ b/src/routes/lzzy/detail.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { DetailRoute } from '@/types'; +import { handler } from '@/utils/cms/detail'; + +export const route: DetailRoute = { + path: '/detail', + name: 'detail', + example: '/lzzy/detail', + description: `获取详情`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/lzzy/home.ts b/src/routes/lzzy/home.ts new file mode 100644 index 0000000..e4976d4 --- /dev/null +++ b/src/routes/lzzy/home.ts @@ -0,0 +1,14 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { HomeRoute } from '@/types'; +import { handler } from '@/utils/cms/home'; + +export const route: HomeRoute = { + path: '/home', + name: 'home', + example: '/lzzy/home', + description: `首页分类列表`, + handler: (ctx: Context) => handler(ctx, namespace) +}; diff --git a/src/routes/lzzy/homeVod.ts b/src/routes/lzzy/homeVod.ts new file mode 100644 index 0000000..db0948b --- /dev/null +++ b/src/routes/lzzy/homeVod.ts @@ -0,0 +1,14 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { HomeVodRoute } from '@/types'; +import { handler } from '@/utils/cms/homeVod'; + +export const route: HomeVodRoute = { + path: '/homeVod', + name: 'homeVod', + example: '/lzzy/homeVod', + description: `最近更新`, + handler: (ctx: Context) => handler(ctx, namespace) +}; diff --git a/src/routes/lzzy/namespace.ts b/src/routes/lzzy/namespace.ts new file mode 100644 index 0000000..46ac0b7 --- /dev/null +++ b/src/routes/lzzy/namespace.ts @@ -0,0 +1,7 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: '量子資源', + url: 'https://cj.lziapi.com', + description: '量子資源' +}; diff --git a/src/routes/lzzy/play.ts b/src/routes/lzzy/play.ts new file mode 100644 index 0000000..2569f07 --- /dev/null +++ b/src/routes/lzzy/play.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { PlayRoute } from '@/types'; +import { handler } from '@/utils/cms/play'; + +export const route: PlayRoute = { + path: '/play', + name: 'play', + example: '/lzzy/play', + description: `获取播放地址`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/lzzy/search.ts b/src/routes/lzzy/search.ts new file mode 100644 index 0000000..c52022e --- /dev/null +++ b/src/routes/lzzy/search.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { SearchRoute } from '@/types'; +import { handler } from '@/utils/cms/search'; + +export const route: SearchRoute = { + path: '/search', + name: 'search', + example: '/lzzy/search', + description: `关键词搜索`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; From 97dcac2751dbe621e540ad34fe193e3e830dcb6f Mon Sep 17 00:00:00 2001 From: consistent-k Date: Sat, 4 Jan 2025 22:18:02 +0800 Subject: [PATCH 2/7] feat(routes): add kczy route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增快车资源路由 --- src/routes/kczy/category.ts | 15 +++++++++++++++ src/routes/kczy/detail.ts | 15 +++++++++++++++ src/routes/kczy/home.ts | 14 ++++++++++++++ src/routes/kczy/homeVod.ts | 14 ++++++++++++++ src/routes/kczy/namespace.ts | 7 +++++++ src/routes/kczy/play.ts | 15 +++++++++++++++ src/routes/kczy/search.ts | 15 +++++++++++++++ 7 files changed, 95 insertions(+) create mode 100644 src/routes/kczy/category.ts create mode 100644 src/routes/kczy/detail.ts create mode 100644 src/routes/kczy/home.ts create mode 100644 src/routes/kczy/homeVod.ts create mode 100644 src/routes/kczy/namespace.ts create mode 100644 src/routes/kczy/play.ts create mode 100644 src/routes/kczy/search.ts diff --git a/src/routes/kczy/category.ts b/src/routes/kczy/category.ts new file mode 100644 index 0000000..090fd9b --- /dev/null +++ b/src/routes/kczy/category.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { CategoryRoute } from '@/types'; +import { handler } from '@/utils/cms/category'; + +export const route: CategoryRoute = { + path: '/category', + name: 'category', + example: '/kczy/category', + description: `获取分类列表`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/kczy/detail.ts b/src/routes/kczy/detail.ts new file mode 100644 index 0000000..903a719 --- /dev/null +++ b/src/routes/kczy/detail.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { DetailRoute } from '@/types'; +import { handler } from '@/utils/cms/detail'; + +export const route: DetailRoute = { + path: '/detail', + name: 'detail', + example: '/kczy/detail', + description: `获取详情`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/kczy/home.ts b/src/routes/kczy/home.ts new file mode 100644 index 0000000..5fa409d --- /dev/null +++ b/src/routes/kczy/home.ts @@ -0,0 +1,14 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { HomeRoute } from '@/types'; +import { handler } from '@/utils/cms/home'; + +export const route: HomeRoute = { + path: '/home', + name: 'home', + example: '/kczy/home', + description: `首页分类列表`, + handler: (ctx: Context) => handler(ctx, namespace) +}; diff --git a/src/routes/kczy/homeVod.ts b/src/routes/kczy/homeVod.ts new file mode 100644 index 0000000..26271b7 --- /dev/null +++ b/src/routes/kczy/homeVod.ts @@ -0,0 +1,14 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { HomeVodRoute } from '@/types'; +import { handler } from '@/utils/cms/homeVod'; + +export const route: HomeVodRoute = { + path: '/homeVod', + name: 'homeVod', + example: '/kczy/homeVod', + description: `最近更新`, + handler: (ctx: Context) => handler(ctx, namespace) +}; diff --git a/src/routes/kczy/namespace.ts b/src/routes/kczy/namespace.ts new file mode 100644 index 0000000..c6e849c --- /dev/null +++ b/src/routes/kczy/namespace.ts @@ -0,0 +1,7 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: '快车资源', + url: 'https://caiji.kczyapi.com', + description: '快车资源' +}; diff --git a/src/routes/kczy/play.ts b/src/routes/kczy/play.ts new file mode 100644 index 0000000..72acf25 --- /dev/null +++ b/src/routes/kczy/play.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { PlayRoute } from '@/types'; +import { handler } from '@/utils/cms/play'; + +export const route: PlayRoute = { + path: '/play', + name: 'play', + example: '/kczy/play', + description: `获取播放地址`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/kczy/search.ts b/src/routes/kczy/search.ts new file mode 100644 index 0000000..66eb6ac --- /dev/null +++ b/src/routes/kczy/search.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { SearchRoute } from '@/types'; +import { handler } from '@/utils/cms/search'; + +export const route: SearchRoute = { + path: '/search', + name: 'search', + example: '/kczy/search', + description: `关键词搜索`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; From 73b1a7c20141dda2d4641daec6de7f40676c3447 Mon Sep 17 00:00:00 2001 From: consistent-k Date: Sat, 4 Jan 2025 22:24:52 +0800 Subject: [PATCH 3/7] feat(routes): add sdzy route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增闪电资源路由 --- src/routes/sdzy/category.ts | 15 +++++++++++++++ src/routes/sdzy/detail.ts | 15 +++++++++++++++ src/routes/sdzy/home.ts | 14 ++++++++++++++ src/routes/sdzy/homeVod.ts | 14 ++++++++++++++ src/routes/sdzy/namespace.ts | 7 +++++++ src/routes/sdzy/play.ts | 15 +++++++++++++++ src/routes/sdzy/search.ts | 15 +++++++++++++++ 7 files changed, 95 insertions(+) create mode 100644 src/routes/sdzy/category.ts create mode 100644 src/routes/sdzy/detail.ts create mode 100644 src/routes/sdzy/home.ts create mode 100644 src/routes/sdzy/homeVod.ts create mode 100644 src/routes/sdzy/namespace.ts create mode 100644 src/routes/sdzy/play.ts create mode 100644 src/routes/sdzy/search.ts diff --git a/src/routes/sdzy/category.ts b/src/routes/sdzy/category.ts new file mode 100644 index 0000000..a92d199 --- /dev/null +++ b/src/routes/sdzy/category.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { CategoryRoute } from '@/types'; +import { handler } from '@/utils/cms/category'; + +export const route: CategoryRoute = { + path: '/category', + name: 'category', + example: '/sdzy/category', + description: `获取分类列表`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/sdzy/detail.ts b/src/routes/sdzy/detail.ts new file mode 100644 index 0000000..334d841 --- /dev/null +++ b/src/routes/sdzy/detail.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { DetailRoute } from '@/types'; +import { handler } from '@/utils/cms/detail'; + +export const route: DetailRoute = { + path: '/detail', + name: 'detail', + example: '/sdzy/detail', + description: `获取详情`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/sdzy/home.ts b/src/routes/sdzy/home.ts new file mode 100644 index 0000000..9cf05ca --- /dev/null +++ b/src/routes/sdzy/home.ts @@ -0,0 +1,14 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { HomeRoute } from '@/types'; +import { handler } from '@/utils/cms/home'; + +export const route: HomeRoute = { + path: '/home', + name: 'home', + example: '/sdzy/home', + description: `首页分类列表`, + handler: (ctx: Context) => handler(ctx, namespace) +}; diff --git a/src/routes/sdzy/homeVod.ts b/src/routes/sdzy/homeVod.ts new file mode 100644 index 0000000..098eae1 --- /dev/null +++ b/src/routes/sdzy/homeVod.ts @@ -0,0 +1,14 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { HomeVodRoute } from '@/types'; +import { handler } from '@/utils/cms/homeVod'; + +export const route: HomeVodRoute = { + path: '/homeVod', + name: 'homeVod', + example: '/sdzy/homeVod', + description: `最近更新`, + handler: (ctx: Context) => handler(ctx, namespace) +}; diff --git a/src/routes/sdzy/namespace.ts b/src/routes/sdzy/namespace.ts new file mode 100644 index 0000000..5f291d2 --- /dev/null +++ b/src/routes/sdzy/namespace.ts @@ -0,0 +1,7 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: '闪电资源', + url: 'https://sdzyapi.com', + description: '闪电资源' +}; diff --git a/src/routes/sdzy/play.ts b/src/routes/sdzy/play.ts new file mode 100644 index 0000000..836edb6 --- /dev/null +++ b/src/routes/sdzy/play.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { PlayRoute } from '@/types'; +import { handler } from '@/utils/cms/play'; + +export const route: PlayRoute = { + path: '/play', + name: 'play', + example: '/sdzy/play', + description: `获取播放地址`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/sdzy/search.ts b/src/routes/sdzy/search.ts new file mode 100644 index 0000000..5350bf4 --- /dev/null +++ b/src/routes/sdzy/search.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { SearchRoute } from '@/types'; +import { handler } from '@/utils/cms/search'; + +export const route: SearchRoute = { + path: '/search', + name: 'search', + example: '/sdzy/search', + description: `关键词搜索`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; From 99fc1a78fcd8c5d838c597841e6f87738bee59db Mon Sep 17 00:00:00 2001 From: consistent-k Date: Sat, 4 Jan 2025 22:32:51 +0800 Subject: [PATCH 4/7] feat(routes): add guangsuzy route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增光速资源路由 --- src/routes/guangsuzy/category.ts | 15 +++++++++++++++ src/routes/guangsuzy/detail.ts | 15 +++++++++++++++ src/routes/guangsuzy/home.ts | 14 ++++++++++++++ src/routes/guangsuzy/homeVod.ts | 14 ++++++++++++++ src/routes/guangsuzy/namespace.ts | 7 +++++++ src/routes/guangsuzy/play.ts | 15 +++++++++++++++ src/routes/guangsuzy/search.ts | 15 +++++++++++++++ 7 files changed, 95 insertions(+) create mode 100644 src/routes/guangsuzy/category.ts create mode 100644 src/routes/guangsuzy/detail.ts create mode 100644 src/routes/guangsuzy/home.ts create mode 100644 src/routes/guangsuzy/homeVod.ts create mode 100644 src/routes/guangsuzy/namespace.ts create mode 100644 src/routes/guangsuzy/play.ts create mode 100644 src/routes/guangsuzy/search.ts diff --git a/src/routes/guangsuzy/category.ts b/src/routes/guangsuzy/category.ts new file mode 100644 index 0000000..5219464 --- /dev/null +++ b/src/routes/guangsuzy/category.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { CategoryRoute } from '@/types'; +import { handler } from '@/utils/cms/category'; + +export const route: CategoryRoute = { + path: '/category', + name: 'category', + example: '/guangsuzy/category', + description: `获取分类列表`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/guangsuzy/detail.ts b/src/routes/guangsuzy/detail.ts new file mode 100644 index 0000000..7bbbc70 --- /dev/null +++ b/src/routes/guangsuzy/detail.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { DetailRoute } from '@/types'; +import { handler } from '@/utils/cms/detail'; + +export const route: DetailRoute = { + path: '/detail', + name: 'detail', + example: '/guangsuzy/detail', + description: `获取详情`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/guangsuzy/home.ts b/src/routes/guangsuzy/home.ts new file mode 100644 index 0000000..0adc47a --- /dev/null +++ b/src/routes/guangsuzy/home.ts @@ -0,0 +1,14 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { HomeRoute } from '@/types'; +import { handler } from '@/utils/cms/home'; + +export const route: HomeRoute = { + path: '/home', + name: 'home', + example: '/guangsuzy/home', + description: `首页分类列表`, + handler: (ctx: Context) => handler(ctx, namespace) +}; diff --git a/src/routes/guangsuzy/homeVod.ts b/src/routes/guangsuzy/homeVod.ts new file mode 100644 index 0000000..6fb8a24 --- /dev/null +++ b/src/routes/guangsuzy/homeVod.ts @@ -0,0 +1,14 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { HomeVodRoute } from '@/types'; +import { handler } from '@/utils/cms/homeVod'; + +export const route: HomeVodRoute = { + path: '/homeVod', + name: 'homeVod', + example: '/guangsuzy/homeVod', + description: `最近更新`, + handler: (ctx: Context) => handler(ctx, namespace) +}; diff --git a/src/routes/guangsuzy/namespace.ts b/src/routes/guangsuzy/namespace.ts new file mode 100644 index 0000000..d151c92 --- /dev/null +++ b/src/routes/guangsuzy/namespace.ts @@ -0,0 +1,7 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: '光速资源', + url: 'https://api.guangsuapi.com', + description: '光速资源' +}; diff --git a/src/routes/guangsuzy/play.ts b/src/routes/guangsuzy/play.ts new file mode 100644 index 0000000..fe1ad6c --- /dev/null +++ b/src/routes/guangsuzy/play.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { PlayRoute } from '@/types'; +import { handler } from '@/utils/cms/play'; + +export const route: PlayRoute = { + path: '/play', + name: 'play', + example: '/guangsuzy/play', + description: `获取播放地址`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/guangsuzy/search.ts b/src/routes/guangsuzy/search.ts new file mode 100644 index 0000000..bdb5c7c --- /dev/null +++ b/src/routes/guangsuzy/search.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { SearchRoute } from '@/types'; +import { handler } from '@/utils/cms/search'; + +export const route: SearchRoute = { + path: '/search', + name: 'search', + example: '/guangsuzy/search', + description: `关键词搜索`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; From b68748b63c96228aae91441e06c237f75dd419ed Mon Sep 17 00:00:00 2001 From: consistent-k Date: Sat, 4 Jan 2025 23:00:07 +0800 Subject: [PATCH 5/7] feat(routes): add ukzy route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增U酷资源路由 --- src/routes/ukzy/category.ts | 15 +++++++++++++++ src/routes/ukzy/detail.ts | 15 +++++++++++++++ src/routes/ukzy/home.ts | 14 ++++++++++++++ src/routes/ukzy/homeVod.ts | 14 ++++++++++++++ src/routes/ukzy/namespace.ts | 7 +++++++ src/routes/ukzy/play.ts | 15 +++++++++++++++ src/routes/ukzy/search.ts | 15 +++++++++++++++ 7 files changed, 95 insertions(+) create mode 100644 src/routes/ukzy/category.ts create mode 100644 src/routes/ukzy/detail.ts create mode 100644 src/routes/ukzy/home.ts create mode 100644 src/routes/ukzy/homeVod.ts create mode 100644 src/routes/ukzy/namespace.ts create mode 100644 src/routes/ukzy/play.ts create mode 100644 src/routes/ukzy/search.ts diff --git a/src/routes/ukzy/category.ts b/src/routes/ukzy/category.ts new file mode 100644 index 0000000..88c35c1 --- /dev/null +++ b/src/routes/ukzy/category.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { CategoryRoute } from '@/types'; +import { handler } from '@/utils/cms/category'; + +export const route: CategoryRoute = { + path: '/category', + name: 'category', + example: '/ukzy/category', + description: `获取分类列表`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/ukzy/detail.ts b/src/routes/ukzy/detail.ts new file mode 100644 index 0000000..36bd330 --- /dev/null +++ b/src/routes/ukzy/detail.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { DetailRoute } from '@/types'; +import { handler } from '@/utils/cms/detail'; + +export const route: DetailRoute = { + path: '/detail', + name: 'detail', + example: '/ukzy/detail', + description: `获取详情`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/ukzy/home.ts b/src/routes/ukzy/home.ts new file mode 100644 index 0000000..9d195df --- /dev/null +++ b/src/routes/ukzy/home.ts @@ -0,0 +1,14 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { HomeRoute } from '@/types'; +import { handler } from '@/utils/cms/home'; + +export const route: HomeRoute = { + path: '/home', + name: 'home', + example: '/ukzy/home', + description: `首页分类列表`, + handler: (ctx: Context) => handler(ctx, namespace) +}; diff --git a/src/routes/ukzy/homeVod.ts b/src/routes/ukzy/homeVod.ts new file mode 100644 index 0000000..c19744e --- /dev/null +++ b/src/routes/ukzy/homeVod.ts @@ -0,0 +1,14 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { HomeVodRoute } from '@/types'; +import { handler } from '@/utils/cms/homeVod'; + +export const route: HomeVodRoute = { + path: '/homeVod', + name: 'homeVod', + example: '/ukzy/homeVod', + description: `最近更新`, + handler: (ctx: Context) => handler(ctx, namespace) +}; diff --git a/src/routes/ukzy/namespace.ts b/src/routes/ukzy/namespace.ts new file mode 100644 index 0000000..4a733c8 --- /dev/null +++ b/src/routes/ukzy/namespace.ts @@ -0,0 +1,7 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: 'U酷资源', + url: 'https://api.ukuapi88.com', + description: 'U酷资源' +}; diff --git a/src/routes/ukzy/play.ts b/src/routes/ukzy/play.ts new file mode 100644 index 0000000..7638f58 --- /dev/null +++ b/src/routes/ukzy/play.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { PlayRoute } from '@/types'; +import { handler } from '@/utils/cms/play'; + +export const route: PlayRoute = { + path: '/play', + name: 'play', + example: '/ukzy/play', + description: `获取播放地址`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/ukzy/search.ts b/src/routes/ukzy/search.ts new file mode 100644 index 0000000..913eeb3 --- /dev/null +++ b/src/routes/ukzy/search.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { SearchRoute } from '@/types'; +import { handler } from '@/utils/cms/search'; + +export const route: SearchRoute = { + path: '/search', + name: 'search', + example: '/ukzy/search', + description: `关键词搜索`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; From 497e4783bd19f08628a01e8399ba4b66cd6efdd7 Mon Sep 17 00:00:00 2001 From: consistent-k Date: Sat, 4 Jan 2025 23:03:06 +0800 Subject: [PATCH 6/7] fix: remove nangua route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除失效的南瓜影视 --- src/routes/nangua/category.ts | 93 ------------------ src/routes/nangua/config/index.ts | 6 -- src/routes/nangua/detail.ts | 134 -------------------------- src/routes/nangua/home.ts | 121 ------------------------ src/routes/nangua/homeVod.ts | 150 ------------------------------ src/routes/nangua/namespace.ts | 7 -- src/routes/nangua/play.ts | 88 ------------------ src/routes/nangua/request.ts | 40 -------- src/routes/nangua/search.ts | 102 -------------------- 9 files changed, 741 deletions(-) delete mode 100644 src/routes/nangua/category.ts delete mode 100644 src/routes/nangua/config/index.ts delete mode 100644 src/routes/nangua/detail.ts delete mode 100644 src/routes/nangua/home.ts delete mode 100644 src/routes/nangua/homeVod.ts delete mode 100644 src/routes/nangua/namespace.ts delete mode 100644 src/routes/nangua/play.ts delete mode 100644 src/routes/nangua/request.ts delete mode 100644 src/routes/nangua/search.ts diff --git a/src/routes/nangua/category.ts b/src/routes/nangua/category.ts deleted file mode 100644 index eb46fb0..0000000 --- a/src/routes/nangua/category.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { Context } from 'hono'; -import queryString from 'query-string'; - -import { NAN_GUA_CONFIG } from './config'; -import { namespace } from './namespace'; -import request from './request'; - -import { ERROR_CODE, SUCCESS_CODE, SYSTEM_ERROR_CODE } from '@/constant/code'; -import { CATEGORY_MESSAGE } from '@/constant/message'; -import { CategoryRoute, CategoryVodData } from '@/types'; -import logger from '@/utils/logger'; - -// 源头的分类列表数据 -interface CategoryDataOrigin { - code: number; - msg: string; - page: string; - limit: string; - pagecount: number; - total: number; - list: Array<{ - id: number; - img: string; - name: string; - score: string; - msg: string; - }>; -} - -const handler = async (ctx: Context) => { - try { - const body = await ctx.req.json(); - logger.info(`${CATEGORY_MESSAGE.INFO} - ${namespace.name} - ${JSON.stringify(body)}`); - - const { id, page, filters = {} } = body; - // filters: { class, area, lang, year } - - const params = { - app: NAN_GUA_CONFIG.app, - imei: NAN_GUA_CONFIG.imei, - id, - page, - type: filters?.class || '', - area: filters?.area || '', - year: filters?.year || '' - }; - - const strParams = queryString.stringify(params); - - let res = await request.post(`${namespace.url}/api.php/provide/vod_list?${strParams}`); - const { code, list } = res; - - if (code === 1) { - const newList: CategoryVodData[] = list.map((item) => { - return { - vod_id: item.id, - vod_name: item.name, - vod_pic: item.img, - vod_remarks: item.msg - }; - }); - - return { - code: SUCCESS_CODE, - message: CATEGORY_MESSAGE.SUCCESS, - data: newList - }; - } - logger.error(`${CATEGORY_MESSAGE.ERROR} - ${namespace.name} - ${JSON.stringify(res)}`); - return { - code: ERROR_CODE, - message: CATEGORY_MESSAGE.ERROR, - data: [] - }; - } catch (error) { - ctx.res.headers.set('Cache-Control', 'no-cache'); - logger.error(`${CATEGORY_MESSAGE.ERROR} - ${namespace.name} - ${error}`); - return { - code: SYSTEM_ERROR_CODE, - message: CATEGORY_MESSAGE.ERROR, - data: [] - }; - } -}; - -export const route: CategoryRoute = { - path: '/category', - name: 'category', - example: '/nangua/category', - description: `获取分类列表`, - handler, - method: 'POST' -}; diff --git a/src/routes/nangua/config/index.ts b/src/routes/nangua/config/index.ts deleted file mode 100644 index 7197943..0000000 --- a/src/routes/nangua/config/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export const NAN_GUA_CONFIG = { - app: 'ylys', - imei: 'c431ea542cee9679', - version_name: '1.0.9', - version_code: '9' -}; diff --git a/src/routes/nangua/detail.ts b/src/routes/nangua/detail.ts deleted file mode 100644 index 101d365..0000000 --- a/src/routes/nangua/detail.ts +++ /dev/null @@ -1,134 +0,0 @@ -import { Context } from 'hono'; -import queryString from 'query-string'; - -import { NAN_GUA_CONFIG } from './config'; -import { namespace } from './namespace'; -import request from './request'; - -import { ERROR_CODE, SUCCESS_CODE, SYSTEM_ERROR_CODE } from '@/constant/code'; -import { DETAIL_MESSAGE } from '@/constant/message'; -import { DetailData, DetailRoute } from '@/types'; -import logger from '@/utils/logger'; - -// 源头详情数据 -interface DetailDataOrigin { - code: number; - msg: string; - data: { - name: string; - year: string; - score: string; - hits: number; - is_free: number; - type: string; - msg: string; - need_points: number; - img: string; - info: string; - isMovie: boolean; - display_style: number; - total_count: number; - player_info: Array<{ - id: number; - from: string; - show: string; - url_count: number; - play_kernel: number; - type: number; - video_info: Array<{ - id: number; - name: string; - pic: string; - url: string[]; - }>; - }>; - tryWatchTime: number; - and_tryWatchTime: number; - isCollect: boolean; - isPurchase: boolean; - isVip: boolean; - likes: Array<{ - id: number; - name: string; - img: string; - year: string; - score: string; - section: number; - }>; - }; -} - -const handler = async (ctx: Context) => { - try { - const body = await ctx.req.json(); - logger.info(`${DETAIL_MESSAGE.INFO} - ${namespace.name} - ${JSON.stringify(body)}`); - - const { id } = body; - const params = { - app: NAN_GUA_CONFIG.app, - imei: NAN_GUA_CONFIG.imei, - id - }; - - const strParams = queryString.stringify(params); - - let res = await request.post(`${namespace.url}/api.php/provide/vod_detail?${strParams}`); - - const { code, data } = res; - - if (code === 1) { - const detailData: DetailData = { - vod_id: id, - vod_name: data.name, - vod_pic: data.img, - vod_remarks: `更新至: ${data.msg} / 评分: ${data.score}`, - vod_year: data.year, - vod_area: '', - vod_actor: '', - vod_director: '', - vod_content: data.info || '', - vod_play_list: data.player_info.map((item) => { - return { - name: item.show, - title: item.show, - urls: item.video_info.map((url) => { - return { - name: url.name, - url: url.url[0] - }; - }), - parse_urls: [] - }; - }) - }; - return { - code: SUCCESS_CODE, - message: DETAIL_MESSAGE.SUCCESS, - data: [detailData] - }; - } - logger.error(`${DETAIL_MESSAGE.ERROR} - ${namespace.name} - ${JSON.stringify(res)}`); - return { - code: ERROR_CODE, - message: DETAIL_MESSAGE.ERROR, - data: [] - }; - } catch (error) { - ctx.res.headers.set('Cache-Control', 'no-cache'); - logger.error(`${DETAIL_MESSAGE.ERROR} - ${namespace.name} - ${error}`); - return { - code: SYSTEM_ERROR_CODE, - message: DETAIL_MESSAGE.ERROR, - data: [] - }; - } -}; - -export const route: DetailRoute = { - path: '/detail', - name: 'detail', - example: '/nangua/detail', - description: `获取详情`, - handler, - method: 'POST' -}; diff --git a/src/routes/nangua/home.ts b/src/routes/nangua/home.ts deleted file mode 100644 index b71e822..0000000 --- a/src/routes/nangua/home.ts +++ /dev/null @@ -1,121 +0,0 @@ -import { namespace } from './namespace'; -import request from './request'; - -import { ERROR_CODE, SUCCESS_CODE, SYSTEM_ERROR_CODE } from '@/constant/code'; -import { HOME_MESSAGE } from '@/constant/message'; -import { HomeData, HomeRoute } from '@/types'; -import { filterHomeData } from '@/utils/filters'; -import logger from '@/utils/logger'; - -// 源头的首页数据 -interface HomeDataOrigin { - id: number; - name: string; - msg: Array<{ - name: 'order' | 'type' | 'area' | 'year'; - data: string[]; - }>; -} - -const handler = async (ctx) => { - try { - logger.info(`${HOME_MESSAGE.INFO} - ${namespace.name}`); - const res = await request.post(`${namespace.url}/api.php/provide/home_nav`); - const newList: HomeData[] = []; - - res.forEach((item) => { - if (item.name !== '精选') { - const home_data: HomeData = { - type_id: item.id, - type_name: item.name, - filters: [] - }; - item.msg.forEach((msg) => { - if (msg.name === 'type') { - home_data.filters.push({ - type: 'class', - children: msg.data - .filter((fItem) => fItem !== '类型') - .map((mItem) => { - return { - label: mItem, - value: mItem - }; - }) - }); - } - if (msg.name === 'area') { - home_data.filters.push({ - type: 'area', - children: msg.data - .filter((fItem) => fItem !== '地区') - .map((mItem) => { - return { - label: mItem, - value: mItem - }; - }) - }); - } - if (msg.name === 'year') { - home_data.filters.push({ - type: 'year', - children: msg.data - .filter((fItem) => fItem !== '年份') - .map((mItem) => { - return { - label: mItem, - value: mItem - }; - }) - }); - } - if (msg.name === 'order') { - home_data.filters.push({ - type: 'order', - children: msg.data - .filter((fItem) => fItem !== '排序') - .map((mItem) => { - return { - label: mItem, - value: mItem - }; - }) - }); - } - }); - newList.push(home_data); - } - }); - - if (newList.length > 0) { - return { - code: SUCCESS_CODE, - data: filterHomeData(newList) - }; - } - - logger.error(`${HOME_MESSAGE.ERROR} - ${namespace.name} - ${JSON.stringify(res)}`); - return { - code: ERROR_CODE, - message: HOME_MESSAGE.ERROR, - data: [] - }; - } catch (error) { - ctx.res.headers.set('Cache-Control', 'no-cache'); - logger.error(`${HOME_MESSAGE.ERROR} - ${namespace.name} - ${error}`); - return { - code: SYSTEM_ERROR_CODE, - message: HOME_MESSAGE.ERROR, - data: [] - }; - } -}; - -export const route: HomeRoute = { - path: '/home', - name: 'home', - example: '/nangua/home', - description: `首页分类列表`, - handler -}; diff --git a/src/routes/nangua/homeVod.ts b/src/routes/nangua/homeVod.ts deleted file mode 100644 index eb343cb..0000000 --- a/src/routes/nangua/homeVod.ts +++ /dev/null @@ -1,150 +0,0 @@ -import queryString from 'query-string'; - -import { NAN_GUA_CONFIG } from './config'; -import { namespace } from './namespace'; -import request from './request'; - -import { ERROR_CODE, SUCCESS_CODE, SYSTEM_ERROR_CODE } from '@/constant/code'; -import { HOME_VOD_MESSAGE } from '@/constant/message'; -import { HomeVodData, HomeVodRoute } from '@/types'; -import { filterHomeVodData } from '@/utils/filters'; -import logger from '@/utils/logger'; - -// 源头的最近更新数据 -interface HomeVodDataOrigin { - slide: { - data: Array<{ - id: number; - url: string | number; - name: string; - img: string; - type: number; - jumpurl: string; - }>; - ads: { - type: number; - msg: string; - code: string | number; - }; - }; - video: Array<{ - id: number; - name: string; - icon: string; - ads: { - type: number; - msg: string; - code: string | number; - }; - style_type: number; - style_num: number; - vod_more: { - name: string; - type: number; - url: string | number; - }; - data: Array<{ - id: number; - type: number; - name: string; - qingxidu: string; - img: string; - msg: string; - score: string; - section: number; - }>; - }>; -} - -const handler = async (ctx) => { - try { - logger.info(`${HOME_VOD_MESSAGE.INFO} - ${namespace.name}`); - - const params = { - imei: NAN_GUA_CONFIG.imei, - app: NAN_GUA_CONFIG.app, - appVersionName: NAN_GUA_CONFIG.version_name, - appVersionCode: NAN_GUA_CONFIG.version_code, - devices: 'android', - deviceModel: 'Subsystem for Android(TM)', - deviceVersion: '33', - deviceScreen: '427*250', - deviceBrand: 'Windows' - }; - - const strParams = queryString.stringify(params); - - let res = await request.post(`${namespace.url}/api.php/provide/home_data?${strParams}`); - - const typeNameMap: Record = { - 0: '推荐', - 1: '电影', - 2: '电视剧', - 3: '综艺', - 4: '动漫', - 46: '海外精选' - }; - - const { slide, video } = res; - let vod_list: HomeVodData[] = []; - - slide.data.forEach((item) => { - vod_list.push({ - vod_id: item.id, - vod_name: item.name, - vod_pic: item.img, - vod_pic_thumb: item.img, - vod_remarks: '', - type_id: item.type, - type_name: typeNameMap[item.type] - }); - }); - - video.forEach((item) => { - item.data.forEach((vod) => { - if (vod.qingxidu) { - vod_list.push({ - vod_id: vod.id, - vod_name: vod.name, - vod_pic: vod.img, - vod_pic_thumb: vod.img, - vod_remarks: vod.msg, - type_id: item.id, - type_name: typeNameMap[item.id] - }); - } - }); - }); - - if (vod_list.length > 0) { - return { - code: SUCCESS_CODE, - message: HOME_VOD_MESSAGE.SUCCESS, - data: filterHomeVodData(vod_list) - }; - } - - logger.error(`${HOME_VOD_MESSAGE.ERROR} - ${namespace.name} - ${JSON.stringify(res)}`); - return { - code: ERROR_CODE, - message: HOME_VOD_MESSAGE.ERROR, - data: [] - }; - } catch (error) { - ctx.res.headers.set('Cache-Control', 'no-cache'); - logger.error(`${HOME_VOD_MESSAGE.ERROR} - ${namespace.name} - ${error}`); - return { - code: SYSTEM_ERROR_CODE, - message: HOME_VOD_MESSAGE.ERROR, - data: [] - }; - } -}; - -export const route: HomeVodRoute = { - path: '/homeVod', - name: 'homeVod', - example: '/nangua/homeVod', - description: `最近更新`, - handler -}; diff --git a/src/routes/nangua/namespace.ts b/src/routes/nangua/namespace.ts deleted file mode 100644 index 03e4120..0000000 --- a/src/routes/nangua/namespace.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Namespace } from '@/types'; - -export const namespace: Namespace = { - name: '南瓜影视', - url: 'http://ys.changmengyun.com', - description: '南瓜影视' -}; diff --git a/src/routes/nangua/play.ts b/src/routes/nangua/play.ts deleted file mode 100644 index ba348a2..0000000 --- a/src/routes/nangua/play.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { Context } from 'hono'; - -import { namespace } from './namespace'; - -import { ERROR_CODE, SUCCESS_CODE, SYSTEM_ERROR_CODE } from '@/constant/code'; -import { PLAY_MESSAGE } from '@/constant/message'; -import { PlayRoute } from '@/types'; -import logger from '@/utils/logger'; -import request from '@/utils/request'; - -interface PlayDataOrigin { - code: number; - url: string; - type: string; -} - -const handler = async (ctx: Context) => { - ctx.res.headers.set('Cache-Control', 'no-cache'); - try { - const body = await ctx.req.json(); - logger.info(`${PLAY_MESSAGE.INFO} - ${namespace.name} - ${JSON.stringify(body)}`); - - const { url } = body; - let play_type = ''; - let play_url = ''; - - if (url.indexOf('m3u8') !== -1) { - play_url = url.split('url=')[1]; - play_type = 'hls'; - } else if (url.indexOf(',') !== -1) { - let mjurl = url.split(',')[1]; - const res = await request.post( - `${mjurl}`, - {}, - { - timeout: 4000 - } - ); - play_url = res.url || ''; - play_type = 'hls'; - } else { - const res = await request.post( - `${url}`, - {}, - { - timeout: 4000 - } - ); - play_url = res.url || ''; - play_type = 'hls'; - } - - if (play_url.length > 0) { - return { - code: SUCCESS_CODE, - message: PLAY_MESSAGE.SUCCESS, - data: [ - { - play_type, - play_url - } - ] - }; - } - logger.error(`${PLAY_MESSAGE.ERROR} - ${namespace.name}`); - return { - code: ERROR_CODE, - message: PLAY_MESSAGE.ERROR, - data: [] - }; - } catch (error) { - logger.error(`${PLAY_MESSAGE.ERROR} - ${namespace.name} - ${error}`); - return { - code: SYSTEM_ERROR_CODE, - message: PLAY_MESSAGE.ERROR, - data: [] - }; - } -}; - -export const route: PlayRoute = { - path: '/play', - name: 'play', - example: '/nangua/play', - description: `获取播放地址`, - handler, - method: 'POST' -}; diff --git a/src/routes/nangua/request.ts b/src/routes/nangua/request.ts deleted file mode 100644 index 8fb4a78..0000000 --- a/src/routes/nangua/request.ts +++ /dev/null @@ -1,40 +0,0 @@ -import axios, { AxiosRequestConfig } from 'axios'; -import CryptoJS from 'crypto-js'; -import { merge } from 'lodash'; - -import { NAN_GUA_CONFIG } from './config'; -import { namespace } from './namespace'; - -const request = axios.create({ - headers: { - version_name: NAN_GUA_CONFIG.version_name, - version_code: NAN_GUA_CONFIG.version_code, - package_name: 'com.app.nanguatv', - imei: NAN_GUA_CONFIG.imei, - 'User-Agent': 'okhttp/4.6.0', - Referer: namespace.url - } -}); - -request.interceptors.request.use(async (config) => { - let t = new Date().getTime().toString(); - config.headers['sign'] = CryptoJS.MD5(`${NAN_GUA_CONFIG.imei}#uBFszdEM0oL0JRn@${t}`).toString().toLowerCase(); - config.headers['timeMillis'] = t; - return config; -}); - -request.interceptors.response.use(async (response) => { - return response.data; -}); - -const newRequest = { - async get(url: string, config?: AxiosRequestConfig): Promise { - return await request(url, merge({}, config, { method: 'get' })); - }, - - async post(url: string, config?: AxiosRequestConfig): Promise { - return await request(url, merge({}, config, { method: 'post' })); - } -}; - -export default newRequest; diff --git a/src/routes/nangua/search.ts b/src/routes/nangua/search.ts deleted file mode 100644 index ea1be82..0000000 --- a/src/routes/nangua/search.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { Context } from 'hono'; -import queryString from 'query-string'; - -import { NAN_GUA_CONFIG } from './config'; -import { namespace } from './namespace'; -import request from './request'; - -import { ERROR_CODE, SUCCESS_CODE, SYSTEM_ERROR_CODE } from '@/constant/code'; -import { SEARCH_MESSAGE } from '@/constant/message'; -import { SearchData, SearchRoute } from '@/types'; -import { filterSearchData } from '@/utils/filters'; -import logger from '@/utils/logger'; - -// 源头的关键词搜索数据 -interface SearchDataOrigin { - code: number; - msg: string; - data: Array<{ - id: number; - type: number; - video_name: string; - qingxidu: string; - img: string; - director: string; - main_actor: string; - blurb: string; - category: string; - }>; -} -const handler = async (ctx: Context) => { - try { - const body = await ctx.req.json(); - logger.info(`${SEARCH_MESSAGE.INFO} - ${namespace.name} - ${JSON.stringify(body)}`); - - const { page, keyword } = body; - - const params = { - app: NAN_GUA_CONFIG.app, - imei: NAN_GUA_CONFIG.imei, - video_name: keyword, - page, - pageSize: 12, - tid: 0 - }; - - const strParams = queryString.stringify(params); - - const res = await request.post(`${namespace.url}/api.php/provide/search_result_more?${strParams}`); - - const { data, code } = res; - - const typeNameMap: Record = { - 1: '电影', - 2: '电视剧', - 3: '综艺', - 4: '动漫', - 46: '海外精选' - }; - - if (code === 1) { - const newList: SearchData[] = data.map((item) => { - return { - type_id: item.type, - type_name: typeNameMap[item.type] || '未知', - vod_id: item.id, - vod_name: item.video_name, - vod_pic: item.img, - vod_remarks: item.qingxidu - }; - }); - return { - code: SUCCESS_CODE, - message: SEARCH_MESSAGE.SUCCESS, - data: filterSearchData(newList) - }; - } - - logger.error(`${SEARCH_MESSAGE.ERROR} - ${namespace.name} - ${JSON.stringify(res)}`); - return { - code: ERROR_CODE, - message: SEARCH_MESSAGE.ERROR, - data: [] - }; - } catch (error) { - ctx.res.headers.set('Cache-Control', 'no-cache'); - logger.error(`${SEARCH_MESSAGE.ERROR} - ${namespace.name} - ${error}`); - return { - code: SYSTEM_ERROR_CODE, - message: SEARCH_MESSAGE.ERROR, - data: [] - }; - } -}; - -export const route: SearchRoute = { - path: '/search', - name: 'search', - example: '/nangua/search', - description: `关键词搜索`, - handler, - method: 'POST' -}; From 3de4a4ca3b20d7a535fe81ec56a216a32b732d09 Mon Sep 17 00:00:00 2001 From: consistent-k Date: Sat, 4 Jan 2025 23:13:52 +0800 Subject: [PATCH 7/7] feat(routes): add yhzy route MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增樱花资源路由 --- src/routes/yhzy/category.ts | 15 +++++++++++++++ src/routes/yhzy/detail.ts | 15 +++++++++++++++ src/routes/yhzy/home.ts | 14 ++++++++++++++ src/routes/yhzy/homeVod.ts | 14 ++++++++++++++ src/routes/yhzy/namespace.ts | 7 +++++++ src/routes/yhzy/play.ts | 15 +++++++++++++++ src/routes/yhzy/search.ts | 15 +++++++++++++++ 7 files changed, 95 insertions(+) create mode 100644 src/routes/yhzy/category.ts create mode 100644 src/routes/yhzy/detail.ts create mode 100644 src/routes/yhzy/home.ts create mode 100644 src/routes/yhzy/homeVod.ts create mode 100644 src/routes/yhzy/namespace.ts create mode 100644 src/routes/yhzy/play.ts create mode 100644 src/routes/yhzy/search.ts diff --git a/src/routes/yhzy/category.ts b/src/routes/yhzy/category.ts new file mode 100644 index 0000000..31ae4cd --- /dev/null +++ b/src/routes/yhzy/category.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { CategoryRoute } from '@/types'; +import { handler } from '@/utils/cms/category'; + +export const route: CategoryRoute = { + path: '/category', + name: 'category', + example: '/yhzy/category', + description: `获取分类列表`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/yhzy/detail.ts b/src/routes/yhzy/detail.ts new file mode 100644 index 0000000..467bead --- /dev/null +++ b/src/routes/yhzy/detail.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { DetailRoute } from '@/types'; +import { handler } from '@/utils/cms/detail'; + +export const route: DetailRoute = { + path: '/detail', + name: 'detail', + example: '/yhzy/detail', + description: `获取详情`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/yhzy/home.ts b/src/routes/yhzy/home.ts new file mode 100644 index 0000000..1b8a99a --- /dev/null +++ b/src/routes/yhzy/home.ts @@ -0,0 +1,14 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { HomeRoute } from '@/types'; +import { handler } from '@/utils/cms/home'; + +export const route: HomeRoute = { + path: '/home', + name: 'home', + example: '/yhzy/home', + description: `首页分类列表`, + handler: (ctx: Context) => handler(ctx, namespace) +}; diff --git a/src/routes/yhzy/homeVod.ts b/src/routes/yhzy/homeVod.ts new file mode 100644 index 0000000..a3c1a68 --- /dev/null +++ b/src/routes/yhzy/homeVod.ts @@ -0,0 +1,14 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { HomeVodRoute } from '@/types'; +import { handler } from '@/utils/cms/homeVod'; + +export const route: HomeVodRoute = { + path: '/homeVod', + name: 'homeVod', + example: '/yhzy/homeVod', + description: `最近更新`, + handler: (ctx: Context) => handler(ctx, namespace) +}; diff --git a/src/routes/yhzy/namespace.ts b/src/routes/yhzy/namespace.ts new file mode 100644 index 0000000..d950d64 --- /dev/null +++ b/src/routes/yhzy/namespace.ts @@ -0,0 +1,7 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: '樱花资源网', + url: 'https://m3u8.apiyhzy.com', + description: '樱花资源网' +}; diff --git a/src/routes/yhzy/play.ts b/src/routes/yhzy/play.ts new file mode 100644 index 0000000..4311de9 --- /dev/null +++ b/src/routes/yhzy/play.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { PlayRoute } from '@/types'; +import { handler } from '@/utils/cms/play'; + +export const route: PlayRoute = { + path: '/play', + name: 'play', + example: '/yhzy/play', + description: `获取播放地址`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +}; diff --git a/src/routes/yhzy/search.ts b/src/routes/yhzy/search.ts new file mode 100644 index 0000000..33e6bd6 --- /dev/null +++ b/src/routes/yhzy/search.ts @@ -0,0 +1,15 @@ +import { Context } from 'hono'; + +import { namespace } from './namespace'; + +import { SearchRoute } from '@/types'; +import { handler } from '@/utils/cms/search'; + +export const route: SearchRoute = { + path: '/search', + name: 'search', + example: '/yhzy/search', + description: `关键词搜索`, + handler: (ctx: Context) => handler(ctx, namespace), + method: 'POST' +};