From 57c9ec67fb7015b96a2dc9dca7af462da831bd98 Mon Sep 17 00:00:00 2001 From: androidcn Date: Sun, 2 Mar 2025 13:46:24 +0800 Subject: [PATCH 1/3] Update Douban.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加 Loon TMDB参数传入 --- Douban.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Douban.js b/Douban.js index f046b2e..2f8ff9a 100644 --- a/Douban.js +++ b/Douban.js @@ -23,14 +23,16 @@ const url = $request.url const movieId = url.match(/subject\/(\d+)/)?.[1] const platform = url.includes('movie.douban.com') ? 'web' : 'mobile' -const tmdb_region = 'US' // TMDB 查询区域 -const tmdb_api_key = '' // TMDB API Key +// 获取外部传入的参数或使用默认值 +const tmdb_region = $argument ? JSON.parse($argument).region || 'US' : 'US' // TMDB 查询区域 +const tmdb_api_key = $argument ? JSON.parse($argument).api_key || '' : '' // TMDB API Key // 可自定义添加网站搜索(格式:['名称', '搜索链接', '图标链接'],%@ 代表电影标题) const watch_web_data = [ ['247看', 'https://247kan.com/search?q=%@', 'https://247kan.com/favicon.ico'], ['Cupfox', 'https://www.cupfox.in/search?q=%@', 'https://picx.zhimg.com/80/v2-de36e385e59fcca2df694b76f108431a.png'], - ['LIBIVO', 'https://www.libvio.fun/search/-------------.html?wd=%@', 'https://www.libvio.fun/statics/img/favicon.ico'] + ['LIBIVO', 'https://www.libvio.fun/search/-------------.html?wd=%@', 'https://www.libvio.fun/statics/img/favicon.ico'], + ['NEODB', 'https://neodb.social/search?q=%@', 'https://neodb.social/s/img/logo.svg'] ] function send_request(options, method = 'get') { From 6727ab82d939afdb8bc6ad84df0f1557fa0df38b Mon Sep 17 00:00:00 2001 From: androidcn Date: Sun, 2 Mar 2025 14:15:08 +0800 Subject: [PATCH 2/3] Update Douban.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修正错误 --- Douban.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Douban.js b/Douban.js index 2f8ff9a..2b76407 100644 --- a/Douban.js +++ b/Douban.js @@ -23,10 +23,21 @@ const url = $request.url const movieId = url.match(/subject\/(\d+)/)?.[1] const platform = url.includes('movie.douban.com') ? 'web' : 'mobile' -// 获取外部传入的参数或使用默认值 -const tmdb_region = $argument ? JSON.parse($argument).region || 'US' : 'US' // TMDB 查询区域 -const tmdb_api_key = $argument ? JSON.parse($argument).api_key || '' : '' // TMDB API Key - +let tmdb_region = 'US' // TMDB 查询区域 +let tmdb_api_key = '' // TMDB API Key + +// 安全解析参数 +if ($argument) { + try { + const arg = JSON.parse($argument) + if (typeof arg === 'object' && arg !== null) { + tmdb_region = arg.region || tmdb_region + tmdb_api_key = arg.api_key || tmdb_api_key + } + } catch (e) { + console.log('参数解析错误,使用默认值') + } +} // 可自定义添加网站搜索(格式:['名称', '搜索链接', '图标链接'],%@ 代表电影标题) const watch_web_data = [ ['247看', 'https://247kan.com/search?q=%@', 'https://247kan.com/favicon.ico'], From 80b7a26d49bb66ae0a004112b08594f2bb6108bc Mon Sep 17 00:00:00 2001 From: androidcn Date: Sun, 2 Mar 2025 14:57:55 +0800 Subject: [PATCH 3/3] Update Douban.js --- Douban.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Douban.js b/Douban.js index 2b76407..078b8e9 100644 --- a/Douban.js +++ b/Douban.js @@ -23,21 +23,9 @@ const url = $request.url const movieId = url.match(/subject\/(\d+)/)?.[1] const platform = url.includes('movie.douban.com') ? 'web' : 'mobile' -let tmdb_region = 'US' // TMDB 查询区域 -let tmdb_api_key = '' // TMDB API Key - -// 安全解析参数 -if ($argument) { - try { - const arg = JSON.parse($argument) - if (typeof arg === 'object' && arg !== null) { - tmdb_region = arg.region || tmdb_region - tmdb_api_key = arg.api_key || tmdb_api_key - } - } catch (e) { - console.log('参数解析错误,使用默认值') - } -} +const tmdb_region = $argument ? $argument.region || 'US' : 'US' // TMDB 查询区域 +const tmdb_api_key = $argument ? $argument.api_key || '' : '' // TMDB API Key + // 可自定义添加网站搜索(格式:['名称', '搜索链接', '图标链接'],%@ 代表电影标题) const watch_web_data = [ ['247看', 'https://247kan.com/search?q=%@', 'https://247kan.com/favicon.ico'],