some changes and removed taskbar progessbar
This commit is contained in:
parent
e877c5696a
commit
7d85f06fc8
5
.env.default
Normal file
5
.env.default
Normal file
@ -0,0 +1,5 @@
|
||||
FFMPEG_PATH=
|
||||
FFPROBE_PATH=
|
||||
MP4DECRYPT_PATH=
|
||||
KEY_KEY=
|
||||
KEY_CLIENT=
|
11
.gitignore
vendored
11
.gitignore
vendored
@ -18,11 +18,14 @@ debug.json
|
||||
errors.json
|
||||
build/
|
||||
crunchyroll-downloader-output-*/
|
||||
updater/
|
||||
|
||||
# FFMPEG
|
||||
ffmpeg/
|
||||
ffmpeg/ffmpeg.exe
|
||||
ffmpeg/ffprobe.exe
|
||||
|
||||
# MP4DECRYPT
|
||||
mp4decrypt/
|
||||
src/api/services/widevine.ts
|
||||
mp4decrypt/mp4decrypt.exe
|
||||
|
||||
# Keys
|
||||
keys/client
|
||||
keys/key
|
||||
|
3
build.js
3
build.js
@ -14,8 +14,7 @@ const options = {
|
||||
|
||||
nodeGypRebuild: true,
|
||||
buildDependenciesFromSource: true,
|
||||
|
||||
// test 2
|
||||
|
||||
publish: {
|
||||
provider: 'github',
|
||||
releaseType: 'release'
|
||||
|
0
ffmpeg/.gitkeep
Normal file
0
ffmpeg/.gitkeep
Normal file
0
keys/.gitkeep
Normal file
0
keys/.gitkeep
Normal file
0
mp4decrypt/.gitkeep
Normal file
0
mp4decrypt/.gitkeep
Normal file
@ -8,7 +8,7 @@ export default defineNuxtConfig({
|
||||
modules: ['@nuxtjs/tailwindcss', 'nuxt-icon', '@nuxtjs/google-fonts'],
|
||||
googleFonts: {
|
||||
families: {
|
||||
'DM+Sans': [600, '1000'],
|
||||
'DM+Sans': ['600', '1000'],
|
||||
'Protest+Riot': true
|
||||
}
|
||||
},
|
||||
|
@ -66,7 +66,7 @@
|
||||
"extraResources": [
|
||||
"./ffmpeg/**",
|
||||
"./mp4decrypt/**",
|
||||
"./updater/**"
|
||||
"./keys/**"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,5 @@
|
||||
import type { FastifyReply, FastifyRequest } from 'fastify'
|
||||
import { crunchyLogin } from './crunchyroll.service'
|
||||
import { dialog } from 'electron'
|
||||
import { messageBox } from '../../../electron/background'
|
||||
import { CrunchyEpisodes, CrunchySeason } from '../../types/crunchyroll'
|
||||
import { loggedInCheck } from '../service/service.service'
|
||||
|
||||
export async function loginController(request: FastifyRequest, reply: FastifyReply) {
|
||||
|
@ -4,10 +4,9 @@ import { VideoPlaylist } from '../../types/crunchyroll'
|
||||
import { useFetch } from '../useFetch'
|
||||
import { parse as mpdParse } from 'mpd-parser'
|
||||
import { loggedInCheck } from '../service/service.service'
|
||||
import { app } from 'electron'
|
||||
|
||||
// Disable when Crunchyroll turns off switch endpoint
|
||||
const enableDRMBypass = false
|
||||
const enableDRMBypass = true
|
||||
|
||||
const crErrors = [
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ import { finished } from 'stream/promises'
|
||||
import Ffmpeg from 'fluent-ffmpeg'
|
||||
import { adnGetM3U8Playlist, adnGetPlaylist } from '../adn/adn.service'
|
||||
import { ADNEpisode } from '../../types/adn'
|
||||
import { messageBox, setProgressBar } from '../../../electron/background'
|
||||
import { messageBox } from '../../../electron/background'
|
||||
import { getFFMPEGPath } from '../../services/ffmpeg'
|
||||
import { getDRMKeys, Uint8ArrayToBase64 } from '../../services/decryption'
|
||||
import { getMP4DecryptPath } from '../../services/mp4decrypt'
|
||||
@ -108,31 +108,6 @@ export async function getDownloading(id: number) {
|
||||
return null
|
||||
}
|
||||
|
||||
// Download Progress Bar Updater
|
||||
function updateProgress() {
|
||||
const totalParts = downloading.reduce((total, item) => total + item.partsToDownload, 0)
|
||||
let downloadedParts = 0
|
||||
|
||||
downloading.forEach((item) => {
|
||||
downloadedParts += item.downloadedParts
|
||||
})
|
||||
|
||||
const progress = totalParts > 0 ? downloadedParts / totalParts : 0
|
||||
|
||||
setProgressBar(progress)
|
||||
|
||||
const allDownloaded = downloading.every((item) => item.downloadedParts === item.partsToDownload)
|
||||
|
||||
if (allDownloaded) {
|
||||
setProgressBar(0)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
cron.schedule('*/2 * * * * *', () => {
|
||||
updateProgress()
|
||||
})
|
||||
|
||||
// Define IsDownloading Count
|
||||
var isDownloading: number = 0
|
||||
|
||||
|
@ -10,7 +10,7 @@ if (isDev) {
|
||||
|
||||
export function getMP4DecryptPath() {
|
||||
if (isDev) {
|
||||
const mp4Decrypt = process.env.MP4DECRYPT
|
||||
const mp4Decrypt = process.env.MP4DECRYPT_PATH
|
||||
|
||||
return mp4Decrypt
|
||||
} else {
|
||||
|
23
src/api/services/widevine.ts
Normal file
23
src/api/services/widevine.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { app } from 'electron'
|
||||
import path from 'path'
|
||||
const isDev = process.env.NODE_ENV === 'development'
|
||||
const appPath = app.getAppPath()
|
||||
const resourcesPath = path.dirname(appPath)
|
||||
const keyPath = path.join(resourcesPath, 'keys')
|
||||
if (isDev) {
|
||||
require('dotenv').config()
|
||||
}
|
||||
|
||||
export function getWVKPath() {
|
||||
if (isDev) {
|
||||
const key = process.env.KEY_KEY
|
||||
const client = process.env.KEY_CLIENT
|
||||
|
||||
return { key: key, client: client }
|
||||
} else {
|
||||
const key = path.join(keyPath, 'key')
|
||||
const client = path.join(keyPath, 'client')
|
||||
|
||||
return { key: key, client: client }
|
||||
}
|
||||
}
|
@ -116,10 +116,6 @@ export async function messageBox(
|
||||
console.log(response)
|
||||
}
|
||||
|
||||
export async function setProgressBar(c: number) {
|
||||
mainWindow.setProgressBar(c)
|
||||
}
|
||||
|
||||
ipcMain.handle('dialog:openDirectory', async () => {
|
||||
const window = BrowserWindow.getFocusedWindow()
|
||||
|
||||
|
Reference in New Issue
Block a user