Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiram committed Feb 12, 2023
1 parent 3cb0352 commit 6b1189f
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 140 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@

| 影视 (首页) | 影视 (播放) |
| :----------------------------------------------------------: | :----------------------------------------------------------: |
| ![影视.png](https://s2.loli.net/2023/02/05/TsVWZX8l4noyAcr.png) | ![影视播放.png](https://s2.loli.net/2023/02/05/14GkXsrREcCgVd3.png) |
| ![影视.png](https://s2.loli.net/2023/02/11/A9x8hzm6QvPtdug.png) | ![影视播放.png](https://s2.loli.net/2023/02/05/14GkXsrREcCgVd3.png) |
| 热榜 | 详情 |
| ![热榜.png](https://s2.loli.net/2023/02/05/pkwsKzb9MAiDmZu.png) | ![详情.png](https://s2.loli.net/2023/02/05/G9UPHy3M4ZiNAWd.png) |
| ![热榜.png](https://s2.loli.net/2023/02/11/uqC4XxJHcEhjdzD.png) | ![详情.png](https://s2.loli.net/2023/02/05/G9UPHy3M4ZiNAWd.png) |
| 直播(首页) | 直播(播放) |
| ![直播首页.png](https://s2.loli.net/2023/02/05/4mAFrboezVD1KNt.png) | ![直播播放.png](https://s2.loli.net/2023/02/05/pBnAQYg49bwZDlr.png) |
| 历史记录 | 解析(播放) |
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"prepare": "node -e \"if(require('fs').existsSync('.git')){process.exit(1)}\" || is-ci || husky install",
"lint": "eslint --ext .vue,.js,.jsx,.ts,.tsx ./ --max-warnings 0",
"lint:fix": "eslint --ext .vue,.js,jsx,.ts,.tsx ./ --max-warnings 0 --fix",
"electron": "wait-on tcp:3000 && cross-env NODE_ENV=development electron .",
"electron": "wait-on tcp:3000 && cross-env NODE_ENV=development electron . --enable-logging",
"electron:serve": "concurrently -k \"yarn dev\" \"yarn electron\"",
"electron:build-win": "vite build && electron-builder --win --config",
"electron:build-win": "vite build && electron-builder --win --ia32 --config",
"electron:build-mac": "vite build && electron-builder --mac --config",
"electron:build-linux": "vite build && electron-builder --linux --config"
},
Expand Down Expand Up @@ -57,6 +57,7 @@
"concurrently": "^7.6.0",
"cross-env": "^7.0.3",
"dexie": "^3.2.2",
"electron-store": "^8.1.0",
"fast-xml-parser": "^4.0.13",
"file-saver": "^2.0.5",
"iptv-playlist-parser": "^0.12.2",
Expand All @@ -68,15 +69,14 @@
"qrcode": "^1.5.1",
"tdesign-icons-vue-next": "^0.1.7",
"tdesign-vue-next": "^1.0.6",
"uuid-by-string": "^4.0.0",
"v3-infinite-loading": "^1.2.2",
"vite-plugin-require-transform": "^1.0.4",
"vite-svg-loader": "^3.6.0",
"vue": "^3.2.37",
"vue-clipboard3": "^2.0.0",
"vue-eslint-parser": "^9.1.0",
"vue-router": "^4.1.6",
"vue-waterfall-plugin-next": "^2.1.11",
"vue3-uuid": "^1.0.0",
"wait-on": "^7.0.1",
"xgplayer": "^2.32.2",
"xgplayer-flv.js": "^2.3.0",
Expand Down Expand Up @@ -104,6 +104,7 @@
"prettier": "^2.8.1",
"typescript": "^4.6.4",
"vite": "^3.0.0",
"vue-eslint-parser": "^9.1.0",
"vue-tsc": "^0.40.4"
}
}
1 change: 1 addition & 0 deletions src/config/play.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ export default {
key: '',
img: '',
epg: '',
watchTime: 0,
},
};
52 changes: 3 additions & 49 deletions src/lib/site/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios from 'axios';
import { XMLParser } from 'fast-xml-parser';
import * as cheerio from 'cheerio';
import { Parser as M3u8Parser } from 'm3u8-parser';
import { forEach, zipObject } from 'lodash';
import _ from 'lodash';
const { getCurrentWindow } = window.require('@electron/remote');
// // import FLVDemuxer from 'xgplayer-flv.js/src/flv/demux/flv-demuxer.js'
// import SocksProxyAgent from 'socks-proxy-agent'
Expand Down Expand Up @@ -251,7 +251,6 @@ const zy = {
if (json && jsondata.total > 0) {
let videoList = jsondata.list
if (Object.prototype.toString.call(videoList) === '[object Object]') videoList = [].concat(videoList)
// videoList = videoList?.filter(e => e.name.toLowerCase().includes(wd.toLowerCase()))
if (videoList?.length) {
resolve(videoList)
} else {
Expand Down Expand Up @@ -285,8 +284,6 @@ const zy = {
if (jsondata|| jsondata?.list) {
let videoList = jsondata.list
if (Object.prototype.toString.call(videoList) === '[object Object]') videoList = [].concat(videoList)
// videoList = videoList?.filter(e => e.vod_name.toLowerCase().includes(wd.toLowerCase()))
// console.log(videoList)
if (videoList?.length) {
this.detail(key, videoList[0].vod_id).then(detailRes => {
resolve(detailRes)
Expand Down Expand Up @@ -329,7 +326,7 @@ const zy = {
const playUrl = videoList.vod_play_url;
const playUrlDiffPlaySource = playUrl.split('$$$') // 分离不同播放源
let playEpisodes = []
forEach(playUrlDiffPlaySource, (item) => {
_.forEach(playUrlDiffPlaySource, (item) => {
const playContont = item
.replace(/\$+/g, '$')
.split('#')
Expand All @@ -339,51 +336,8 @@ const zy = {
});

// 合并播放源和剧集
const fullList= zipObject(playSource, playEpisodes)
const fullList= _.zipObject(playSource, playEpisodes)
videoList.fullList = fullList
// let fullList = []
// let index = 0
// const supportedFormats = ['m3u8', 'mp4']
// const dd = videoList.dl.dd
// const type = Object.prototype.toString.call(dd)
// if (type === '[object Array]') {
// for (const i of dd) {
// i._t = i._t.replace(/\$+/g, '$')
// const ext = Array.from(new Set(...i._t.split('#').map(e => e.includes('$') ? e.split('$')[1].match(/\.\w+?$/) : e.match(/\.\w+?$/)))).map(e => e.slice(1))
// if (ext.length && ext.length <= supportedFormats.length && ext.every(e => supportedFormats.includes(e))) {
// if (ext.length === 1) {
// i._flag = ext[0]
// } else {
// i._flag = index ? 'ZY支持-' + index : 'ZY支持'
// index++
// }
// }
// fullList.push(
// {
// flag: i._flag,
// list: i._t.split('#').filter(e => e && (e.startsWith('http') || (e.split('$')[1] && e.split('$')[1].startsWith('http'))))
// }
// )
// }
// } else {
// fullList.push(
// {
// flag: dd._flag,
// list: dd._t.replace(/\$+/g, '$').split('#').filter(e => e && (e.startsWith('http') || (e.split('$')[1] && e.split('$')[1].startsWith('http'))))
// }
// )
// }
// fullList.forEach(item => {
// if (item.list.every(e => e.includes('$') && /^\s*\d+\s*$/.test(e.split('$')[0]))) item.list.sort((a, b) => { return a.split('$')[0] - b.split('$')[0] })
// })
// if (fullList.length > 1) { // 将ZY支持的播放列表前置
// index = fullList.findIndex(e => supportedFormats.includes(e.flag) || e.flag.startsWith('ZY支持'))
// if (index !== -1) {
// const first = fullList.splice(index, 1)
// fullList = first.concat(fullList)
// }
// }
// videoList.fullList = fullList
resolve(videoList)
}).catch(err => {
reject(err)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Film.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
</div>
</div>
<detail-view v-model:visible="formDialogDetail" :info="formDetailData" :site="formSiteData" />
<!-- <hot-view v-model:visible="formDialogHot" :site="FilmSiteSetting.basic" /> -->
<hot-view v-model:visible="formDialogHot" :site="FilmSiteSetting.basic" />
<privacy-policy-view v-model:visible="formDialogPrivacyPolicy" />
</div>
</template>
Expand Down
Loading

0 comments on commit 6b1189f

Please sign in to comment.