anidl / multi-downloader-nx

Downloader for Crunchyroll, Hidive, AnimeOnegai, and AnimationDigitalNetwork with CLI and GUI
MIT License
265 stars 43 forks source link

How do i still run this from source? #142

Closed XxUnkn0wnxX closed 2 years ago

XxUnkn0wnxX commented 2 years ago

since you merged it all, do I have to use the binaries? as this is a pain as I used to go git pull's every now & then to get the latest versions

there is no index.js or funi.js etc in the source folder.

running node index.ts throws an error (I did npm i)

node funi.ts
/Users/User/Apps/Animie/anidl/multi-downloader-nx/funi.ts:2
import fs from 'fs';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1025:15)
    at Module._compile (node:internal/modules/cjs/loader:1059:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47

or do I need to compile this? any instructions on how to compile?

izu-co commented 2 years ago

Yes ok so in order to use the code version just run npm run tsc in the folder.

Afterwards a new lib folder should appear. Use the folder as the source and run node index.js

XxUnkn0wnxX commented 2 years ago

Yes ok so in order to use the code version just run npm run tsc in the folder.

Afterwards a new lib folder should appear. Use the folder as the source and run node index.js

yep i see thx, i assume i will have to run npm run tsc everytime source gets updated?

also what config options are available for cli-defaults

can i use the same ones in crunchy & funi?

Funi:

releaseGroup: Funimation
videoLayer: 0
fileSuffix: SIZEp
nServer: 1
mp4mux: false
muxSubs: true
noCleanUp: false
partsize: 40

Crunchy:

# Downloading
videoQuality: max
nServer: 1
kStream: 1
tsparts: 30
hsLang: none
dlSubs: en
oldStreams: false
oldSubs: false

# Muxing
dubLanguage: eng
defSubLang: none
useBCPtags: false
mp4mux: false
muxSubs: true

# Filenaming
filenameTemplate: "[{rel_group}] {title} - {ep_num} [{suffix}]"
releaseGroup: CR
epNumLength: 2
fileSuffix: SIZEp

# Proxy
proxy: ''
proxy_auth: ''
proxy_ups: false
use_curl: false
proxy_ssp: false

# Utilities
useFolder: false
noCleanUp: false
noTrashFolder: false

?

izu-co commented 2 years ago

There are some differences, for example the subtitles. You can always do --help to see if they are both (no comment) or specific (e.g (Funimation only)).

In the CLI default file, you can set both funi and crunchy defaults. If the option is used by both it will be used by both, otherwise only by one.

And yes you have to run it every time it updates.

izu-co commented 2 years ago

@XxUnkn0wnxX I know that it would be a pain to update every so often, so I wrote an auto updater just for you.

The tool will now check once a day for updates and apply them if needed. (Only to the JS version after running npm run tsc on the git version)

If you want to force the tool to check, you do --update. The best thing is this works in the source, so no rebuilding (might be needed sometimes, tho). Check it out here and tell me what you think. I sure hope you like it and it works because it was a crap ton of work :)

XxUnkn0wnxX commented 2 years ago

@izu-co when running just aniDL script on its own it throws Missing required argument: service I don't think service should be required if running the updater.

although till now I've been just using a simple sh script that updated it every time for me.

#!/usr/local/bin/zsh
source ~/.zshrc;
echo updating multi-dl...;
sleep 2;
echo git reset hard;
sleep 1;
cd $ANIDL/multi-downloader-nx
git reset --hard;
sleep 1;
echo git pull;
git pull;
sleep 1;
echo npm updates multi-dl...;
sleep 2;
npm i;
npm update;
npm audit fix;
sleep 1;
echo npm run tsc;
npm run tsc;
sleep 1;
echo fixing config;
sleep 2;
rm -rf $ANIDL/multi-downloader-nx/lib/config;
ln -sfn $ANIDL/aniDL-Config $ANIDL/multi-downloader-nx/lib/config;
echo npm updates lib...;
sleep 2;
cd $ANIDL/multi-downloader-nx/lib
npm i;
npm update;
npm audit fix;
sleep 1;

The best I can do is string commands together, can't do anything complex.

just wish tsc didn't reset my config every time. in the past when this was still funimation-downlaoder-nx I would get the error there uncommitted changes found due to custom config edits & package.json everytime npm updater was run.

other devs have main config file's as something other like config.cfg.spec or config.cfg.template so during git pulls, the actual config files are not overwritten only templates.

izu-co commented 2 years ago

Well you have to set the service every time. So please use —service „funi“ —update.

this updates the build source by replacing changed files.