mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-11 11:05:56 +08:00
修复设置默认解析网址
This commit is contained in:
@@ -342,7 +342,7 @@ export default {
|
|||||||
videoTitle: true,
|
videoTitle: true,
|
||||||
airplay: true,
|
airplay: true,
|
||||||
closeVideoTouch: true,
|
closeVideoTouch: true,
|
||||||
ignores: ['cssFullscreen', 'replay', 'error'], // 为了切换播放器类型时避免显示错误刷新,暂时忽略错误
|
ignores: ['replay', 'error'], // 为了切换播放器类型时避免显示错误刷新,暂时忽略错误
|
||||||
preloadTime: 300
|
preloadTime: 300
|
||||||
},
|
},
|
||||||
state: {
|
state: {
|
||||||
|
|||||||
@@ -173,7 +173,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="closeDialog">取消</el-button>
|
<el-button @click="closeDialog">取消</el-button>
|
||||||
<el-button type="danger" @click="get7kParseURL">重置</el-button>
|
<el-button type="danger" @click="resetDefaultParseURL">重置</el-button>
|
||||||
<el-button type="primary" @click="configDefaultParseURL">确定</el-button>
|
<el-button type="primary" @click="configDefaultParseURL">确定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -187,7 +187,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="closeDialog">取消</el-button>
|
<el-button @click="closeDialog">取消</el-button>
|
||||||
<el-button type="danger" @click="getDefaultdeSitesDataURL">重置</el-button>
|
<el-button type="danger" @click="resetDefaultSitesDataURL">重置</el-button>
|
||||||
<el-button type="primary" @click="configSitesDataURL">确定</el-button>
|
<el-button type="primary" @click="configSitesDataURL">确定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@@ -334,7 +334,7 @@ export default {
|
|||||||
this.d = res
|
this.d = res
|
||||||
this.setting = this.d
|
this.setting = this.d
|
||||||
if (!this.setting.defaultParseURL) this.configDefaultParseURL()
|
if (!this.setting.defaultParseURL) this.configDefaultParseURL()
|
||||||
if (!this.setting.sitesDataURL) this.getDefaultdeSitesDataURL()
|
if (!this.setting.sitesDataURL) this.resetDefaultSitesDataURL()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getDefaultSites () {
|
getDefaultSites () {
|
||||||
@@ -380,24 +380,20 @@ export default {
|
|||||||
this.d.excludeRootClasses = !this.d.excludeRootClasses
|
this.d.excludeRootClasses = !this.d.excludeRootClasses
|
||||||
this.updateSettingEvent()
|
this.updateSettingEvent()
|
||||||
},
|
},
|
||||||
async get7kParseURL () {
|
async resetDefaultParseURL () {
|
||||||
const parseURL = await zy.get7kParseURL()
|
this.setting.defaultParseURL = 'https://jx.bpba.cc/?v='
|
||||||
if (parseURL.startsWith('http')) {
|
|
||||||
this.$message.success('获取成功,更新应用默认解析接口地址...')
|
|
||||||
this.setting.defaultParseURL = parseURL
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
async configDefaultParseURL () {
|
async configDefaultParseURL () {
|
||||||
if (!this.setting.defaultParseURL) await this.get7kParseURL()
|
if (!this.setting.defaultParseURL) await this.resetDefaultParseURL()
|
||||||
this.d.defaultParseURL = this.setting.defaultParseURL?.trim()
|
this.d.defaultParseURL = this.setting.defaultParseURL?.trim()
|
||||||
this.show.configDefaultParseUrlDialog = false
|
this.show.configDefaultParseUrlDialog = false
|
||||||
this.updateSettingEvent()
|
this.updateSettingEvent()
|
||||||
},
|
},
|
||||||
getDefaultdeSitesDataURL () {
|
resetDefaultSitesDataURL () {
|
||||||
this.setting.sitesDataURL = 'https://gitee.com/cuiocean/ZY-Player-Resources/raw/main/Sites/Sites.json'
|
this.setting.sitesDataURL = 'https://gitee.com/cuiocean/ZY-Player-Resources/raw/main/Sites/Sites.json'
|
||||||
},
|
},
|
||||||
configSitesDataURL () {
|
configSitesDataURL () {
|
||||||
if (!this.setting.sitesDataURL) this.getDefaultdeSitesDataURL()
|
if (!this.setting.sitesDataURL) this.resetDefaultSitesDataURL()
|
||||||
this.d.sitesDataURL = this.setting.sitesDataURL
|
this.d.sitesDataURL = this.setting.sitesDataURL
|
||||||
this.show.configSitesDataUrlDialog = false
|
this.show.configSitesDataUrlDialog = false
|
||||||
this.updateSettingEvent()
|
this.updateSettingEvent()
|
||||||
|
|||||||
@@ -90,6 +90,17 @@ db.version(11).stores({
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
db.version(11).stores({
|
||||||
|
setting: 'id, theme, shortcut, view, volume, externalPlayer, searchGroup, excludeRootClasses, excludeR18Films, forwardTimeInSec, starViewMode, recommandationViewMode,' +
|
||||||
|
'searchViewMode, password, proxy, allowPassWhenIptvCheck, autocleanWhenIptvCheck, rootClassFilter, r18ClassFilter, classFilter, restoreWindowPositionAndSize,' +
|
||||||
|
'windowPositionAndSize, pauseWhenMinimize, sitesDataURL, defaultParseURL'
|
||||||
|
}).upgrade(trans => {
|
||||||
|
trans.setting.toCollection().modify(setting => {
|
||||||
|
setting.sitesDataURL = 'https://gitee.com/cuiocean/ZY-Player-Resources/raw/main/Sites/Sites.json'
|
||||||
|
setting.defaultParseURL = 'https://jx.bpba.cc/?v='
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
db.on('populate', () => {
|
db.on('populate', () => {
|
||||||
db.setting.bulkAdd(iniSetting)
|
db.setting.bulkAdd(iniSetting)
|
||||||
db.sites.bulkAdd(sites)
|
db.sites.bulkAdd(sites)
|
||||||
|
|||||||
@@ -563,15 +563,6 @@ const zy = {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
get7kParseURL () {
|
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
axios.get('https://zy.7kjx.com/').then(res => {
|
|
||||||
const $ = cheerio.load(res.data)
|
|
||||||
const parseURL = $('body > div.container > div > div.stui-pannel > div.col-pd > p:contains("解析接口:")').first().find('a').text()
|
|
||||||
resolve(parseURL)
|
|
||||||
}).catch(err => { reject(err) })
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getDefaultSites () {
|
getDefaultSites () {
|
||||||
const url = 'https://gitee.com/cuiocean/ZY-Player-Resources/raw/main/Sites/Sites.json'
|
const url = 'https://gitee.com/cuiocean/ZY-Player-Resources/raw/main/Sites/Sites.json'
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user