mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-04-21 08:21:56 +00:00
Merge pull request #102 from OryWareKyrie/master
Fix & Add tags titles.
This commit is contained in:
commit
e57acb8399
4 changed files with 24 additions and 15 deletions
|
|
@ -16,8 +16,8 @@ This application is not endorsed by or affiliated with *Funimation*. This applic
|
|||
### Paths Configuration
|
||||
|
||||
By default this application uses the following paths to programs (main executables):
|
||||
* `./bin/mkvmerge`
|
||||
* `./bin/ffmpeg`
|
||||
* `./bin/ffmpeg.exe`
|
||||
* `./bin/mkvmerge.exe`
|
||||
|
||||
To change these paths you need to edit `bin-path.yml` in `./config/` directory.
|
||||
|
||||
|
|
@ -34,7 +34,7 @@ After installing NodeJS with NPM go to directory with `package.json` file and ty
|
|||
|
||||
### Get Show ID
|
||||
|
||||
* `--search <s>` sets the show title for search
|
||||
* `-f`, `--search <s>` sets the show title for search
|
||||
|
||||
### Download Video
|
||||
|
||||
|
|
@ -43,9 +43,11 @@ After installing NodeJS with NPM go to directory with `package.json` file and ty
|
|||
* `--all` download all videos at once
|
||||
* `--alt` alternative episode listing (if available)
|
||||
* `--subLang` select one or more subtile language
|
||||
* `--allSubs` If set to true, all available subs will get downloaded
|
||||
* `--dub` select one or more dub languages
|
||||
* `--allDubs` If set to true, all available dubs will get downloaded
|
||||
* `--simul` force select simulcast version instead of uncut version
|
||||
* `-x` select server
|
||||
* `-x`, `--server` select server
|
||||
* `--novids` skip download videos
|
||||
* `--nosubs` skip download subtitles for Dub (if available)
|
||||
* `--noaudio` skip downloading audio
|
||||
|
|
@ -83,3 +85,5 @@ The proxy is currently unmainted. Use at your on risk.
|
|||
* `node funi --search "My Hero"` search "My Hero" in title
|
||||
* `node funi -s 124389 -e 1,2,3` download episodes 1-3 from show with id 124389
|
||||
* `node funi -s 124389 -e 1-3,2-7,s1-2` download episodes 1-7 and "S"-episodes 1-2 from show with id 124389
|
||||
* `node funi -s 19373 -e 28-47 -q 7 --allSubs --dub jaJP ptBR` download episodes 28 to 47 with Portuguese (Brazil) and Japanese audio in 720p(HD) resolution with all subtitles available
|
||||
* `node funi -s 19373 -e 15-30 -q 10 --subLang ptBR enUS --dub jaJP` download episodes 15 to 30 with Japanese audio in 1080p resolution (Full HD) with Portuguese (Brazil) and English subtitles
|
||||
|
|
|
|||
4
funi.js
4
funi.js
|
|
@ -739,12 +739,12 @@ async function downloadStreams(){
|
|||
|
||||
if(!argv.mp4 && usableMKVmerge){
|
||||
let ffext = !argv.mp4 ? 'mkv' : 'mp4';
|
||||
let command = merger.buildCommandMkvMerge(audioAndVideo, purvideo, puraudio, stDlPath, `${path.join(cfg.dir.content, outName)}.${ffext}`);
|
||||
let command = merger.buildCommandMkvMerge(argv.simul, audioAndVideo, purvideo, puraudio, stDlPath, `${path.join(cfg.dir.content, outName)}.${ffext}`);
|
||||
shlp.exec('mkvmerge', `"${mkvmergebinfile}"`, command);
|
||||
}
|
||||
else if(usableFFmpeg){
|
||||
let ffext = !argv.mp4 ? 'mkv' : 'mp4';
|
||||
let command = merger.buildCommandFFmpeg(audioAndVideo, purvideo, puraudio, stDlPath, `${path.join(cfg.dir.content, outName)}.${ffext}`);
|
||||
let command = merger.buildCommandFFmpeg(argv.simul, audioAndVideo, purvideo, puraudio, stDlPath, `${path.join(cfg.dir.content, outName)}.${ffext}`);
|
||||
shlp.exec('ffmpeg',`"${ffmpegbinfile}"`,command);
|
||||
}
|
||||
else{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ const iso639 = require('iso-639');
|
|||
* @param {string} output
|
||||
* @returns {string}
|
||||
*/
|
||||
const buildCommandFFmpeg = (videoAndAudio, onlyVid, onlyAudio, subtitles, output) => {
|
||||
const buildCommandFFmpeg = (simul, videoAndAudio, onlyVid, onlyAudio, subtitles, output) => {
|
||||
let args = [];
|
||||
let metaData = [];
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ const buildCommandFFmpeg = (videoAndAudio, onlyVid, onlyAudio, subtitles, output
|
|||
* @param {Array<object>} subtitles
|
||||
* @returns {string}
|
||||
*/
|
||||
const buildCommandMkvMerge = (videoAndAudio, onlyVid, onlyAudio, subtitles, output) => {
|
||||
const buildCommandMkvMerge = (simul, videoAndAudio, onlyVid, onlyAudio, subtitles, output) => {
|
||||
let args = [];
|
||||
|
||||
let hasVideo = false;
|
||||
|
|
@ -87,7 +87,9 @@ const buildCommandMkvMerge = (videoAndAudio, onlyVid, onlyAudio, subtitles, outp
|
|||
'--video-tracks 0',
|
||||
'--no-audio'
|
||||
);
|
||||
args.push('--track-name 0:[Funimation]');
|
||||
let trackName = subDict[vid.lang] + (simul ? ' [Simulcast]' : ' [Uncut]');
|
||||
args.push('--track-name', `0:"${trackName}"`);
|
||||
args.push(`--language 0:${getLanguageCode(vid.lang, vid.lang)}`);
|
||||
hasVideo = true;
|
||||
args.push(`"${vid.path}"`);
|
||||
}
|
||||
|
|
@ -99,8 +101,8 @@ const buildCommandMkvMerge = (videoAndAudio, onlyVid, onlyAudio, subtitles, outp
|
|||
'--video-tracks 0',
|
||||
'--audio-tracks 1'
|
||||
);
|
||||
args.push('--track-name 0:[Funimation]');
|
||||
let trackName = subDict[vid.lang];
|
||||
let trackName = subDict[vid.lang] + (simul ? ' [Simulcast]' : ' [Uncut]');
|
||||
args.push('--track-name', `0:"${trackName}"`);
|
||||
args.push('--track-name', `1:"${trackName}"`);
|
||||
args.push(`--language 1:${getLanguageCode(vid.lang, vid.lang)}`);
|
||||
hasVideo = true;
|
||||
|
|
@ -109,7 +111,7 @@ const buildCommandMkvMerge = (videoAndAudio, onlyVid, onlyAudio, subtitles, outp
|
|||
'--no-video',
|
||||
'--audio-tracks 1'
|
||||
);
|
||||
let trackName = subDict[vid.lang];
|
||||
let trackName = subDict[vid.lang] + (simul ? ' [Simulcast]' : ' [Uncut]');
|
||||
args.push('--track-name', `1:"${trackName}"`);
|
||||
args.push(`--language 1:${getLanguageCode(vid.lang, vid.lang)}`);
|
||||
}
|
||||
|
|
@ -117,7 +119,7 @@ const buildCommandMkvMerge = (videoAndAudio, onlyVid, onlyAudio, subtitles, outp
|
|||
}
|
||||
|
||||
for (let aud of onlyAudio) {
|
||||
let trackName = subDict[aud.lang];
|
||||
let trackName = subDict[aud.lang] + (simul ? ' [Simulcast]' : ' [Uncut]');
|
||||
args.push('--track-name', `0:"${trackName}"`);
|
||||
args.push(`--language 0:${getLanguageCode(aud.lang, aud.lang)}`);
|
||||
args.push(
|
||||
|
|
@ -129,7 +131,7 @@ const buildCommandMkvMerge = (videoAndAudio, onlyVid, onlyAudio, subtitles, outp
|
|||
|
||||
if (subtitles.length > 0) {
|
||||
for (let subObj of subtitles) {
|
||||
let trackName = subDict[subObj.language];
|
||||
let trackName = subDict[subObj.language] + (simul ? ' [Simulcast]' : ' [Uncut]');
|
||||
args.push('--track-name', `0:"${trackName}"`);
|
||||
args.push('--language', `0:${getLanguageCode(subObj.language)}`);
|
||||
args.push(`"${subObj.file}"`);
|
||||
|
|
@ -147,9 +149,11 @@ const subDict = {
|
|||
'en': 'English (United State)',
|
||||
'es': 'Español (Latinoamericano)',
|
||||
'pt': 'Português (Brasil)',
|
||||
'ja': '日本語'
|
||||
'ja': '日本語',
|
||||
'cmn': '官話'
|
||||
};
|
||||
const getLanguageCode = (from, _default = 'eng') => {
|
||||
if (from === 'cmn') return 'chi';
|
||||
for (let lang in iso639.iso_639_2) {
|
||||
let langObj = iso639.iso_639_2[lang];
|
||||
if (Object.prototype.hasOwnProperty.call(langObj, '639-1') && langObj['639-1'] === from) {
|
||||
|
|
|
|||
1
videos/.gitkeep
Normal file
1
videos/.gitkeep
Normal file
|
|
@ -0,0 +1 @@
|
|||
|
||||
Loading…
Reference in a new issue