diff --git a/meta.template b/meta.template index fbfda42..14994cc 100644 --- a/meta.template +++ b/meta.template @@ -19,6 +19,7 @@ // @include https://pro.ascepan.top/* // @include https://danmu.yhdmjx.com/* // @include https://www.odcoc.com/* +// @include https://*.sp-flv.com* // @run-at document-end // @require https://unpkg.com/jquery@3.6.0/dist/jquery.min.js // @require https://unpkg.com/plyr@3.6.4/dist/plyr.min.js diff --git a/package.json b/package.json index 7968d3c..ca37260 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "devDependencies": { "@types/jquery": "^3.5.14", "@types/lodash-es": "^4.17.6", - "bocchi": "^1.1.1", + "bocchi": "^1.1.3", "gh-pages": "^3.2.3", "husky": "^6.0.0", "lint-staged": "^11.2.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 42a36b4..fa33546 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,7 +4,7 @@ specifiers: '@ironkinoko/danmaku': 1.4.1 '@types/jquery': ^3.5.14 '@types/lodash-es': ^4.17.6 - bocchi: ^1.1.1 + bocchi: ^1.1.3 gh-pages: ^3.2.3 hls.js: 1.0.9 husky: ^6.0.0 @@ -24,7 +24,7 @@ dependencies: devDependencies: '@types/jquery': 3.5.14 '@types/lodash-es': 4.17.6 - bocchi: 1.1.1 + bocchi: 1.1.3 gh-pages: 3.2.3 husky: 6.0.0 lint-staged: 11.2.6 @@ -418,10 +418,10 @@ packages: engines: { node: '>=8' } dev: true - /bocchi/1.1.1: + /bocchi/1.1.3: resolution: { - integrity: sha512-DRGh4lBqWrkp7VKdVjfAfUtzl6lBGm45mQwP0BJ4JyUpMq89M5hTtS6hzrzuufcNUdJR6JlEoCNJiWDZTBdrtg==, + integrity: sha512-YZKbxVqiniOxzkF0JrhcMyjOwRwW5264ZVnMWtYhp/sYwE6nipoeP/hwMbAkmAbueWcpXsLbQjcajrDgCODKZw==, } hasBin: true dependencies: @@ -438,6 +438,7 @@ packages: rollup: 3.4.0 rollup-plugin-esbuild: 5.0.0_gy77k6wisfmkvlklwxkgcpqdui sass: 1.56.1 + slash: 5.1.0 yargs: 17.6.2 transitivePeerDependencies: - supports-color @@ -3151,6 +3152,14 @@ packages: } dev: true + /slash/5.1.0: + resolution: + { + integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==, + } + engines: { node: '>=14.16' } + dev: true + /slice-ansi/3.0.0: resolution: { diff --git a/src/adapter/_iframe_player_parser/index.ts b/src/adapter/_iframe_player_parser/index.ts index de03559..f74053b 100644 --- a/src/adapter/_iframe_player_parser/index.ts +++ b/src/adapter/_iframe_player_parser/index.ts @@ -3,7 +3,7 @@ import { parser } from './parser' // 这是个解析器网站,里面只有一个播放器。将其替换成 KPlayer runtime.register({ - domains: ['pro.ascepan.top', 'danmu.yhdmjx.com'], + domains: ['pro.ascepan.top', 'danmu.yhdmjx.com', 'sp-flv.com'], opts: [ { test: () => window.location.href.includes('danmu.yhdmjx.com/m3u8.php'), @@ -15,6 +15,11 @@ runtime.register({ runInIframe: true, run: parser['pro.ascepan.top'], }, + { + test: () => !!window.location.href.match(/sp-flv\.com.*url=/), + runInIframe: true, + run: parser['sp-flv.com'], + }, ], search: { getSearchName: () => { diff --git a/src/adapter/_iframe_player_parser/parser.ts b/src/adapter/_iframe_player_parser/parser.ts index 15100e0..69c9403 100644 --- a/src/adapter/_iframe_player_parser/parser.ts +++ b/src/adapter/_iframe_player_parser/parser.ts @@ -1,6 +1,7 @@ import { KPlayer } from '../../player' import { execInUnsafeWindow } from '../../utils/execInUnsafeWindow' import { queryDom } from '../../utils/queryDom' +import { wait } from '../../utils/wait' let player: KPlayer @@ -22,4 +23,30 @@ export const parser = { player = new KPlayer('#player', { eventToParentWindow: true }) player.src = await execInUnsafeWindow(() => window.config.url) }, + 'sp-flv.com': async () => { + const video = await queryDom('video') + + await wait(() => !!video.currentSrc) + let url = video.currentSrc + + if (url.startsWith('blob:')) { + url = await execInUnsafeWindow(() => window.video_url) + + if (url) { + video.src = '' + player = new KPlayer('#mplayer-media-wrapper', { + eventToParentWindow: true, + }) + player.src = url + } + } else { + video.src = '' + player = new KPlayer('#mplayer-media-wrapper', { + eventToParentWindow: true, + }) + player.src = url + } + + console.log("🚀 ~ file: parser.ts:29 ~ 'vip.sp-flv.com': ~ url:", url) + }, } diff --git a/src/adapter/agefans/index.scss b/src/adapter/agefans/index.scss index 61f92af..e69de29 100644 --- a/src/adapter/agefans/index.scss +++ b/src/adapter/agefans/index.scss @@ -1,47 +0,0 @@ -.agefans-wrapper { - .loginout a { - cursor: pointer; - text-decoration: underline; - } - .loginout a + a { - margin-left: 8px; - } - .nav_button { - cursor: pointer; - } - .res_links { - word-break: break-all; - word-wrap: break-word; - } -} - -@media (max-width: 576px) { - .nav_button:nth-child(n + 6) { - display: inline-block; - } - - #nav { - position: relative; - overflow-x: auto; - white-space: nowrap; - height: 91px; - &::-webkit-scrollbar { - display: none; - } - .nav_button { - white-space: nowrap; - } - } - - #top_search_from { - width: calc(100% - 16px); - float: left; - margin-top: 10px; - position: sticky; - left: 8px; - margin: 8px; - } - #new_tip1 { - margin-top: 10px !important; - } -} diff --git a/src/adapter/agefans/index.ts b/src/adapter/agefans/index.ts index f777f52..20d85e8 100644 --- a/src/adapter/agefans/index.ts +++ b/src/adapter/agefans/index.ts @@ -1,13 +1,6 @@ import { runtime } from '../../runtime/index' import './index.scss' -import { detailModule } from './pages/detail' -import { historyModule } from './pages/history' -import { homeModule } from './pages/home' -import { playModule } from './pages/play' -import { rankModule } from './pages/rank' -import { recommendModule } from './pages/recommend' -import { settingModule } from './pages/setting' -import { updateModule } from './pages/update' +import { playModule } from './play' runtime.register({ domains: ['age.tv', 'agemys', 'agefans', 'agedm'], @@ -16,25 +9,12 @@ runtime.register({ test: '*', run: () => { $('body').addClass('agefans-wrapper') - if (process.env.NODE_ENV === 'development') { - document.cookie = 'username=admin; path=/; max-age=99999999;' - } - - settingModule() - historyModule() }, }, { test: '/play', run: playModule }, - { test: '/detail', run: detailModule }, - { test: '/recommend', run: recommendModule }, - { test: '/update', run: updateModule }, - { test: '/rank', run: rankModule }, - { test: /^\/$/, run: homeModule }, ], search: { name: 'agefans', - search: (name) => `https://www.agemys.net/search?query=${name}&page=1`, - getSearchName: () => $('#detailname a').text(), - getEpisode: () => $("li a[style*='color: rgb(238, 0, 0)']").text(), + search: (name) => `https://www.agefans.com/search?query=${name}`, }, }) diff --git a/src/adapter/agefans/pages/detail.ts b/src/adapter/agefans/pages/detail.ts deleted file mode 100644 index 8c84eaf..0000000 --- a/src/adapter/agefans/pages/detail.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { pagePreview } from '../utils/pagePreview' -function renderHistroyStyle() { - $('