Merge pull request #29 from stratuma/v1.2.2

V1.2.2
This commit is contained in:
Stratum 2024-06-22 23:01:17 +02:00 committed by GitHub
commit 90cae4ad71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 77 additions and 54 deletions

View File

@ -26,13 +26,13 @@
<option :value="4">XBOX One (DRM PROTECTED)</option>
<option :value="5">Firefox (DRM PROTECTED)</option>
<option :value="6">Edge (DRM PROTECTED)</option>
<option :value="7">Safari (DRM PROTECTED)</option>
<option :value="8">Chrome (DRM PROTECTED)</option>
<option :value="9">Web Fallback (DRM PROTECTED)</option>
<option :value="10">Iphone (DRM PROTECTED)</option>
<option :value="11">Ipad (DRM PROTECTED)</option>
<option :value="12">Android (DRM PROTECTED)</option>
<option :value="13">Samsung TV (DRM PROTECTED)</option>
<!-- <option :value="7">Safari (DRM PROTECTED)</option> -->
<option :value="7">Chrome (DRM PROTECTED)</option>
<option :value="8">Web Fallback (DRM PROTECTED)</option>
<!-- <option :value="10">Iphone (DRM PROTECTED)</option>
<option :value="11">Ipad (DRM PROTECTED)</option> -->
<option :value="9">Android (DRM PROTECTED)</option>
<option :value="10">Samsung TV (DRM PROTECTED)</option>
</select>
<div class="text-xs mt-2"> Fallback to non-drm stream if no widevine key provided </div>
</div>

View File

@ -113,7 +113,8 @@ const locales = ref<Array<{ locale: string; name: string }>>([
{ locale: 'th-TH', name: 'TH' },
{ locale: 'vi-VN', name: 'VI' },
{ locale: 'id-ID', name: 'ID' },
{ locale: 'ko-KR', name: 'KO' }
{ locale: 'ko-KR', name: 'KO' },
{ locale: 'zh-CN', name: 'CN' },
])
const selectedVideoQuality = ref<number>()

View File

@ -387,7 +387,8 @@ const locales = ref<Array<{ locale: string; name: string }>>([
{ locale: 'th-TH', name: 'TH' },
{ locale: 'vi-VN', name: 'VI' },
{ locale: 'id-ID', name: 'ID' },
{ locale: 'ko-KR', name: 'KO' }
{ locale: 'ko-KR', name: 'KO' },
{ locale: 'zh-CN', name: 'CN' },
])
const isProduction = process.env.NODE_ENV !== 'development'

View File

@ -372,38 +372,38 @@ export async function crunchyGetPlaylist(q: string, geo: string | undefined) {
name: 'Edge',
url: `/web/edge/play`
},
// {
// id: 7,
// name: 'Safari',
// url: `/web/safari/play`
// },
{
id: 7,
name: 'Safari',
url: `/web/safari/play`
},
{
id: 8,
name: 'Chrome',
url: `/web/chrome/play`
},
{
id: 9,
id: 8,
name: 'Web Fallback',
url: `/web/fallback/play`
},
// {
// id: 10,
// name: 'Iphone',
// url: `/ios/iphone/play`
// },
// {
// id: 11,
// name: 'Ipad',
// url: `/ios/ipad/play`
// },
{
id: 10,
name: 'Iphone',
url: `/ios/iphone/play`
},
{
id: 11,
name: 'Ipad',
url: `/ios/ipad/play`
},
{
id: 12,
id: 9,
name: 'Android',
url: `/android/phone/play`
},
{
id: 13,
id: 10,
name: 'Samsung TV',
url: `/tv/samsung/play`
}

View File

@ -636,36 +636,43 @@ export async function downloadCrunchyrollPlaylist(
}
if (!subPlaylist) {
await updatePlaylistByID(downloadID, 'failed')
console.log('Subtitle Playlist not found')
messageBox('error', ['Cancel'], 2, 'Subtitle Playlist not found', 'Subtitle Playlist not found', 'Subtitle Playlist not found')
console.log(`Subtitle Playlist for ${s} not found, skipping`)
messageBox(
'warning',
['Cancel'],
2,
`Subtitle Playlist for ${s} not found`,
`Subtitle Playlist for ${s} not found`,
`Sub Playlist for ${s} not found, skipping download`
)
server.logger.log({
level: 'error',
message: 'Subtitle Playlist not found',
message: `Subtitle Playlist for ${s} not found, skipping`,
timestamp: new Date().toISOString(),
section: 'crunchyrollDownloadProcess'
section: 'crunchyrollSubtitleDownloadProcess'
})
return
}
const found = subPlaylist.data.subtitles.find((sub) => sub.language === s)
if (found) {
subDownloadList.push({ ...found, isDub: false })
console.log(`Subtitle ${s}.ass found, adding to download`)
server.logger.log({
level: 'info',
message: `Subtitle ${s}.ass found in Download ${downloadID}, adding to download`,
timestamp: new Date().toISOString(),
section: 'crunchyrollDownloadProcessSubtitles'
})
} else {
console.warn(`Subtitle ${s}.ass not found, skipping`)
server.logger.log({
level: 'warn',
message: `Subtitle ${s}.ass not found in Download ${downloadID}, skipping`,
timestamp: new Date().toISOString(),
section: 'crunchyrollDownloadProcessSubtitles'
})
if (subPlaylist) {
const found = subPlaylist.data.subtitles.find((sub) => sub.language === s)
if (found) {
subDownloadList.push({ ...found, isDub: false })
console.log(`Subtitle ${s}.ass found, adding to download`)
server.logger.log({
level: 'info',
message: `Subtitle ${s}.ass found in Download ${downloadID}, adding to download`,
timestamp: new Date().toISOString(),
section: 'crunchyrollDownloadProcessSubtitles'
})
} else {
console.warn(`Subtitle ${s}.ass not found, skipping`)
server.logger.log({
level: 'warn',
message: `Subtitle ${s}.ass not found in Download ${downloadID}, skipping`,
timestamp: new Date().toISOString(),
section: 'crunchyrollDownloadProcessSubtitles'
})
}
}
}

View File

@ -40,8 +40,6 @@ export async function createChapterFile(rawchapters: VideoMetadata, dir: string,
var chapters: string[] = []
chapters.push(';FFMETADATA1')
chapters.push(`title=${mediaid}`)
chapters.push(`artist=Crunchyroll`)
chapters.push(``)
if (rawchapters.intro && rawchapters.intro.type && rawchapters.intro.start && rawchapters.intro.end) {

View File

@ -134,7 +134,7 @@ function resamplePOSSubtitle(subtitle: string, ox: number, oy: number, nx: numbe
}
if (line.includes('\\fs')) {
let posMatches = line.matchAll(/\\fs(-?\d+(?:\.\d+)?)/g)
let posMatches = line.matchAll(/\\fs(\d+(?:\.\d+)?)/g)
for (let posMatch of posMatches) {
let font = parseInt(posMatch[1])
let newFontSize = Math.round((font / oy) * ny)
@ -154,6 +154,22 @@ function resamplePOSSubtitle(subtitle: string, ox: number, oy: number, nx: numbe
}
lines[i] = line
}
if (line.match(/m\s|l\s/)) {
let posMatches = line.matchAll(/([ml])\s*(-?\d+(?:\.\d+)?)\s*(-?\d+(?:\.\d+)?)/g)
for (let posMatch of posMatches) {
let command = posMatch[1]
let oldX = parseFloat(posMatch[2])
let oldY = parseFloat(posMatch[3])
let newX = Math.round((oldX / ox) * nx)
let newY = Math.round((oldY / oy) * ny)
let newCommand = `${command} ${newX} ${newY}`
line = line.replace(posMatch[0], newCommand)
}
lines[i] = line
}
}
return lines.join('\n')