From 01e29c18d63a6802433366b0be7d46aff0006715 Mon Sep 17 00:00:00 2001 From: Ethan Shen <42264778+nczitzk@users.noreply.github.com> Date: Tue, 4 Apr 2023 02:20:28 +0800 Subject: [PATCH] fix(route): update domain to mp4kan.com for domp4 (#12225) --- docs/multimedia.md | 2 +- lib/v2/domp4/detail.js | 4 +--- lib/v2/domp4/latest.js | 5 +++-- lib/v2/domp4/utils.js | 3 +++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/multimedia.md b/docs/multimedia.md index 65dbb4c8d..b3d9283c2 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -426,7 +426,7 @@ BT 之家的域名会变更,本路由以 为默认 ### 剧集订阅 - + :::tip 由于大部分详情页是 `/html/xxx.html`,还有部分是 `/detail/123.html`,所以此处做了兼容,id 取 `xxx` 或者 `123` 都可以。 diff --git a/lib/v2/domp4/detail.js b/lib/v2/domp4/detail.js index f1924daaf..56ebfc58c 100644 --- a/lib/v2/domp4/detail.js +++ b/lib/v2/domp4/detail.js @@ -1,8 +1,6 @@ const cheerio = require('cheerio'); const got = require('@/utils/got'); -const { decodeCipherText, composeMagnetUrl, getUrlType } = require('./utils'); - -const baseUrl = 'https://www.domp4.cc'; +const { baseUrl, decodeCipherText, composeMagnetUrl, getUrlType } = require('./utils'); function getItemList($, detailUrl) { const encoded = $('.article script[type]') diff --git a/lib/v2/domp4/latest.js b/lib/v2/domp4/latest.js index ffd0d8e5d..f6e40d801 100644 --- a/lib/v2/domp4/latest.js +++ b/lib/v2/domp4/latest.js @@ -1,8 +1,9 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); -const baseUrl = 'https://www.domp4.cc'; -const latestUrl = 'https://www.domp4.cc/custom/update.html'; +const { baseUrl } = require('./utils'); + +const latestUrl = `${baseUrl}/custom/update.html`; function getItemList($, type) { const list = $(`#${type} .list-group-item`) diff --git a/lib/v2/domp4/utils.js b/lib/v2/domp4/utils.js index 087a9a2a3..9c93a1124 100644 --- a/lib/v2/domp4/utils.js +++ b/lib/v2/domp4/utils.js @@ -1,3 +1,5 @@ +const baseUrl = 'https://www.mp4kan.com'; + /** * trackers from https://www.domp4.cc/Style/2020/js/base.js?v=2 */ @@ -79,6 +81,7 @@ function decodeCipherText(p, a, c, k, e, d) { } module.exports = { + baseUrl, magnetTrackers, getUrlType, composeMagnetUrl,