1
0
mirror of https://github.com/fumiama/RVC-Models-Downloader.git synced 2026-01-22 07:43:47 +09:00

16 Commits

Author SHA1 Message Date
源文雨
2e0d701e75 bump: goreleaser to latest go 1.25 2025-11-20 17:00:03 +08:00
源文雨
f0b2459aa7 feat: support proxy & update to new trs 2025-11-20 16:56:30 +08:00
源文雨
8312d008be feat: add new param -H 2025-01-07 20:40:36 +09:00
源文雨
9adfe30580 feat: impl. newest chtts 2024-10-16 01:25:53 +09:00
源文雨
7a172aef42 feat(chtts): add copy asset/gpt & drop GPT.pt 2024-08-25 11:22:25 +08:00
源文雨
ff8949393c feat(chtts): add copy asset/tokenizer & drop spk_stat 2024-08-05 21:40:46 +08:00
源文雨
bdb4b458b9 feat: add DVAE_full.pt 2024-07-18 18:15:23 +09:00
源文雨
2be2bcb536 feat(chtts): drop copy of config 2024-07-16 16:54:24 +09:00
源文雨
4c39b7de22 feat: support proxy from env (#4)
ref https://stackoverflow.com/questions/69789948/go-ignores-http-proxy-environment-variable
2024-07-10 18:55:26 +09:00
源文雨
24ed668d84 chore: update hf dns 2024-06-17 18:20:29 +09:00
源文雨
3808e901be feat: add chattts download & del unnecessaries 2024-06-17 18:08:52 +09:00
源文雨
2b6ca35a6d feat: customizable ua (#2) 2024-05-18 20:29:23 +09:00
源文雨
e6b2709814 Merge pull request #3 from pengooseDev/main
Docs: Add README_kr.md & Linting
2024-05-13 00:04:50 +09:00
pengoosedev
0bcc668b80 docs: add READ_kr link & Linting docs 2024-05-12 20:21:10 +09:00
pengoosedev
97c40d407e docs: add README_kr 2024-05-12 20:20:29 +09:00
源文雨
a37825d740 chore: update deps 2024-05-03 00:30:51 +09:00
42 changed files with 322 additions and 276 deletions

View File

@@ -15,6 +15,8 @@ jobs:
- name: Set up Go
uses: actions/setup-go@master
with:
go-version: ^1.25
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@master

3
.gitignore vendored
View File

@@ -25,3 +25,6 @@ go.work
# MacOS system file
.DS_Store
# build result
/build

View File

@@ -81,7 +81,7 @@ archives:
nfpms:
- license: AGPL 3.0
homepage: https://github.com/RVC-Project/RVC-Models-Downloader
homepage: https://github.com/fumiama/RVC-Models-Downloader
file_name_template: "rvcmd_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
formats:
- deb

33
Makefile Normal file
View File

@@ -0,0 +1,33 @@
PROJECT_NAME := rvcmd
BUILD_PATH := build
RUN_CMD := -h
GOOS := $(go env GOOS)
GOARCH := $(go env GOARCH)
GO_SRC_WIN := $(shell find . -maxdepth 1 -name '*.go' | grep -v '_test.go$$' | grep -v '_windows.go$$')
GO_SRC_NO_WIN := $(shell echo $(GO_SRC_WIN) | grep -v '_windows.go$$')
all:
@$(MAKE) -e bin
bin: gen dir tidy
@if [[ "$(GOARCH)" == "windows" ]]; then \
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags "-s -w" -trimpath -o $(BUILD_PATH)/$(PROJECT_NAME).exe; \
else \
GOOS=$(GOOS) GOARCH=$(GOARCH) go build -ldflags "-s -w" -trimpath -o $(BUILD_PATH)/$(PROJECT_NAME); \
fi
run: bin
@if [[ "$(GOARCH)" == "windows" ]]; then \
$(BUILD_PATH)/$(PROJECT_NAME).exe $(RUN_CMD); \
else \
$(BUILD_PATH)/$(PROJECT_NAME) $(RUN_CMD); \
fi
gen:
@go generate
tidy:
@go mod tidy
dir:
@if [ ! -d "$(BUILD_PATH)" ]; then mkdir $(BUILD_PATH); fi
clean:
@if [ -d "$(BUILD_PATH)" ]; then \
rm -rf $(BUILD_PATH)/$(PROJECT_NAME)*; \
fi

View File

@@ -1,43 +1,53 @@
# 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 🤗).
![tui demo](https://github.com/RVC-Project/RVC-Models-Downloader/assets/41315874/db577dfb-8a6d-4909-b071-9d36cc77afc6)
![tui demo](https://github.com/fumiama/RVC-Models-Downloader/assets/41315874/db577dfb-8a6d-4909-b071-9d36cc77afc6)
## Quick Start
### 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/fumiama/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).
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
#### All Assets of RVC
```bash
rvcmd assets/all
rvcmd assets/rvc
```
#### Latest General Pack of RVC (Windows Only)
#### All Assets of ChatTTS
```bash
rvcmd packs/general/latest
```
#### ffmpeg Tools (Windows Only)
```bash
rvcmd tools/ffmpeg
rvcmd -w 1 assets/chtts
```
### Customized Download
#### Ex.1. Download ffmpeg Tools & Latest Intel Pack
#### Ex.1. Download hubert & rmvpe
1. Write and save the following `cust.yaml`.
```yaml
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
BaseURL: https://huggingface.co/fumiama/RVC-Pretrained-Models/resolve/main
Targets:
- Refer: tools/ffmpeg
- Refer: packs/intel/latest
- Refer: hubert
- Refer: rmvpe
```
2. Run `rvcmd` in the same folder.
```bash
rvcmd -c cust
```
#### Ex.2. Download other Repositories in 🤗
> Use [Stable Diffusion v1-5](https://huggingface.co/runwayml/stable-diffusion-v1-5) as the example.
1. Write and save the following `cust.yaml`.
```yaml
BaseURL: https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main
@@ -50,8 +60,11 @@ rvcmd tools/ffmpeg
Copy: # files to download
- vae/diffusion_pytorch_model.bin
```
#### 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.
1. Write and save the following `cust.yaml`.
```yaml
BaseURL: https://github.com/yousa-ling-official-production/yousa-ling-diffsinger-v1/releases/download/v1.3
@@ -64,7 +77,9 @@ rvcmd tools/ffmpeg
```bash
rvcmd -c cust
```
## Full Usage
```bash
Usage: rvcmd [-notrs] [-dns dns.yaml] 'target/to/download'
-c use custom yaml instruction
@@ -75,35 +90,17 @@ Usage: rvcmd [-notrs] [-dns dns.yaml] 'target/to/download'
use standard TLS client
-notui
use plain text instead of TUI
-ua string
customize user agent (default "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")
-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
chtts hubert rmvpe rvc uvr5 v1 v2
```
## Demo Video
https://github.com/RVC-Project/RVC-Models-Downloader/assets/41315874/da2b5827-8b1a-45f8-a9c0-03a5618ad5f8
https://github.com/fumiama/RVC-Models-Downloader/assets/41315874/da2b5827-8b1a-45f8-a9c0-03a5618ad5f8

106
README_kr.md Normal file
View File

@@ -0,0 +1,106 @@
# RVC-Models-Downloader
[English](README.md) | [简体中文](README_sc.md) | 한국어
yaml의 batch 파일을 쉽게 다운로드 할 수 있는 도구입니다. (Hugging Face 🤗의 RVC 모델 등).
![tui demo](https://github.com/fumiama/RVC-Models-Downloader/assets/41315874/db577dfb-8a6d-4909-b071-9d36cc77afc6)
## 빠른 시작
### 준비
1. [릴리스](https://github.com/fumiama/RVC-Models-Downloader/releases) 페이지에서 프로그램을 다운로드를 받아주세요.
2. 해당 프로그램을 RVC의 루트 디렉토리(또는 파일을 다운로드하고 싶은 위치)에 넣어주세요.
3. 이 도구를 어디에서나 사용할 수 있도록 `PATH`에 추가할 수도 있습니다. 패키지 매니저를 통해 이 프로그램을 설치했다면 이미 `PATH`에 등록되어 있을 수 있습니다.
### 다운로드
#### RVC의 모든 자산
```bash
rvcmd assets/rvc
```
#### ChatTTS의 모든 자산
```bash
rvcmd -w 1 assets/chtts
```
### 사용자 정의 다운로드
#### 예시 1. hubert & rmvpe 다운로드
1. 다음 내용을 포함한 `cust.yaml`을 작성하고 저장합니다.
```yaml
BaseURL: https://huggingface.co/fumiama/RVC-Pretrained-Models/resolve/main
Targets:
- Refer: hubert
- Refer: rmvpe
```
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 (default "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")
-w uint
connection waiting seconds (default 4)
'target/to/download'
like packs/general/latest
All available targets:
assets:
chtts hubert rmvpe rvc uvr5 v1 v2
```
## 데모 비디오
https://github.com/fumiama/RVC-Models-Downloader/assets/41315874/da2b5827-8b1a-45f8-a9c0-03a5618ad5f8

View File

@@ -1,43 +1,52 @@
# RVC模型下载器
[English](README.md) | 简体中文
# RVC 模型下载器
[English](README.md) | 简体中文 | [한국어](README_kr.md)
一个能够批量下载`yaml`清单内文件的简单工具(例如 Hugging Face 🤗 中的 RVC 模型)。
![tui demo](https://github.com/RVC-Project/RVC-Models-Downloader/assets/41315874/db577dfb-8a6d-4909-b071-9d36cc77afc6)
![tui demo](https://github.com/fumiama/RVC-Models-Downloader/assets/41315874/db577dfb-8a6d-4909-b071-9d36cc77afc6)
## 快速开始
### 准备工作
1. 在[发布](https://github.com/RVC-Project/RVC-Models-Downloader/releases)页面下载程序。
2. 将此程序放入RVC的根目录或您想要下载文件的任何位置
1. 在[发布](https://github.com/fumiama/RVC-Models-Downloader/releases)页面下载程序
2. 将此程序放入 RVC 的根目录(或您想要下载文件的任何位置)。
3. 您也可以将它添加到`PATH`中以便在任何地方使用此工具。如果您已经通过包管理器安装了此程序,那么它可能已经位于`PATH`
### 下载
#### RVC的所有资源文件
#### RVC 的所有资源文件
```bash
rvcmd assets/all
```
#### RVC的最新通用整合包仅限Windows
#### ChatTTS 的所有资源文件
```bash
rvcmd packs/general/latest
```
#### ffmpeg工具仅限Windows
```bash
rvcmd tools/ffmpeg
rvcmd -w 1 assets/chtts
```
### 自定义下载
#### 示例1. 下载ffmpeg工具和最新的Intel包
#### 示例 1. 下载 hubert 和 rmvpe
1. 编写并保存以下`cust.yaml`
```yaml
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
BaseURL: https://huggingface.co/fumiama/RVC-Pretrained-Models/resolve/main
Targets:
- Refer: tools/ffmpeg
- Refer: packs/intel/latest
- Refer: hubert
- Refer: rmvpe
```
2. 在同一文件夹中运行`rvcmd`。
```bash
rvcmd -c cust
```
#### 示例2. 下载🤗中的其他仓库
#### 示例 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
@@ -50,8 +59,11 @@ rvcmd tools/ffmpeg
Copy: # files to download
- 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) 为例。
1. 编写并保存以下`cust.yaml`。
```yaml
BaseURL: https://github.com/yousa-ling-official-production/yousa-ling-diffsinger-v1/releases/download/v1.3
@@ -64,7 +76,9 @@ rvcmd tools/ffmpeg
```bash
rvcmd -c cust
```
## 完整用法
```bash
Usage: rvcmd [-notrs] [-dns dns.yaml] 'target/to/download'
-c use custom yaml instruction
@@ -75,36 +89,17 @@ Usage: rvcmd [-notrs] [-dns dns.yaml] 'target/to/download'
use standard TLS client
-notui
use plain text instead of TUI
-ua string
customize user agent (default "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")
-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
chtts hubert rmvpe rvc uvr5 v1 v2
```
## 示例录屏
https://github.com/RVC-Project/RVC-Models-Downloader/assets/41315874/da2b5827-8b1a-45f8-a9c0-03a5618ad5f8
https://github.com/fumiama/RVC-Models-Downloader/assets/41315874/da2b5827-8b1a-45f8-a9c0-03a5618ad5f8

17
assets/chtts.yaml Normal file
View File

@@ -0,0 +1,17 @@
BaseURL: https://huggingface.co/2Noise/ChatTTS/resolve/main
Targets:
- Folder: asset
Copy:
- asset/Decoder.safetensors
- asset/DVAE.safetensors
- asset/Embed.safetensors
- asset/Vocos.safetensors
- Folder: asset/gpt
Copy:
- asset/gpt/config.json
- asset/gpt/model.safetensors
- Folder: asset/tokenizer
Copy:
- asset/tokenizer/special_tokens_map.json
- asset/tokenizer/tokenizer_config.json
- asset/tokenizer/tokenizer.json

View File

@@ -1,5 +1,5 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
BaseURL: https://huggingface.co/fumiama/RVC-Pretrained-Models/resolve/main
Targets:
- Folder: assets/hubert
Copy:
- hubert_base.pt
- hubert/hubert_base.pt

View File

@@ -1,6 +1,6 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
BaseURL: https://huggingface.co/fumiama/RVC-Pretrained-Models/resolve/main
Targets:
- Folder: assets/rmvpe
Copy:
- rmvpe.pt
- rmvpe.onnx
- rmvpe/rmvpe.pt
- rmvpe/rmvpe.onnx

View File

@@ -1,4 +1,4 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
BaseURL: https://huggingface.co/fumiama/RVC-Pretrained-Models/resolve/main
Targets:
- Refer: hubert
- Refer: rmvpe

View File

@@ -1,4 +1,4 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
BaseURL: https://huggingface.co/fumiama/RVC-Pretrained-Models/resolve/main
Targets:
- Folder: assets/uvr5_weights
Copy:

View File

@@ -1,4 +1,4 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
BaseURL: https://huggingface.co/fumiama/RVC-Pretrained-Models/resolve/main
Targets:
- Refer: hubert
- Folder: assets/pretrained

View File

@@ -1,4 +1,4 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
BaseURL: https://huggingface.co/fumiama/RVC-Pretrained-Models/resolve/main
Targets:
- Refer: hubert
- Folder: assets/pretrained_v2

View File

@@ -1,28 +1,28 @@
Servers: {}
Fallbacks:
cdn-lfs.huggingface.co:
- 3.163.218.77
- 3.163.218.75
- 3.163.218.60
- 3.163.218.88
- 2600:9000:26a9:6e00:11:f807:5180:93a1
- 2600:9000:26a9:8400:11:f807:5180:93a1
- 2600:9000:26a9:e400:11:f807:5180:93a1
- 2600:9000:26a9:6400:11:f807:5180:93a1
- 2600:9000:26a9:f400:11:f807:5180:93a1
- 2600:9000:26a9:ec00:11:f807:5180:93a1
- 2600:9000:26a9:6600:11:f807:5180:93a1
- 2600:9000:26a9:fa00:11:f807:5180:93a1
- 13.249.146.70
- 13.249.146.79
- 13.249.146.118
- 13.249.146.81
- 2600:9000:2112:1200:11:f807:5180:93a1
- 2600:9000:2112:5600:11:f807:5180:93a1
- 2600:9000:2112:bc00:11:f807:5180:93a1
- 2600:9000:2112:c200:11:f807:5180:93a1
- 2600:9000:2112:da00:11:f807:5180:93a1
- 2600:9000:2112:7600:11:f807:5180:93a1
- 2600:9000:2112:6600:11:f807:5180:93a1
- 2600:9000:2112:be00:11:f807:5180:93a1
huggingface.co:
- 18.65.159.75
- 18.65.159.63
- 18.65.159.2
- 18.65.159.20
- 2600:9000:2218:9200:17:b174:6d00:93a1
- 2600:9000:2218:e00:17:b174:6d00:93a1
- 2600:9000:2218:4800:17:b174:6d00:93a1
- 2600:9000:2218:6c00:17:b174:6d00:93a1
- 2600:9000:2218:b200:17:b174:6d00:93a1
- 2600:9000:2218:6800:17:b174:6d00:93a1
- 2600:9000:2218:c800:17:b174:6d00:93a1
- 2600:9000:2218:2e00:17:b174:6d00:93a1
- 2600:9000:2218:2400:17:b174:6d00:93a1
- 2600:9000:2218:5c00:17:b174:6d00:93a1
- 2600:9000:2218:de00:17:b174:6d00:93a1
- 2600:9000:2218:3600:17:b174:6d00:93a1
- 2600:9000:2218:3000:17:b174:6d00:93a1
- 2600:9000:2218:3200:17:b174:6d00:93a1
- 2600:9000:2218:2600:17:b174:6d00:93a1
- 2600:9000:2218:a200:17:b174:6d00:93a1

13
go.mod
View File

@@ -1,22 +1,21 @@
module rvcmd
go 1.22.1
go 1.24.0
require (
github.com/fumiama/terasu v0.0.0-20240420161109-c8c0088d72cd
github.com/fumiama/terasu v1.0.2
github.com/gizak/termui/v3 v3.1.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.9.3
golang.org/x/sys v0.19.0
golang.org/x/sys v0.38.0
gopkg.in/yaml.v3 v3.0.1
)
require (
github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1 // indirect
github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7 // indirect
github.com/FloatTech/ttl v0.0.0-20250224045156-012b1463287d // indirect
github.com/mattn/go-runewidth v0.0.2 // indirect
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 // indirect
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/text v0.17.0 // indirect
)

22
go.sum
View File

@@ -1,12 +1,10 @@
github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1 h1:g4pTnDJUW4VbJ9NvoRfUvdjDrHz/6QhfN/LoIIpICbo=
github.com/FloatTech/ttl v0.0.0-20230307105452-d6f7b2b647d1/go.mod h1:fHZFWGquNXuHttu9dUYoKuNbm3dzLETnIOnm1muSfDs=
github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7 h1:S/ferNiehVjNaBMNNBxUjLtVmP/YWD6Yh79RfPv4ehU=
github.com/RomiChan/syncx v0.0.0-20240418144900-b7402ffdebc7/go.mod h1:vD7Ra3Q9onRtojoY5sMCLQ7JBgjUsrXDnDKyFxqpf9w=
github.com/FloatTech/ttl v0.0.0-20250224045156-012b1463287d h1:mUQ/c3wXKsUGa4Sg9DBy01APXKB68PmobhxOyaJI7lY=
github.com/FloatTech/ttl v0.0.0-20250224045156-012b1463287d/go.mod h1:fHZFWGquNXuHttu9dUYoKuNbm3dzLETnIOnm1muSfDs=
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/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-20240420161109-c8c0088d72cd/go.mod h1:afchyfKAb7J/zvaENtYzjIEPVbwiEjJaow05zzT4usM=
github.com/fumiama/terasu v1.0.2 h1:Dxj2vPIgLHyeMlBd61xYHx5Jg8v7k24yg7taNLlK8/8=
github.com/fumiama/terasu v1.0.2/go.mod h1:1eHzpL/GJVcOnqEkh1vUbKu2zo6gojSuueUNJ9yHJE0=
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/mattn/go-runewidth v0.0.2 h1:UnlwIPBGaTZfPQ6T1IGzPI0EkYAQmT9fAEJ/poFC63o=
@@ -25,13 +23,13 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w=
golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8=
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

23
main.go
View File

@@ -18,9 +18,7 @@ import (
_ "rvcmd/console"
)
//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"
//go:generate ./pckcfg.sh assets
var (
notui = false
@@ -33,10 +31,14 @@ func main() {
cust := flag.Bool("c", false, "use custom yaml instruction")
force := flag.Bool("f", false, "force download even file exists")
wait := flag.Uint("w", 4, "connection waiting seconds")
ua := flag.String("ua", defua, "customize user agent")
h := flag.Bool("h", false, "display this help")
home := flag.String("H", ".", "download under this path")
flag.BoolVar(&notui, "notui", false, "use plain text instead of TUI")
flag.BoolVar(&ip.IsIPv6Available, "6", false, "use ipv6")
flag.Parse()
args := flag.Args()
if len(args) != 1 {
if len(args) != 1 || *h {
fmt.Println("Usage:", os.Args[0], "[-notrs] [-dns dns.yaml] 'target/to/download'")
flag.PrintDefaults()
fmt.Println(" 'target/to/download'\n like packs/general/latest")
@@ -44,10 +46,15 @@ func main() {
fmt.Println(cmdlst.String())
return
}
err := os.MkdirAll(*home, 0755)
if err != nil {
logrus.Errorln("mkdirs of path", *home, "err:", err)
return
}
if notui {
logrus.Infoln("RVC Models Downloader start at", time.Now().Local().Format(time.DateTime+" (MST)"))
logrus.Infof("operating system: %s, architecture: %s", runtime.GOOS, runtime.GOARCH)
logrus.Infoln("is ipv6 available:", ip.IsIPv6Available.Get())
logrus.Infoln("is ipv6 available:", ip.IsIPv6Available)
} else {
if err := ui.Init(); err != nil {
logrus.Errorln("failed to initialize termui:", err)
@@ -68,14 +75,14 @@ func main() {
errorln("open custom dns file", *dnsf, "err:", err)
return
}
m := dns.DNSConfig{}
m := dns.Config{}
err = yaml.NewDecoder(f).Decode(&m)
if err != nil {
errorln("decode custom dns file", *dnsf, "err:", err)
return
}
_ = f.Close()
if ip.IsIPv6Available.Get() {
if ip.IsIPv6Available {
dns.IPv6Servers.Add(&m)
} else {
dns.IPv4Servers.Add(&m)
@@ -89,7 +96,7 @@ func main() {
}
ch := make(chan struct{})
go func() {
err := usercfg.download(args[0], "", time.Second*time.Duration(*wait), *cust, !*ntrs, *force)
err := usercfg.download(args[0], "", *home, *ua, time.Second*time.Duration(*wait), *cust, !*ntrs, *force)
ch <- struct{}{}
if err != nil {
errorln(err)

32
net.go
View File

@@ -5,26 +5,33 @@ import (
"io"
"net/http"
"os"
"path"
"runtime"
"strconv"
"strings"
"sync"
"time"
"github.com/fumiama/terasu/http2"
trshttp "github.com/fumiama/terasu/http"
"github.com/pkg/errors"
)
func (c *config) download(path, prefix string, waits time.Duration, usecust, usetrs, force bool) error {
var pcli = &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
},
}
func (c *config) download(p, prefix, home, ua string, waits time.Duration, usecust, usetrs, force bool) error {
for i, t := range c.Targets {
if t.Refer != "" {
refp := path[:strings.LastIndex(path, "/")+1] + t.Refer
refp := p[:strings.LastIndex(p, "/")+1] + t.Refer
infof("#%s%d refer to target '%s'.", prefix, i+1, refp)
refcfg, err := readconfig(refp, usecust)
if err != nil {
return err
}
err = refcfg.download(refp, prefix+strconv.Itoa(i+1)+".", waits, usecust, usetrs, force)
err = refcfg.download(refp, prefix+strconv.Itoa(i+1)+".", home, ua, waits, usecust, usetrs, force)
if err != nil {
return err
}
@@ -38,11 +45,12 @@ func (c *config) download(path, prefix string, waits time.Duration, usecust, use
warnf("#%s%d target required Arch: %s but you are %s, skip.", prefix, i+1, t.Arch, runtime.GOARCH)
continue
}
err := os.MkdirAll(t.Folder, 0755)
homefolder := path.Join(home, t.Folder)
err := os.MkdirAll(homefolder, 0755)
if err != nil {
return errors.Wrap(err, fmt.Sprintf("#%s%d make target folder '%s'", prefix, i+1, t.Folder))
return errors.Wrap(err, fmt.Sprintf("#%s%d make target folder '%s'", prefix, i+1, homefolder))
}
infof("#%s%d open target folder '%s'.", prefix, i+1, t.Folder)
infof("#%s%d open target folder '%s'.", prefix, i+1, homefolder)
if len(t.Copy) == 0 {
warnf("#%s%d empty copy target.", prefix, i+1)
continue
@@ -57,7 +65,7 @@ func (c *config) download(path, prefix string, waits time.Duration, usecust, use
if sleep > time.Millisecond {
time.Sleep(sleep)
}
fname := t.Folder + "/" + cp[strings.LastIndex(cp, "/")+1:]
fname := path.Join(homefolder, cp[strings.LastIndex(cp, "/")+1:])
if !force {
if _, err := os.Stat(fname); err == nil || os.IsExist(err) {
warnf("#%s%d skip exist file %s", prefix, i+1, fname)
@@ -70,12 +78,14 @@ func (c *config) download(path, prefix string, waits time.Duration, usecust, use
return
}
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
if usetrs {
resp, err = http2.DefaultClient.Do(req)
resp, err = trshttp.DefaultClient.Do(req)
} else {
resp, err = http.DefaultClient.Do(req)
resp, err = pcli.Do(req)
}
if err != nil {
errorf("#%s%d get %s err: %v", prefix, i+1, req.URL, err)

View File

@@ -1,3 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Refer: v2/20231006

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC0813AMD_Intel.7z
OS: windows
Arch: amd64

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC1006AMD_Intel.7z
OS: windows
Arch: amd64

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC-beta.7z
OS: windows
Arch: amd64

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC-beta-v20230331.7z
OS: windows
Arch: amd64

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC-beta20230416.7z
OS: windows
Arch: amd64

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC-beta20230428.7z
OS: windows
Arch: amd64

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC-beta20230508.7z
OS: windows
Arch: amd64

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC-beta-20230513.7z
OS: windows
Arch: amd64

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC-beta20230516.7z
OS: windows
Arch: amd64

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC-beta0717.7z
OS: windows
Arch: amd64

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC-beta-v2-0528.7z
OS: windows
Arch: amd64

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC-beta-v2-0618.7z
OS: windows
Arch: amd64

View File

@@ -1,3 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Refer: v2/20231006

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC0813AMD_Intel.7z
OS: windows
Arch: amd64

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC1006AMD_Intel.7z
OS: windows
Arch: amd64

View File

@@ -1,3 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Refer: v2/20231006

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC0813Nvidia.7z
OS: windows
Arch: amd64

View File

@@ -1,7 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- RVC1006Nvidia.7z
OS: windows
Arch: amd64

View File

@@ -1,8 +0,0 @@
BaseURL: https://huggingface.co/lj1995/VoiceConversionWebUI/resolve/main
Targets:
- Folder: .
Copy:
- ffmpeg.exe
- ffprobe.exe
OS: windows
Arch: amd64

5
ua.go Normal file
View 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
View 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"

2
ui.go
View File

@@ -35,7 +35,7 @@ func newscreen() (s screen) {
"[Time](mod:bold): %s\n[OS](mod:bold): %s, [Architecture](mod:bold): %s\n[Is IPv6 available](mod:bold): %v",
time.Now().Local().Format(time.DateTime+" (MST)"),
runtime.GOOS, runtime.GOARCH,
ip.IsIPv6Available.Get(),
ip.IsIPv6Available,
)
s.sysinfo.SetRect(0, s.currh, w/2, s.currh+5)
s.currh += 5