diff --git a/cli-to-re-map b/cli-to-re-map deleted file mode 100644 index 676ee07..0000000 --- a/cli-to-re-map +++ /dev/null @@ -1,33 +0,0 @@ -workDir -> save-dir -saveName -> save-name -baseUrl -> base-url -headers(key:value|key:value) -> header -maxThreads -> -minThreads -> thread-count -retryCount -> download-retry-count -timeOut -> -muxSetJson -> ? maybe mux-import -useKeyFile -> custom-hls-key -useKeyBase64 -> custom-hls-key -useKeyIV -> custom-hls-iv -downloadRange -> custom-range -liveRecDur -> live-record-limit -stopSpeed -> -maxSpeed -> -proxyAddress -> custom-proxy -enableDelAfterDone -> del-after-done -enableMuxFastStart -> -enableBinaryMerge -> binary-merge -enableParseOnly -> skip-download + skip-merge -enableAudioOnly -> drop-audio .* + drop-subtitle .* -disableDateInfo -> no-date-info -disableIntegrityCheck -> check-segments-count False -noMerge -> skip-merge -noProxy -> use-system-proxy False -registerUrlProtocol -> -unregisterUrlProtocol -> -enableChaCha20 -> ? -chaCha20KeyBase64 -> ? -chaCha20NonceBase64 -> ? -help -> help -version -> version \ No newline at end of file diff --git a/cli2re.html b/cli2re.html deleted file mode 100644 index 7fc37a2..0000000 --- a/cli2re.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - Command Generator - - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- RE命令行生成 -
CLI -> RE
-
转换后的RE命令行将会显示在这里
-
-
- - -
-
-
- -
-
- - - \ No newline at end of file diff --git a/cli2re.js b/cli2re.js deleted file mode 100644 index 3d8c25b..0000000 --- a/cli2re.js +++ /dev/null @@ -1,245 +0,0 @@ -/** - * - * @param {String} prefix - * @returns {String} - */ -String.prototype.removePrefix = function (prefix) { - if (this.match('^' + prefix + '.*$')) { - return this.substring(prefix.length) - } else { - return this.toString() - } -} -/** - * - * @param {String} suffix - * @returns {String} - */ -String.prototype.removeSuffix = function (suffix) { - if (this.match('^.*' + suffix + '$')) { - return this.substring(0, prefix.length) - } else { - return this.toString() - } -} - - -function logOut(...any) { - console.log(...any); -} - -/** - * @param commandLine{String} - */ -function convert(commandLine) { - cleanInfoBox() - const args = { - prefix: "", - /** - * @type {String[]} - */ - options: [ - - ] - } - /** - * @type {String[]} - */ - let firstArgPos = commandLine.indexOf(' ', commandLine.indexOf('N_M3U8DL-CLI')) - args.prefix = commandLine.substring(0, firstArgPos) - let options = Array.from(commandLine.substring(firstArgPos).matchAll('(?:((?:[^"]|^)[\\S\s]+(?:[^"]|$)))|(?:"([^"]+)")')).map((e) => { - return (e[2] ? e[2] : e[1]).trim().removePrefix('--') - }) - logOut(options); - - class Element { - hasArg = false - _drop = false - replacer = (old) => '' - indexInc = (old) => { if (this.hasArg) return 1; else return 0 } - /** - * @param {Boolean} hasArg - * @param {Boolean|(old:String)=>Boolean} drop - * @param {(old:String)=>String|String} replacer - * @param {(old:String)=>number|undefined} inc - * */ - constructor(hasArg, drop, replacer, inc) { - this.hasArg = hasArg - this._drop = drop - this.replacer = replacer - if (inc) { - this.indexInc = inc - } - } - drop(old) { - if (typeof this._drop == "boolean") { - return this._drop - } else - return this._drop(this.replacer(old)) - } - } - let map = { - "workDir": new Element( - true, false, (old) => 'save-dir' - ), - saveName: new Element( - true, false, (old) => 'save-name' - ), - baseUrl: new Element( - true, false, (old) => 'base-url' - ), - headers: new Element( - true, false, (old) => { - return old.split('|').map((kv) => { - return `--header ${kv.substring(0, kv.indexOf(':'))}: ${kv.substring(kv.indexOf(':'))}` - }).join(' ') - } - ), - maxThreads: new Element( - true, (old) => - args.options.includes('--thread-count') - , (old) => 'thread-count' - ), - minThreads: new Element( - true, (old) => - args.options.includes('--thread-count') - , (old) => 'thread-count' - ), - retryCount: new Element( - true, false, (old) => 'download-retry-count' - ), - timeOut: new Element( - true, true - ), - muxSetJson: new Element( - true, true, (old) => 'mux-import' - ), - useKeyFile: new Element( - true, false, (old) => 'custom-hls-key' - ), - useKeyBase64: new Element( - true, false, (old) => 'custom-hls-key' - ), - useKeyIV: new Element( - true, false, (old) => 'custom-hls-iv' - ), - downloadRange: new Element( - true, false, (old) => 'custom-range' - ), - liveRecDur: new Element( - true, false, (old) => 'live-record-limit' - ), - stopSpeed: new Element( - true, true - ), - maxSpeed: new Element( - true, true - ), - proxyAddress: new Element( - true, false, (old) => 'custom-proxy' - ), - enableDelAfterDone: new Element( - false, false, (old) => 'del-after-done' - ), - enableMuxFastStart: new Element( - false, true, (old) => '' - ), - enableBinaryMerge: new Element( - false, false, (old) => 'binary-merge' - ), - enableParseOnly: new Element( - false, false, (old) => 'drop-audio .* drop-subtitle .*' - ), - disableDateInfo: new Element( - false, false, (old) => 'no-date-info' - ), - disableIntegrityCheck: new Element( - false, false, (old) => 'check-segments-count False' - ), - noMerge: new Element( - false, false, (old) => 'skip-merge' - ), - noProxy: new Element( - false, false, (old) => 'use-system-proxy False' - ), - chaCha20KeyBase64: new Element( - true, true, (old) => '' - ), - chaCha20NonceBase64: new Element( - true, true, (old) => '' - ), - } - for (let i = 0; i < options.length; i++) { - const opt = options[i]; - logOut(opt) - /** - * @type {Element} - */ - const ele = map[opt] - if (!ele) { - logOut(`${opt}(unknown)`) - writeInfo('--' + opt,'',"unknown",'unknown') - continue - } - let drop = ele.drop(opt) - if (drop) { - logOut(` --${opt}(drop)`); - } else { - args.options.push(`--${ele.replacer(opt)}`) - logOut(`--${opt} => --${ele.replacer(opt)}`); - } - - logOut(` hasArg ${ele.hasArg}`); - logOut(` indexInc ${ele.indexInc(opt)}`); - let option = "" - for (let j = i + 1; j <= i + ele.indexInc(opt); j++) { - const element = options[j]; - if (!drop) { - option+=element - args.options.push(`"${element}"`) - logOut(` arg: "${element}"`); - } else { - logOut(` arg: ${element}(drop)`); - } - } - if(drop){ - writeInfo('--' + opt,option,"drop","droped") - }else{ - writeInfo('--' + opt,option,"ok") - } - - i += ele.indexInc(opt) - - } - - - - if (args.prefix + ' ' + args.options.join(' ').length == 0) - return '转换后的RE命令行将会显示在这里' - return (args.prefix + ' ' + args.options.join(' ')); -} - -function cleanInfoBox() { - document.getElementById('info-box').innerHTML = '' - -} - -function writeInfo(argName, argOption, type, details) { - let box = document.getElementById('info-box') - let info = document.createElement('div') - info.classList.add("info") - info.classList.add(type) - let name = document.createElement('div') - name.classList.add('arg-name') - if (details) { - name.innerText = argName + `(${details})` - }else{ - name.innerText = argName - } - let option = document.createElement('div') - option.classList.add('arg-option') - option.innerText = argOption - info.appendChild(name) - info.appendChild(option) - box.appendChild(info) -} \ No newline at end of file diff --git a/current-help-cli b/current-help-cli deleted file mode 100644 index bff16ba..0000000 --- a/current-help-cli +++ /dev/null @@ -1,41 +0,0 @@ -N_m3u8DL-CLI 3.0.2.0 - -USAGE: - - N_m3u8DL-CLI [OPTIONS] - -OPTIONS: - - --workDir 设定程序工作目录 - --saveName 设定存储文件名(不包括后缀) - --baseUrl 设定Baseurl - --headers 设定请求头,格式 key:value 使用|分割不同的key&value - --maxThreads (Default: 32) 设定程序的最大线程数 - --minThreads (Default: 16) 设定程序的最小线程数 - --retryCount (Default: 15) 设定程序的重试次数 - --timeOut (Default: 10) 设定程序网络请求的超时时间(单位为秒) - --muxSetJson 使用外部json文件定义混流选项 - --useKeyFile 使用外部16字节文件定义AES-128解密KEY - --useKeyBase64 使用Base64字符串定义AES-128解密KEY - --useKeyIV 使用HEX字符串定义AES-128解密IV - --downloadRange 仅下载视频的一部分分片或长度 - --liveRecDur 直播录制时,达到此长度自动退出软件(HH:MM:SS) - --stopSpeed 当速度低于此值时,重试(单位为KB/s) - --maxSpeed 设置下载速度上限(单位为KB/s) - --proxyAddress 设置HTTP/SOCKS5代理, 如 http://127.0.0.1:8080 - --enableDelAfterDone 开启下载后删除临时文件夹的功能 - --enableMuxFastStart 开启混流mp4的FastStart特性 - --enableBinaryMerge 开启二进制合并分片 - --enableParseOnly 开启仅解析模式(程序只进行到meta.json) - --enableAudioOnly 合并时仅封装音频轨道 - --disableDateInfo 关闭混流中的日期写入 - --disableIntegrityCheck 不检测分片数量是否完整 - --noMerge 禁用自动合并 - --noProxy 不自动使用系统代理 - --registerUrlProtocol 注册m3u8dl链接协议 - --unregisterUrlProtocol 取消注册m3u8dl链接协议 - --enableChaCha20 enableChaCha20 - --chaCha20KeyBase64 ChaCha20KeyBase64 - --chaCha20NonceBase64 ChaCha20NonceBase64 - --help Display this help screen. - --version Display version information. \ No newline at end of file diff --git a/current-help-re.txt b/current-help-re.txt index 80fbde2..bac0716 100644 --- a/current-help-re.txt +++ b/current-help-re.txt @@ -2,70 +2,68 @@ N_m3u8DL-RE (Beta version) 20231113 Usage: - N_m3u8DL-RE [options] + N_m3u8DL-RE_pre [options] Arguments: - 链接或文件 + Input Url or File Options: - --tmp-dir 设置临时文件存储目录 - --save-dir 设置输出目录 - --save-name 设置保存文件名 - --base-url 设置BaseURL - --thread-count 设置下载线程数 [default: 16] - --download-retry-count 每个分片下载异常时的重试次数 [default: 3] - --auto-select 自动选择所有类型的最佳轨道 [default: False] - --skip-merge 跳过合并分片 [default: False] - --skip-download 跳过下载 [default: False] - --check-segments-count 检测实际下载的分片数量和预期数量是否匹配 [default: True] - --binary-merge 二进制合并 [default: False] - --use-ffmpeg-concat-demuxer 使用 ffmpeg 合并时,使用 concat 分离器而非 concat 协议 [default: False] - --del-after-done 完成后删除临时文件 [default: True] - --no-date-info 混流时不写入日期信息 [default: False] - --no-log 关闭日志文件输出 [default: False] - --write-meta-json 解析后的信息是否输出json文件 [default: True] - --append-url-params 将输入Url的Params添加至分片, 对某些网站很有用, 例如 kakao.com [default: False] - -mt, --concurrent-download 并发下载已选择的音频、视频和字幕 [default: False] - -H, --header
为HTTP请求设置特定的请求头, 例如: - -H "Cookie: mycookie" -H "User-Agent: iOS" - --sub-only 只选取字幕轨道 [default: False] - --sub-format 字幕输出类型 [default: SRT] - --auto-subtitle-fix 自动修正字幕 [default: True] - --ffmpeg-binary-path ffmpeg可执行程序全路径, 例如 C:\Tools\ffmpeg.exe - --log-level 设置日志级别 [default: INFO] - --ui-language 设置UI语言 - --urlprocessor-args 此字符串将直接传递给URL Processor - --key 设置解密密钥, 程序调用mp4decrpyt/shaka-packager进行解密. 格式: - --key KID1:KEY1 --key KID2:KEY2 - --key-text-file 设置密钥文件,程序将从文件中按KID搜寻KEY以解密.(不建议使用特大文件) - --decryption-binary-path MP4解密所用工具的全路径, 例如 C:\Tools\mp4decrypt.exe - --use-shaka-packager 解密时使用shaka-packager替代mp4decrypt [default: False] - --mp4-real-time-decryption 实时解密MP4分片 [default: False] - -R, --max-speed 设置限速,单位支持 Mbps 或 Kbps,如:15M 100K - -M, --mux-after-done 所有工作完成时尝试混流分离的音视频. 输入 "--morehelp mux-after-done" 以查看详细信息 - --custom-hls-method 指定HLS加密方式 (AES_128|AES_128_ECB|CENC|CHACHA20|NONE|SAMPLE_AES|SAMPLE_AES_CTR|UNKNOWN) - --custom-hls-key 指定HLS解密KEY. 可以是文件, HEX或Base64 - --custom-hls-iv 指定HLS解密IV. 可以是文件, HEX或Base64 - --use-system-proxy 使用系统默认代理 [default: True] - --custom-proxy 设置请求代理, 如 http://127.0.0.1:8888 - --custom-range 仅下载部分分片. 输入 "--morehelp custom-range" 以查看详细信息 - --task-start-at 在此时间之前不会开始执行任务 - --live-perform-as-vod 以点播方式下载直播流 [default: False] - --live-real-time-merge 录制直播时实时合并 [default: False] - --live-keep-segments 录制直播并开启实时合并时依然保留分片 [default: True] - --live-pipe-mux 录制直播并开启实时合并时通过管道+ffmpeg实时混流到TS文件 [default: False] - --live-fix-vtt-by-audio 通过读取音频文件的起始时间修正VTT字幕 [default: False] - --live-record-limit 录制直播时的录制时长限制 - --live-wait-time 手动设置直播列表刷新间隔 ---live-take-count 手动设置录制直播时首次获取分片的数量 [default: 16] - --mux-import 混流时引入外部媒体文件. 输入 "--morehelp mux-import" 以查看详细信息 - -sv, --select-video 通过正则表达式选择符合要求的视频流. 输入 "--morehelp select-video" 以查看详细信息 - -sa, --select-audio 通过正则表达式选择符合要求的音频流. 输入 "--morehelp select-audio" 以查看详细信息 - -ss, --select-subtitle 通过正则表达式选择符合要求的字幕流. 输入 "--morehelp select-subtitle" 以查看详细信息 - -dv, --drop-video 通过正则表达式去除符合要求的视频流. - -da, --drop-audio 通过正则表达式去除符合要求的音频流. - -ds, --drop-subtitle 通过正则表达式去除符合要求的字幕流. - --ad-keyword 设置广告分片的URL关键字(正则表达式) - --morehelp