mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-21 08:52:02 +00:00
fix: dont exclude torrents if user is using external player
This commit is contained in:
parent
32d1d03d11
commit
3eb349c31e
3 changed files with 21 additions and 19 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
import { settings } from '@/modules/settings.js'
|
import { settings } from '@/modules/settings.js'
|
||||||
import { exclusions } from '../rss.js'
|
|
||||||
import { sleep } from '../util.js'
|
import { sleep } from '../util.js'
|
||||||
import { anilistClient } from '../anilist.js'
|
import { anilistClient } from '../anilist.js'
|
||||||
import { anitomyscript } from '../anime.js'
|
import { anitomyscript } from '../anime.js'
|
||||||
|
|
@ -10,6 +9,22 @@ import Debug from 'debug'
|
||||||
|
|
||||||
const debug = Debug('ui:extensions')
|
const debug = Debug('ui:extensions')
|
||||||
|
|
||||||
|
const exclusions = ['DTS', 'TrueHD', '[EMBER]']
|
||||||
|
const isDev = location.hostname === 'localhost'
|
||||||
|
|
||||||
|
const video = document.createElement('video')
|
||||||
|
|
||||||
|
if (!isDev && !video.canPlayType('video/mp4; codecs="hev1.1.6.L93.B0"')) {
|
||||||
|
exclusions.push('HEVC', 'x265', 'H.265')
|
||||||
|
}
|
||||||
|
if (!isDev && !video.canPlayType('audio/mp4; codecs="ac-3"')) {
|
||||||
|
exclusions.push('AC3', 'AC-3')
|
||||||
|
}
|
||||||
|
if (!('audioTracks' in HTMLVideoElement.prototype)) {
|
||||||
|
exclusions.push('DUAL')
|
||||||
|
}
|
||||||
|
video.remove()
|
||||||
|
|
||||||
/** @typedef {import('@thaunknown/ani-resourced/sources/types.d.ts').Options} Options */
|
/** @typedef {import('@thaunknown/ani-resourced/sources/types.d.ts').Options} Options */
|
||||||
/** @typedef {import('@thaunknown/ani-resourced/sources/types.d.ts').Result} Result */
|
/** @typedef {import('@thaunknown/ani-resourced/sources/types.d.ts').Result} Result */
|
||||||
|
|
||||||
|
|
@ -40,7 +55,7 @@ export default async function getResultsFromExtensions ({ media, episode, batch,
|
||||||
anidbEid,
|
anidbEid,
|
||||||
titles: createTitles(media),
|
titles: createTitles(media),
|
||||||
resolution,
|
resolution,
|
||||||
exclusions
|
exclusions: settings.value.enableExternal ? [] : exclusions
|
||||||
}
|
}
|
||||||
|
|
||||||
const { results, errors } = await worker.query(options, { movie, batch }, settings.value.sources)
|
const { results, errors } = await worker.query(options, { movie, batch }, settings.value.sources)
|
||||||
|
|
|
||||||
|
|
@ -10,22 +10,6 @@ import Debug from 'debug'
|
||||||
|
|
||||||
const debug = Debug('ui:rss')
|
const debug = Debug('ui:rss')
|
||||||
|
|
||||||
export const exclusions = ['DTS', 'TrueHD', '[EMBER]']
|
|
||||||
const isDev = location.hostname === 'localhost'
|
|
||||||
|
|
||||||
const video = document.createElement('video')
|
|
||||||
|
|
||||||
if (!isDev && !video.canPlayType('video/mp4; codecs="hev1.1.6.L93.B0"')) {
|
|
||||||
exclusions.push('HEVC', 'x265', 'H.265')
|
|
||||||
}
|
|
||||||
if (!isDev && !video.canPlayType('audio/mp4; codecs="ac-3"')) {
|
|
||||||
exclusions.push('AC3', 'AC-3')
|
|
||||||
}
|
|
||||||
if (!('audioTracks' in HTMLVideoElement.prototype)) {
|
|
||||||
exclusions.push('DUAL')
|
|
||||||
}
|
|
||||||
video.remove()
|
|
||||||
|
|
||||||
export function parseRSSNodes (nodes) {
|
export function parseRSSNodes (nodes) {
|
||||||
return nodes.map(item => {
|
return nodes.map(item => {
|
||||||
const pubDate = item.querySelector('pubDate')?.textContent
|
const pubDate = item.querySelector('pubDate')?.textContent
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import { SUPPORTS } from '@/modules/support.js'
|
import { SUPPORTS } from '@/modules/support.js'
|
||||||
|
import { enable } from './debug.js'
|
||||||
|
|
||||||
export function countdown (s) {
|
export function countdown (s) {
|
||||||
const d = Math.floor(s / (3600 * 24))
|
const d = Math.floor(s / (3600 * 24))
|
||||||
|
|
@ -153,7 +154,9 @@ export const defaults = {
|
||||||
angle: 'default',
|
angle: 'default',
|
||||||
toshoURL: SUPPORTS.extensions ? decodeURIComponent(atob('aHR0cHM6Ly9mZWVkLmFuaW1ldG9zaG8ub3JnLw==')) : '',
|
toshoURL: SUPPORTS.extensions ? decodeURIComponent(atob('aHR0cHM6Ly9mZWVkLmFuaW1ldG9zaG8ub3JnLw==')) : '',
|
||||||
extensions: SUPPORTS.extensions ? ['@thaunknown/ani-resourced'] : [],
|
extensions: SUPPORTS.extensions ? ['@thaunknown/ani-resourced'] : [],
|
||||||
sources: {}
|
sources: {},
|
||||||
|
enableExternal: false,
|
||||||
|
playerPath: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
export const subtitleExtensions = ['srt', 'vtt', 'ass', 'ssa', 'sub', 'txt']
|
export const subtitleExtensions = ['srt', 'vtt', 'ass', 'ssa', 'sub', 'txt']
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue