This commit is contained in:
Izuco 2022-03-03 21:15:47 +01:00
parent 19800b59e3
commit 0b82788b24
No known key found for this signature in database
GPG key ID: E9CBE9E4EF3A1BFA
8 changed files with 269 additions and 278 deletions

View file

@ -391,7 +391,7 @@ export default class Funi implements ServiceClass {
: (!uncut[dub_type] || data.simul && m.version?.match(/simulcast/i) ? true : false);
for (const curDub of data.dubLang) {
const item = langsData.languages.find(a => a.code === curDub);
if(item && dub_type == (item.funi_name || item.name) && selUncut){
if(item && (dub_type === item.funi_name_lagacy || dub_type === (item.funi_name ?? item.name)) && selUncut){
streamIds.push({
id: m.id,
lang: item
@ -533,7 +533,7 @@ export default class Funi implements ServiceClass {
const audioData = audioDataParts[audioEl[0]];
let language = langsData.languages.find(a => a.locale === audioData.language);
if (!language) {
language = langsData.languages.find(a => a.funi_name || a.name === audioEl[0]);
language = langsData.languages.find(a => a.funi_name_lagacy === audioEl[0] || ((a.funi_name ?? a.name) === audioEl[0]));
if (!language) {
if (log)
console.log(`[ERROR] Unable to find language for locale ${audioData.language} or name ${audioEl[0]}`);
@ -882,8 +882,8 @@ export default class Funi implements ServiceClass {
lang: langsData.languages.find(a => a.funi_locale ?? a.locale === subtitle.languageCode)
};
}).concat(m.filter(a => a.filePath.split('.').pop() === 'vtt').map(media => {
const lang = langsData.languages.find(a => media.language === (a.funi_name || a.name));
const pLang = langsData.languages.find(a => (a.funi_name || a.name) === parentLanguage);
const lang = langsData.languages.find(a => media.language === a.funi_name_lagacy || media.language === (a.funi_name || a.name));
const pLang = langsData.languages.find(a => parentLanguage === a.funi_name_lagacy || (a.funi_name || a.name) === parentLanguage);
return {
isCC: pLang?.code === lang?.code,
url: media.filePath,

View file

@ -29,7 +29,7 @@ const getDataDirectory = () => {
console.error('Unknown home directory');
process.exit(1);
}
console.log('Appdata', process.env.APPDATA)
console.log('Appdata', process.env.APPDATA);
return path.join(process.env.APPDATA, json.name);
}
case 'linux': {

View file

@ -1,7 +1,7 @@
import { BrowserWindow, clipboard, dialog, shell } from 'electron';
import { DownloadInfo, FolderTypes, ProgressData } from '../../../../@types/messageHandler';
import { RandomEvent, RandomEvents } from '../../../../@types/randomEvents';
import { loadCfg } from "../../../../modules/module.cfg-loader";
import { loadCfg } from '../../../../modules/module.cfg-loader';
export default class Base {
@ -58,12 +58,12 @@ export default class Base {
async openFolder(folderType: FolderTypes) {
const conf = loadCfg();
switch (folderType) {
case 'content':
shell.openPath(conf.dir.content);
break;
case 'config':
shell.openPath(conf.dir.config);
break;
case 'content':
shell.openPath(conf.dir.content);
break;
case 'config':
shell.openPath(conf.dir.config);
break;
}
}

View file

@ -8,8 +8,6 @@ const workingDir = (process as NodeJS.Process & {
pkg?: unknown
}).pkg ? path.dirname(process.execPath) : process.env.contentDirectory ? process.env.contentDirectory : path.join(__dirname, '/..');
console.log(workingDir, process.env.contentDirectory);
const binCfgFile = path.join(workingDir, 'config', 'bin-path');
const dirCfgFile = path.join(workingDir, 'config', 'dir-path');
const cliCfgFile = path.join(workingDir, 'config', 'cli-defaults');
@ -85,7 +83,6 @@ const loadCfg = () : ConfigObject => {
defaultCfg.dir[key] = path.join(workingDir, defaultCfg.dir[key].replace(/^\${wdir}/, ''));
}
}
console.log(JSON.stringify(defaultCfg, null, 2));
if(!fs.existsSync(defaultCfg.dir.content)){
try{
fs.ensureDirSync(defaultCfg.dir.content);

View file

@ -7,11 +7,12 @@ export type LanguageItem = {
name: string,
language?: string,
funi_locale?: string,
funi_name?: string
funi_name?: string,
funi_name_lagacy?: string
}
const languages: LanguageItem[] = [
{ cr_locale: 'es-LA', funi_name: 'Spanish (Latin Am)', funi_locale: 'esLA', locale: 'es-419', code: 'spa', name: 'Spanish', language: 'Latin American Spanish' },
{ cr_locale: 'es-LA', funi_name: 'Spanish (LAS)', funi_name_lagacy: 'Spanish (Latin Am)', funi_locale: 'esLA', locale: 'es-419', code: 'spa', name: 'Spanish', language: 'Latin American Spanish' },
{ cr_locale: 'es-419', locale: 'es-419', code: 'spa', name: 'Spanish', language: 'Latin American Spanish' },
{ cr_locale: 'es-ES', locale: 'es', code: 'spa', name: 'Spanish' },
{ cr_locale: 'pt-BR', funi_name: 'Portuguese (Brazil)', funi_locale: 'ptBR', locale: 'pt-BR', code: 'por', name: 'Portuguese', language: 'Brazilian Portuguese' },

View file

@ -5,7 +5,6 @@ import fs from 'fs';
import { LanguageItem } from './module.langsData';
import { AvailableMuxer } from './module.args';
import { exec } from './sei-helper-fixes';
import { PromiseWithChild } from 'child_process';
export type MergerInput = {
path: string,
@ -45,7 +44,7 @@ class Merger {
if (this.options.skipSubMux)
this.options.subtitles = [];
if (this.options.videoTitle)
this.options.videoTitle = this.options.videoTitle.replace(/\"/g, '\'');
this.options.videoTitle = this.options.videoTitle.replace(/"/g, '\'');
}
public FFmpeg() : string {

510
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,7 +1,7 @@
{
"name": "multi-downloader-nx",
"short_name": "aniDL",
"version": "3.0.1",
"version": "3.0.2",
"description": "Download videos from Funimation or Crunchyroll via cli",
"keywords": [
"download",