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

View File

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

View File

@ -387,7 +387,8 @@ const locales = ref<Array<{ locale: string; name: string }>>([
{ locale: 'th-TH', name: 'TH' }, { locale: 'th-TH', name: 'TH' },
{ locale: 'vi-VN', name: 'VI' }, { locale: 'vi-VN', name: 'VI' },
{ locale: 'id-ID', name: 'ID' }, { 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' const isProduction = process.env.NODE_ENV !== 'development'

View File

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

View File

@ -636,18 +636,24 @@ export async function downloadCrunchyrollPlaylist(
} }
if (!subPlaylist) { if (!subPlaylist) {
await updatePlaylistByID(downloadID, 'failed') console.log(`Subtitle Playlist for ${s} not found, skipping`)
console.log('Subtitle Playlist not found') messageBox(
messageBox('error', ['Cancel'], 2, 'Subtitle Playlist not found', 'Subtitle Playlist not found', 'Subtitle Playlist not found') '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({ server.logger.log({
level: 'error', level: 'error',
message: 'Subtitle Playlist not found', message: `Subtitle Playlist for ${s} not found, skipping`,
timestamp: new Date().toISOString(), timestamp: new Date().toISOString(),
section: 'crunchyrollDownloadProcess' section: 'crunchyrollSubtitleDownloadProcess'
}) })
return
} }
if (subPlaylist) {
const found = subPlaylist.data.subtitles.find((sub) => sub.language === s) const found = subPlaylist.data.subtitles.find((sub) => sub.language === s)
if (found) { if (found) {
subDownloadList.push({ ...found, isDub: false }) subDownloadList.push({ ...found, isDub: false })
@ -668,6 +674,7 @@ export async function downloadCrunchyrollPlaylist(
}) })
} }
} }
}
await updatePlaylistByID(downloadID, 'waiting for dub playlist') await updatePlaylistByID(downloadID, 'waiting for dub playlist')

View File

@ -40,8 +40,6 @@ export async function createChapterFile(rawchapters: VideoMetadata, dir: string,
var chapters: string[] = [] var chapters: string[] = []
chapters.push(';FFMETADATA1') chapters.push(';FFMETADATA1')
chapters.push(`title=${mediaid}`)
chapters.push(`artist=Crunchyroll`)
chapters.push(``) chapters.push(``)
if (rawchapters.intro && rawchapters.intro.type && rawchapters.intro.start && rawchapters.intro.end) { 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')) { 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) { for (let posMatch of posMatches) {
let font = parseInt(posMatch[1]) let font = parseInt(posMatch[1])
let newFontSize = Math.round((font / oy) * ny) let newFontSize = Math.round((font / oy) * ny)
@ -154,6 +154,22 @@ function resamplePOSSubtitle(subtitle: string, ox: number, oy: number, nx: numbe
} }
lines[i] = line 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') return lines.join('\n')