Auto update documentation

This commit is contained in:
Izuco 2022-01-15 16:32:53 +01:00
parent aca06d9a76
commit a3a50e97c1
No known key found for this signature in database
GPG key ID: E9CBE9E4EF3A1BFA
5 changed files with 97 additions and 63 deletions

View file

@ -0,0 +1,27 @@
name: auto-documentation
on:
pull_request:
push:
branches:
- "main"
jobs:
documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
cache: 'npm'
- run: npm i
- run: npx -y ts-node modules/build-docs.ts
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Build Documentaion

View file

@ -16,8 +16,8 @@ This application is not endorsed by or affiliated with *Funimation* or *Crunchyr
### Paths Configuration
By default this application uses the following paths to programs (main executables):
* `./bin/ffmpeg/ffmpeg.exe`
* `./bin/mkvtoolnix/mkvmerge.exe`
* `ffmpeg.exe` (From PATH)
* `mkvmerge.exe` (From PATH)
To change these paths you need to edit `bin-path.yml` in `./config/` directory.
@ -27,61 +27,4 @@ After installing NodeJS with NPM go to directory with `package.json` file and ty
* [check dependencies](https://david-dm.org/anidl/funimation-downloader-nx)
## CLI Options
### Authentication
* `--service ['funi', 'crunchy']` Set the service you want to use
* `--auth` enter auth mode
### Get Show ID
* `-f`, `--search <s>` sets the show title for search
### Download Video
* `-s <i> -e <s>` sets the show id and episode ids (comma-separated, hyphen-sequence)
* `-q <i>` sets the video layer quality [1...10] (optional, 0 is max)
* `--all` download all videos at once
* `--alt` alternative episode listing (if available)
* `--subLang` select one or more subtile language
* `--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`, `--server` select server
* `--novids` skip download videos
* `--nosubs` skip download subtitles for Dub (if available)
* `--noaudio` skip downloading audio
### Proxy
The proxy is currently unmainted. Use at your on risk.
* `--proxy <s>` http(s)/socks proxy WHATWG url (ex. https://myproxyhost:1080)
* `--proxy-auth <s>` Colon-separated username and password for proxy
* `--ssp` don't use proxy for stream downloading
### Muxing
`[note] this application mux into mkv by default`
* `--mp4` mux into mp4
* `--mks` add subtitles to mkv or mp4 (if available)
### Filenaming (optional)
* `--fileName` Set the filename template. Use ${variable_name} to insert variables.
You may use 'title', 'episode', 'showTitle', 'season', 'width', 'height' as variables.
### Utility
* `--nocleanup` don't delete the input files after the muxing
* `-h`, `--help` show all options
## Filename Template
[${service}] ${showTitle} - ${episode} [${height}p]"]
## CLI Help
If you need help with the cli run `node index.js --help` or `aniDL[.exe] --help` .
If you still don't get it please open up an issue with the CLI template.
See [the documentation](https://github.com/anidl/multi-downloader-nx/blob/master/docs/DOCUMENTATION.md)

63
modules/build-docs.ts Normal file
View file

@ -0,0 +1,63 @@
import packageJSON from '../package.json';
import fs from "fs";
import path from "path";
import { availableFilenameVars, args, groups } from './module.args';
const transformService = (str: 'funi'|'crunchy'|'both') => {
switch (str) {
case 'both':
return 'Both';
case 'crunchy':
return 'Crunchyroll';
case 'funi':
return 'Funimation';
}
}
let docs = `# ${packageJSON.name} (${packageJSON.version}v)
If you find any bugs in this documentation or in the programm itself please report it [over on GitHub](${packageJSON.bugs.url}).
## Legal Warning
This application is not endorsed by or affiliated with *Funimation* or *Crunchyroll*.
This application enables you to download videos for offline viewing which may be forbidden by law in your country.
The usage of this application may also cause a violation of the *Terms of Service* between you and the stream provider.
This tool is not responsible for your actions; please make an informed decision before using this application.
## CLI Options
### Legend
- \`\${someText}\` shows that you should replace this text with your own
- e.g. \`--username \${someText}\` -> \`--username Izuco\`
`;
Object.entries(groups).forEach(([key, value]) => {
docs += `\n### ${value.slice(0, -1)}\n`;
docs += args.filter(a => a.group === key).map(argument => {
return [`#### \`${argument.name.length > 1 ? '--' : '-'}${argument.name}\``,
`| **Service** | **Usage** | **Type** | **Required** | **Alias** | ${argument.choices ? `**Choices** |` : ''} ${argument.default ? `**Default** |` : ''}**cli-default Entry**`,
`| --- | --- | --- | --- | --- | ${argument.choices ? '--- | ' : ''}${argument.default ? '--- | ' : ''}---| `,
`| ${transformService(argument.service)} | \`${argument.name.length > 1 ? '--' : '-'}${argument.name} ${argument.usage}\` | \`${argument.type}\` | \`${argument.demandOption ? 'Yes' : 'No'}\`|`
+ ` \`${(argument.alias ? `${argument.alias.length > 1 ? '--' : '-'}${argument.alias}` : undefined) ?? 'NaN'}\` |`
+ `${argument.choices ? ` [${argument.choices.map(a => `\`${a || `''`}\``).join(', ')}] |` : ''}`
+ `${argument.default ? ` \`${
typeof argument.default === 'object'
? Array.isArray(argument.default)
? JSON.stringify(argument.default)
: argument.default.default
: argument.default
}\`|` : ''}`
+ ` ${typeof argument.default === 'object' && !Array.isArray(argument.default)
? `\`${argument.default.name || argument.name}: \``
: '`NaN`'
} |`,
'',
argument.docDescribe === true ? argument.describe : argument.docDescribe
].join('\n');
}).join('\n');
});
fs.writeFileSync(path.resolve(__dirname, '..', 'docs', 'DOCUMENTATION.md'), docs);

View file

@ -431,7 +431,8 @@ const args: TAppArg<boolean|number|string|unknown[]>[] = [
usage: '${service}',
default: {
default: ''
}
},
demandOption: true
},
{
name: 'update',

View file

@ -18,10 +18,10 @@
"homepage": "https://github.com/anidl/multi-downloader-nx",
"repository": {
"type": "git",
"url": "https://github.com/izu-co/funimation-downloader-nx.git"
"url": "https://github.com/anidl/multi-downloader-nx.git"
},
"bugs": {
"url": "https://github.com/izu-co/funimation-downloader-nx/issues"
"url": "https://github.com/anidl/multi-downloader-nx/issues"
},
"license": "MIT",
"main": "index.js",