mirror of
https://github.com/fumiama/RVC-Models-Downloader.git
synced 2026-01-22 15:53:47 +09:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b6ca35a6d | ||
|
|
e6b2709814 | ||
|
|
0bcc668b80 | ||
|
|
97c40d407e | ||
|
|
a37825d740 |
86
README.md
86
README.md
@@ -1,70 +1,91 @@
|
|||||||
# RVC-Models-Downloader
|
# RVC-Models-Downloader
|
||||||
English | [简体中文](README_sc.md)
|
|
||||||
|
English | [简体中文](README_sc.md) | [한국어](README_kr.md)
|
||||||
|
|
||||||
Easy tool to download a batch of files listed in yaml (ex. RVC models in Hugging Face 🤗).
|
Easy tool to download a batch of files listed in yaml (ex. RVC models in Hugging Face 🤗).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
### Preparation
|
### Preparation
|
||||||
|
|
||||||
1. Download the program at [Release](https://github.com/RVC-Project/RVC-Models-Downloader/releases) page.
|
1. Download the program at [Release](https://github.com/RVC-Project/RVC-Models-Downloader/releases) page.
|
||||||
2. Put this program into the root directory of RVC (or whatever position you want to download some files into).
|
2. Put this program into the root directory of RVC (or whatever position you want to download some files into).
|
||||||
3. You can also add it to the `PATH` to use this tool everywhere. If you have installed this program by a package manager, it may be already in the `PATH`.
|
3. You can also add it to the `PATH` to use this tool everywhere. If you have installed this program by a package manager, it may be already in the `PATH`.
|
||||||
|
|
||||||
### Download
|
### Download
|
||||||
|
|
||||||
#### All Assets of RVC
|
#### All Assets of RVC
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rvcmd assets/all
|
rvcmd assets/all
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Latest General Pack of RVC (Windows Only)
|
#### Latest General Pack of RVC (Windows Only)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rvcmd packs/general/latest
|
rvcmd packs/general/latest
|
||||||
```
|
```
|
||||||
|
|
||||||
#### ffmpeg Tools (Windows Only)
|
#### ffmpeg Tools (Windows Only)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rvcmd tools/ffmpeg
|
rvcmd tools/ffmpeg
|
||||||
```
|
```
|
||||||
|
|
||||||
### Customized Download
|
### Customized Download
|
||||||
|
|
||||||
#### Ex.1. Download ffmpeg Tools & Latest Intel Pack
|
#### Ex.1. Download ffmpeg Tools & Latest Intel Pack
|
||||||
|
|
||||||
1. Write and save the following `cust.yaml`.
|
1. Write and save the following `cust.yaml`.
|
||||||
```yaml
|
```yaml
|
||||||
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
|
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
|
||||||
Targets:
|
Targets:
|
||||||
- Refer: tools/ffmpeg
|
- Refer: tools/ffmpeg
|
||||||
- Refer: packs/intel/latest
|
- Refer: packs/intel/latest
|
||||||
```
|
```
|
||||||
2. Run `rvcmd` in the same folder.
|
2. Run `rvcmd` in the same folder.
|
||||||
```bash
|
```bash
|
||||||
rvcmd -c cust
|
rvcmd -c cust
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Ex.2. Download other Repositories in 🤗
|
#### Ex.2. Download other Repositories in 🤗
|
||||||
|
|
||||||
> Use [Stable Diffusion v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5) as the example.
|
> Use [Stable Diffusion v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5) as the example.
|
||||||
|
|
||||||
1. Write and save the following `cust.yaml`.
|
1. Write and save the following `cust.yaml`.
|
||||||
```yaml
|
```yaml
|
||||||
BaseURL: https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main
|
BaseURL: https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main
|
||||||
Targets:
|
Targets:
|
||||||
- Folder: sd1.5 # the folder you want to download into
|
- Folder: sd1.5 # the folder you want to download into
|
||||||
Copy: # files to download
|
Copy: # files to download
|
||||||
- v1-5-pruned-emaonly.ckpt
|
- v1-5-pruned-emaonly.ckpt
|
||||||
- v1-5-pruned-emaonly.safetensors
|
- v1-5-pruned-emaonly.safetensors
|
||||||
- Folder: sd1.5/vae # the folder you want to download into
|
- Folder: sd1.5/vae # the folder you want to download into
|
||||||
Copy: # files to download
|
Copy: # files to download
|
||||||
- vae/diffusion_pytorch_model.bin
|
- vae/diffusion_pytorch_model.bin
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Ex.3. Download Releases in GitHub
|
#### Ex.3. Download Releases in GitHub
|
||||||
|
|
||||||
> Use [yousa-ling-diffsinger-v1.3](https://github.com/yousa-ling-official-production/yousa-ling-diffsinger-v1/releases/tag/v1.3) as the example.
|
> Use [yousa-ling-diffsinger-v1.3](https://github.com/yousa-ling-official-production/yousa-ling-diffsinger-v1/releases/tag/v1.3) as the example.
|
||||||
|
|
||||||
1. Write and save the following `cust.yaml`.
|
1. Write and save the following `cust.yaml`.
|
||||||
```yaml
|
```yaml
|
||||||
BaseURL: https://github.com/yousa-ling-official-production/yousa-ling-diffsinger-v1/releases/download/v1.3
|
BaseURL: https://github.com/yousa-ling-official-production/yousa-ling-diffsinger-v1/releases/download/v1.3
|
||||||
Targets:
|
Targets:
|
||||||
- Folder: . # the folder you want to download into
|
- Folder: . # the folder you want to download into
|
||||||
Copy: # files to download
|
Copy: # files to download
|
||||||
- yousaV1.3.zip
|
- yousaV1.3.zip
|
||||||
```
|
```
|
||||||
2. Run `rvcmd` in the same folder.
|
2. Run `rvcmd` in the same folder.
|
||||||
```bash
|
```bash
|
||||||
rvcmd -c cust
|
rvcmd -c cust
|
||||||
```
|
```
|
||||||
|
|
||||||
## Full Usage
|
## Full Usage
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
Usage: rvcmd [-notrs] [-dns dns.yaml] 'target/to/download'
|
Usage: rvcmd [-notrs] [-dns dns.yaml] 'target/to/download'
|
||||||
-c use custom yaml instruction
|
-c use custom yaml instruction
|
||||||
@@ -75,6 +96,8 @@ Usage: rvcmd [-notrs] [-dns dns.yaml] 'target/to/download'
|
|||||||
use standard TLS client
|
use standard TLS client
|
||||||
-notui
|
-notui
|
||||||
use plain text instead of TUI
|
use plain text instead of TUI
|
||||||
|
-ua string
|
||||||
|
customize user agent
|
||||||
-w uint
|
-w uint
|
||||||
connection waiting seconds (default 4)
|
connection waiting seconds (default 4)
|
||||||
'target/to/download'
|
'target/to/download'
|
||||||
@@ -104,6 +127,7 @@ All available targets:
|
|||||||
tools:
|
tools:
|
||||||
ffmpeg
|
ffmpeg
|
||||||
```
|
```
|
||||||
|
|
||||||
## Demo Video
|
## Demo Video
|
||||||
|
|
||||||
https://github.com/RVC-Project/RVC-Models-Downloader/assets/41315874/da2b5827-8b1a-45f8-a9c0-03a5618ad5f8
|
https://github.com/RVC-Project/RVC-Models-Downloader/assets/41315874/da2b5827-8b1a-45f8-a9c0-03a5618ad5f8
|
||||||
|
|||||||
135
README_kr.md
Normal file
135
README_kr.md
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
# RVC-Models-Downloader
|
||||||
|
|
||||||
|
[English](README.md) | [简体中文](README_sc.md) | 한국어
|
||||||
|
|
||||||
|
yaml의 batch 파일을 쉽게 다운로드 할 수 있는 도구입니다. (Hugging Face 🤗의 RVC 모델 등).
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## 빠른 시작
|
||||||
|
|
||||||
|
### 준비
|
||||||
|
|
||||||
|
1. [릴리스](https://github.com/RVC-Project/RVC-Models-Downloader/releases) 페이지에서 프로그램을 다운로드를 받아주세요.
|
||||||
|
2. 해당 프로그램을 RVC의 루트 디렉토리(또는 파일을 다운로드하고 싶은 위치)에 넣어주세요.
|
||||||
|
3. 이 도구를 어디에서나 사용할 수 있도록 `PATH`에 추가할 수도 있습니다. 패키지 매니저를 통해 이 프로그램을 설치했다면 이미 `PATH`에 등록되어 있을 수 있습니다.
|
||||||
|
|
||||||
|
### 다운로드
|
||||||
|
|
||||||
|
#### RVC의 모든 자산
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rvcmd assets/all
|
||||||
|
```
|
||||||
|
|
||||||
|
#### RVC의 최신 일반 팩 (Windows 전용)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rvcmd packs/general/latest
|
||||||
|
```
|
||||||
|
|
||||||
|
#### ffmpeg 도구 (Windows 전용)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rvcmd tools/ffmpeg
|
||||||
|
```
|
||||||
|
|
||||||
|
### 사용자 정의 다운로드
|
||||||
|
|
||||||
|
#### 예시 1. ffmpeg 도구 & 최신 인텔 팩 다운로드
|
||||||
|
|
||||||
|
1. 다음 내용을 포함한 `cust.yaml`을 작성하고 저장합니다.
|
||||||
|
```yaml
|
||||||
|
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
|
||||||
|
Targets:
|
||||||
|
- Refer: tools/ffmpeg
|
||||||
|
- Refer: packs/intel/latest
|
||||||
|
```
|
||||||
|
2. 같은 폴더에서 `rvcmd`를 실행합니다.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rvcmd -c cust
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 예시 2. 🤗의 다른 저장소 다운로드
|
||||||
|
|
||||||
|
> [Stable Diffusion v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5)를 예시로 사용합니다.
|
||||||
|
|
||||||
|
1. 다음 내용을 포함한 `cust.yaml`을 작성하고 저장합니다.
|
||||||
|
```yaml
|
||||||
|
BaseURL: https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main
|
||||||
|
Targets:
|
||||||
|
- Folder: sd1.5 # 다운로드할 폴더
|
||||||
|
Copy: # 다운로드할 파일
|
||||||
|
- v1-5-pruned-emaonly.ckpt
|
||||||
|
- v1-5-pruned-emaonly.safetensors
|
||||||
|
- Folder: sd1.5/vae # 다운로드할 폴더
|
||||||
|
Copy: # 다운로드할 파일
|
||||||
|
- vae/diffusion_pytorch_model.bin
|
||||||
|
```
|
||||||
|
|
||||||
|
#### 예시 3. GitHub에서 릴리스 다운로드
|
||||||
|
|
||||||
|
> [yousa-ling-diffsinger-v1.3](https://github.com/yousa-ling-official-production/yousa-ling-diffsinger-v1/releases/tag/v1.3)를 예시로 사용합니다.
|
||||||
|
|
||||||
|
1. 다음 내용을 포함한 `cust.yaml`을 작성하고 저장합니다.
|
||||||
|
```yaml
|
||||||
|
BaseURL: https://github.com/yousa-ling-official-production/yousa-ling-diffsinger-v1/releases/download/v1.3
|
||||||
|
Targets:
|
||||||
|
- Folder: . # 다운로드할 폴더
|
||||||
|
Copy: # 다운로드할 파일
|
||||||
|
- yousaV1.3.zip
|
||||||
|
```
|
||||||
|
2. 같은 폴더에서 `rvcmd`를 실행합니다.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
rvcmd -c cust
|
||||||
|
```
|
||||||
|
|
||||||
|
## 전체 사용법
|
||||||
|
|
||||||
|
```bash
|
||||||
|
Usage: rvcmd [-notrs] [-dns dns.yaml] 'target/to/download'
|
||||||
|
-c use custom yaml instruction
|
||||||
|
-dns string
|
||||||
|
custom dns.yaml
|
||||||
|
-f force download even file exists
|
||||||
|
-notrs
|
||||||
|
use standard TLS client
|
||||||
|
-notui
|
||||||
|
use plain text instead of TUI
|
||||||
|
-ua string
|
||||||
|
customize user agent
|
||||||
|
-w uint
|
||||||
|
connection waiting seconds (default 4)
|
||||||
|
'target/to/download'
|
||||||
|
like packs/general/latest
|
||||||
|
All available targets:
|
||||||
|
assets:
|
||||||
|
all hubert rmvpe uvr5 v1 v2
|
||||||
|
packs:
|
||||||
|
amd:
|
||||||
|
latest
|
||||||
|
v2:
|
||||||
|
20230813 20231006
|
||||||
|
general:
|
||||||
|
latest
|
||||||
|
v1:
|
||||||
|
20230331 20230416 20230428 20230508 20230513 20230516 20230717
|
||||||
|
v2:
|
||||||
|
20230528 20230618
|
||||||
|
intel:
|
||||||
|
latest
|
||||||
|
v2:
|
||||||
|
20230813 20231006
|
||||||
|
nvidia:
|
||||||
|
latest
|
||||||
|
v2:
|
||||||
|
20230813 20231006
|
||||||
|
tools:
|
||||||
|
ffmpeg
|
||||||
|
```
|
||||||
|
|
||||||
|
## 데모 비디오
|
||||||
|
|
||||||
|
https://github.com/RVC-Project/RVC-Models-Downloader/assets/41315874/da2b5827-8b1a-45f8-a9c0-03a5618ad5f8
|
||||||
101
README_sc.md
101
README_sc.md
@@ -1,70 +1,91 @@
|
|||||||
# RVC模型下载器
|
# RVC 模型下载器
|
||||||
[English](README.md) | 简体中文
|
|
||||||
|
[English](README.md) | 简体中文 | [한국어](README_kr.md)
|
||||||
|
|
||||||
一个能够批量下载`yaml`清单内文件的简单工具(例如 Hugging Face 🤗 中的 RVC 模型)。
|
一个能够批量下载`yaml`清单内文件的简单工具(例如 Hugging Face 🤗 中的 RVC 模型)。
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## 快速开始
|
## 快速开始
|
||||||
|
|
||||||
### 准备工作
|
### 准备工作
|
||||||
|
|
||||||
1. 在[发布](https://github.com/RVC-Project/RVC-Models-Downloader/releases)页面下载程序。
|
1. 在[发布](https://github.com/RVC-Project/RVC-Models-Downloader/releases)页面下载程序。
|
||||||
2. 将此程序放入RVC的根目录(或您想要下载文件的任何位置)。
|
2. 将此程序放入 RVC 的根目录(或您想要下载文件的任何位置)。
|
||||||
3. 您也可以将它添加到`PATH`中以便在任何地方使用此工具。如果您已经通过包管理器安装了此程序,那么它可能已经位于`PATH`。
|
3. 您也可以将它添加到`PATH`中以便在任何地方使用此工具。如果您已经通过包管理器安装了此程序,那么它可能已经位于`PATH`。
|
||||||
|
|
||||||
### 下载
|
### 下载
|
||||||
#### RVC的所有资源文件
|
|
||||||
|
#### RVC 的所有资源文件
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rvcmd assets/all
|
rvcmd assets/all
|
||||||
```
|
```
|
||||||
#### RVC的最新通用整合包(仅限Windows)
|
|
||||||
|
#### RVC 的最新通用整合包(仅限 Windows)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rvcmd packs/general/latest
|
rvcmd packs/general/latest
|
||||||
```
|
```
|
||||||
#### ffmpeg工具(仅限Windows)
|
|
||||||
|
#### ffmpeg 工具(仅限 Windows)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
rvcmd tools/ffmpeg
|
rvcmd tools/ffmpeg
|
||||||
```
|
```
|
||||||
|
|
||||||
### 自定义下载
|
### 自定义下载
|
||||||
#### 示例1. 下载ffmpeg工具和最新的Intel包
|
|
||||||
|
#### 示例 1. 下载 ffmpeg 工具和最新的 Intel 包
|
||||||
|
|
||||||
1. 编写并保存以下`cust.yaml`。
|
1. 编写并保存以下`cust.yaml`。
|
||||||
```yaml
|
```yaml
|
||||||
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
|
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
|
||||||
Targets:
|
Targets:
|
||||||
- Refer: tools/ffmpeg
|
- Refer: tools/ffmpeg
|
||||||
- Refer: packs/intel/latest
|
- Refer: packs/intel/latest
|
||||||
```
|
```
|
||||||
2. 在同一文件夹中运行`rvcmd`。
|
2. 在同一文件夹中运行`rvcmd`。
|
||||||
```bash
|
```bash
|
||||||
rvcmd -c cust
|
rvcmd -c cust
|
||||||
```
|
```
|
||||||
#### 示例2. 下载🤗中的其他仓库
|
|
||||||
|
#### 示例 2. 下载 🤗 中的其他仓库
|
||||||
|
|
||||||
> 以 [Stable Diffusion v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5) 为例。
|
> 以 [Stable Diffusion v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5) 为例。
|
||||||
|
|
||||||
1. 编写并保存以下`cust.yaml`。
|
1. 编写并保存以下`cust.yaml`。
|
||||||
```yaml
|
```yaml
|
||||||
BaseURL: https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main
|
BaseURL: https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main
|
||||||
Targets:
|
Targets:
|
||||||
- Folder: sd1.5 # the folder you want to download into
|
- Folder: sd1.5 # the folder you want to download into
|
||||||
Copy: # files to download
|
Copy: # files to download
|
||||||
- v1-5-pruned-emaonly.ckpt
|
- v1-5-pruned-emaonly.ckpt
|
||||||
- v1-5-pruned-emaonly.safetensors
|
- v1-5-pruned-emaonly.safetensors
|
||||||
- Folder: sd1.5/vae # the folder you want to download into
|
- Folder: sd1.5/vae # the folder you want to download into
|
||||||
Copy: # files to download
|
Copy: # files to download
|
||||||
- vae/diffusion_pytorch_model.bin
|
- vae/diffusion_pytorch_model.bin
|
||||||
```
|
```
|
||||||
#### 示例3. 下载GitHub中的发布版本
|
|
||||||
|
#### 示例 3. 下载 GitHub 中的发布版本
|
||||||
|
|
||||||
> 以 [yousa-ling-diffsinger-v1.3](https://github.com/yousa-ling-official-production/yousa-ling-diffsinger-v1/releases/tag/v1.3) 为例。
|
> 以 [yousa-ling-diffsinger-v1.3](https://github.com/yousa-ling-official-production/yousa-ling-diffsinger-v1/releases/tag/v1.3) 为例。
|
||||||
|
|
||||||
1. 编写并保存以下`cust.yaml`。
|
1. 编写并保存以下`cust.yaml`。
|
||||||
```yaml
|
```yaml
|
||||||
BaseURL: https://github.com/yousa-ling-official-production/yousa-ling-diffsinger-v1/releases/download/v1.3
|
BaseURL: https://github.com/yousa-ling-official-production/yousa-ling-diffsinger-v1/releases/download/v1.3
|
||||||
Targets:
|
Targets:
|
||||||
- Folder: . # the folder you want to download into
|
- Folder: . # the folder you want to download into
|
||||||
Copy: # files to download
|
Copy: # files to download
|
||||||
- yousaV1.3.zip
|
- yousaV1.3.zip
|
||||||
```
|
```
|
||||||
2. 在同一文件夹中运行`rvcmd`。
|
2. 在同一文件夹中运行`rvcmd`。
|
||||||
```bash
|
```bash
|
||||||
rvcmd -c cust
|
rvcmd -c cust
|
||||||
```
|
```
|
||||||
|
|
||||||
## 完整用法
|
## 完整用法
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
Usage: rvcmd [-notrs] [-dns dns.yaml] 'target/to/download'
|
Usage: rvcmd [-notrs] [-dns dns.yaml] 'target/to/download'
|
||||||
-c use custom yaml instruction
|
-c use custom yaml instruction
|
||||||
@@ -75,6 +96,8 @@ Usage: rvcmd [-notrs] [-dns dns.yaml] 'target/to/download'
|
|||||||
use standard TLS client
|
use standard TLS client
|
||||||
-notui
|
-notui
|
||||||
use plain text instead of TUI
|
use plain text instead of TUI
|
||||||
|
-ua string
|
||||||
|
customize user agent
|
||||||
-w uint
|
-w uint
|
||||||
connection waiting seconds (default 4)
|
connection waiting seconds (default 4)
|
||||||
'target/to/download'
|
'target/to/download'
|
||||||
|
|||||||
2
go.mod
2
go.mod
@@ -3,7 +3,7 @@ module rvcmd
|
|||||||
go 1.22.1
|
go 1.22.1
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/fumiama/terasu v0.0.0-20240420161109-c8c0088d72cd
|
github.com/fumiama/terasu v0.0.0-20240502091919-c887e26289a8
|
||||||
github.com/gizak/termui/v3 v3.1.0
|
github.com/gizak/termui/v3 v3.1.0
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
github.com/sirupsen/logrus v1.9.3
|
github.com/sirupsen/logrus v1.9.3
|
||||||
|
|||||||
4
go.sum
4
go.sum
@@ -5,8 +5,8 @@ github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7/go.mod h1:vD7Ra3Q9o
|
|||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/fumiama/terasu v0.0.0-20240420161109-c8c0088d72cd h1:cEUaAUdb1uVyOfEenCMtU3lUMELTVwepn/g7UL/CK54=
|
github.com/fumiama/terasu v0.0.0-20240502091919-c887e26289a8 h1:mVOgOhlrF0ra8/BkwVA71ev/1HkzAgDn8gWU2UNbDU8=
|
||||||
github.com/fumiama/terasu v0.0.0-20240420161109-c8c0088d72cd/go.mod h1:afchyfKAb7J/zvaENtYzjIEPVbwiEjJaow05zzT4usM=
|
github.com/fumiama/terasu v0.0.0-20240502091919-c887e26289a8/go.mod h1:UVx8YP1jKKL1Cj+uy+OnQRM2Ih6U36Mqy9GSf7jabsI=
|
||||||
github.com/gizak/termui/v3 v3.1.0 h1:ZZmVDgwHl7gR7elfKf1xc4IudXZ5qqfDh4wExk4Iajc=
|
github.com/gizak/termui/v3 v3.1.0 h1:ZZmVDgwHl7gR7elfKf1xc4IudXZ5qqfDh4wExk4Iajc=
|
||||||
github.com/gizak/termui/v3 v3.1.0/go.mod h1:bXQEBkJpzxUAKf0+xq9MSWAvWZlE7c+aidmyFlkYTrY=
|
github.com/gizak/termui/v3 v3.1.0/go.mod h1:bXQEBkJpzxUAKf0+xq9MSWAvWZlE7c+aidmyFlkYTrY=
|
||||||
github.com/mattn/go-runewidth v0.0.2 h1:UnlwIPBGaTZfPQ6T1IGzPI0EkYAQmT9fAEJ/poFC63o=
|
github.com/mattn/go-runewidth v0.0.2 h1:UnlwIPBGaTZfPQ6T1IGzPI0EkYAQmT9fAEJ/poFC63o=
|
||||||
|
|||||||
5
main.go
5
main.go
@@ -20,8 +20,6 @@ import (
|
|||||||
|
|
||||||
//go:generate ./pckcfg.sh assets packs tools
|
//go:generate ./pckcfg.sh assets packs tools
|
||||||
|
|
||||||
const ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0"
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
notui = false
|
notui = false
|
||||||
sc screen
|
sc screen
|
||||||
@@ -33,6 +31,7 @@ func main() {
|
|||||||
cust := flag.Bool("c", false, "use custom yaml instruction")
|
cust := flag.Bool("c", false, "use custom yaml instruction")
|
||||||
force := flag.Bool("f", false, "force download even file exists")
|
force := flag.Bool("f", false, "force download even file exists")
|
||||||
wait := flag.Uint("w", 4, "connection waiting seconds")
|
wait := flag.Uint("w", 4, "connection waiting seconds")
|
||||||
|
ua := flag.String("ua", defua, "customize user agent")
|
||||||
flag.BoolVar(¬ui, "notui", false, "use plain text instead of TUI")
|
flag.BoolVar(¬ui, "notui", false, "use plain text instead of TUI")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
args := flag.Args()
|
args := flag.Args()
|
||||||
@@ -89,7 +88,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
ch := make(chan struct{})
|
ch := make(chan struct{})
|
||||||
go func() {
|
go func() {
|
||||||
err := usercfg.download(args[0], "", time.Second*time.Duration(*wait), *cust, !*ntrs, *force)
|
err := usercfg.download(args[0], "", *ua, time.Second*time.Duration(*wait), *cust, !*ntrs, *force)
|
||||||
ch <- struct{}{}
|
ch <- struct{}{}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errorln(err)
|
errorln(err)
|
||||||
|
|||||||
8
net.go
8
net.go
@@ -15,7 +15,7 @@ import (
|
|||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c *config) download(path, prefix string, waits time.Duration, usecust, usetrs, force bool) error {
|
func (c *config) download(path, prefix, ua string, waits time.Duration, usecust, usetrs, force bool) error {
|
||||||
for i, t := range c.Targets {
|
for i, t := range c.Targets {
|
||||||
if t.Refer != "" {
|
if t.Refer != "" {
|
||||||
refp := path[:strings.LastIndex(path, "/")+1] + t.Refer
|
refp := path[:strings.LastIndex(path, "/")+1] + t.Refer
|
||||||
@@ -24,7 +24,7 @@ func (c *config) download(path, prefix string, waits time.Duration, usecust, use
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = refcfg.download(refp, prefix+strconv.Itoa(i+1)+".", waits, usecust, usetrs, force)
|
err = refcfg.download(refp, prefix+strconv.Itoa(i+1)+".", ua, waits, usecust, usetrs, force)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -70,7 +70,9 @@ func (c *config) download(path, prefix string, waits time.Duration, usecust, use
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
infof("#%s%d get: %s", prefix, i+1, req.URL)
|
infof("#%s%d get: %s", prefix, i+1, req.URL)
|
||||||
req.Header.Add("user-agent", ua)
|
if len(ua) > 0 {
|
||||||
|
req.Header.Add("user-agent", ua)
|
||||||
|
}
|
||||||
var resp *http.Response
|
var resp *http.Response
|
||||||
if usetrs {
|
if usetrs {
|
||||||
resp, err = http2.DefaultClient.Do(req)
|
resp, err = http2.DefaultClient.Do(req)
|
||||||
|
|||||||
5
ua.go
Normal file
5
ua.go
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
//go:build !windows
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
const defua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0"
|
||||||
3
ua_windows.go
Normal file
3
ua_windows.go
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
const defua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36 Edg/123.0.0.0"
|
||||||
Reference in New Issue
Block a user