mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-19 14:53:44 +00:00
feat: auto extract archives (#1212)
This commit is contained in:
1 parent
5515a1c48c
commit
0d5c4e8e7f
35 files changed
+950
-40
No files matched your search
@@ -25,6 +25,7 @@ on:
|
||||
- ".github/workflows/test.yml"
|
||||
- "go.mod"
|
||||
- "go.sum"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
GO_VERSION: "1.24"
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.23.3 AS go
|
||||
FROM golang:1.24.0 AS go
|
||||
WORKDIR /app
|
||||
COPY ./go.mod ./go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
module github.com/GopeedLab/gopeed
|
||||
|
||||
go 1.23.0
|
||||
go 1.24.0
|
||||
|
||||
toolchain go1.23.1
|
||||
toolchain go1.24.11
|
||||
|
||||
require (
|
||||
github.com/anacrolix/missinggo/v2 v2.8.0
|
||||
@@ -16,29 +16,44 @@ require (
|
||||
github.com/imroc/req/v3 v3.52.2
|
||||
github.com/matoous/go-nanoid/v2 v2.0.0
|
||||
github.com/mattn/go-ieproxy v0.0.12
|
||||
github.com/mholt/archives v0.1.5
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/rs/dnscache v0.0.0-20230804202142-fc85eb664529
|
||||
github.com/rs/zerolog v1.31.0
|
||||
github.com/xiaoqidun/setft v0.0.0-20220310121541-be86327699ad
|
||||
go.etcd.io/bbolt v1.3.11
|
||||
golang.org/x/exp v0.0.0-20241108190413-2d47ceb2692f
|
||||
golang.org/x/sync v0.13.0
|
||||
golang.org/x/sync v0.17.0
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/andybalholm/brotli v1.1.1 // indirect
|
||||
github.com/STARRY-S/zip v0.2.3 // indirect
|
||||
github.com/andybalholm/brotli v1.2.0 // indirect
|
||||
github.com/bodgit/plumbing v1.3.0 // indirect
|
||||
github.com/bodgit/sevenzip v1.6.1 // indirect
|
||||
github.com/bodgit/windows v1.0.1 // indirect
|
||||
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect
|
||||
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
|
||||
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
|
||||
github.com/icholy/digest v1.1.0 // indirect
|
||||
github.com/klauspost/compress v1.18.0 // indirect
|
||||
github.com/klauspost/pgzip v1.2.6 // indirect
|
||||
github.com/mikelolasagasti/xz v1.0.1 // indirect
|
||||
github.com/minio/minlz v1.0.1 // indirect
|
||||
github.com/nwaples/rardecode/v2 v2.2.0 // indirect
|
||||
github.com/onsi/ginkgo/v2 v2.23.4 // indirect
|
||||
github.com/pierrec/lz4/v4 v4.1.22 // indirect
|
||||
github.com/quic-go/qpack v0.5.1 // indirect
|
||||
github.com/quic-go/quic-go v0.51.0 // indirect
|
||||
github.com/refraction-networking/utls v1.6.7 // indirect
|
||||
github.com/stretchr/testify v1.10.0 // indirect
|
||||
github.com/sorairolake/lzip-go v0.3.8 // indirect
|
||||
github.com/spf13/afero v1.15.0 // indirect
|
||||
github.com/ulikunitz/xz v0.5.15 // indirect
|
||||
go.uber.org/automaxprocs v1.6.0 // indirect
|
||||
go.uber.org/mock v0.5.1 // indirect
|
||||
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
|
||||
)
|
||||
|
||||
require (
|
||||
@@ -128,13 +143,13 @@ require (
|
||||
go.opentelemetry.io/otel v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/metric v1.32.0 // indirect
|
||||
go.opentelemetry.io/otel/trace v1.32.0 // indirect
|
||||
golang.org/x/crypto v0.37.0 // indirect
|
||||
golang.org/x/mod v0.24.0 // indirect
|
||||
golang.org/x/net v0.39.0 // indirect
|
||||
golang.org/x/sys v0.32.0 // indirect
|
||||
golang.org/x/text v0.24.0
|
||||
golang.org/x/crypto v0.41.0 // indirect
|
||||
golang.org/x/mod v0.27.0 // indirect
|
||||
golang.org/x/net v0.43.0 // indirect
|
||||
golang.org/x/sys v0.35.0 // indirect
|
||||
golang.org/x/text v0.29.0
|
||||
golang.org/x/time v0.8.0 // indirect
|
||||
golang.org/x/tools v0.32.0 // indirect
|
||||
golang.org/x/tools v0.36.0 // indirect
|
||||
gopkg.in/warnings.v0 v0.1.2 // indirect
|
||||
lukechampine.com/blake3 v1.3.0 // indirect
|
||||
modernc.org/libc v1.61.0 // indirect
|
||||
|
||||
+20
-3
@@ -2,13 +2,14 @@ package base
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/GopeedLab/gopeed/pkg/util"
|
||||
"github.com/mattn/go-ieproxy"
|
||||
"golang.org/x/exp/slices"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/GopeedLab/gopeed/pkg/util"
|
||||
"github.com/mattn/go-ieproxy"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
// Request download request
|
||||
@@ -183,6 +184,7 @@ type DownloaderStoreConfig struct {
|
||||
Extra map[string]any `json:"extra"`
|
||||
Proxy *DownloaderProxyConfig `json:"proxy"`
|
||||
Webhook *WebhookConfig `json:"webhook"` // Webhook is the webhook configuration
|
||||
Archive *ArchiveConfig `json:"archive"` // Archive is the archive extraction configuration
|
||||
}
|
||||
|
||||
func (cfg *DownloaderStoreConfig) Init() *DownloaderStoreConfig {
|
||||
@@ -198,6 +200,12 @@ func (cfg *DownloaderStoreConfig) Init() *DownloaderStoreConfig {
|
||||
if cfg.Webhook == nil {
|
||||
cfg.Webhook = &WebhookConfig{}
|
||||
}
|
||||
if cfg.Archive == nil {
|
||||
cfg.Archive = &ArchiveConfig{
|
||||
AutoExtract: false,
|
||||
DeleteAfterExtract: false,
|
||||
}
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
||||
@@ -223,6 +231,9 @@ func (cfg *DownloaderStoreConfig) Merge(beforeCfg *DownloaderStoreConfig) *Downl
|
||||
if cfg.Webhook == nil {
|
||||
cfg.Webhook = beforeCfg.Webhook
|
||||
}
|
||||
if cfg.Archive == nil {
|
||||
cfg.Archive = beforeCfg.Archive
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
||||
@@ -232,6 +243,12 @@ type WebhookConfig struct {
|
||||
URLs []string `json:"urls"` // URLs is the list of webhook URLs
|
||||
}
|
||||
|
||||
// ArchiveConfig is the archive extraction configuration
|
||||
type ArchiveConfig struct {
|
||||
AutoExtract bool `json:"autoExtract"` // AutoExtract enables automatic extraction of archives after download
|
||||
DeleteAfterExtract bool `json:"deleteAfterExtract"` // DeleteAfterExtract deletes the archive after successful extraction
|
||||
}
|
||||
|
||||
type DownloaderProxyConfig struct {
|
||||
Enable bool `json:"enable"`
|
||||
// System is the flag that use system proxy
|
||||
|
||||
@@ -19,6 +19,10 @@ func TestDownloaderStoreConfig_Init(t *testing.T) {
|
||||
ProtocolConfig: map[string]any{},
|
||||
Proxy: &DownloaderProxyConfig{},
|
||||
Webhook: &WebhookConfig{},
|
||||
Archive: &ArchiveConfig{
|
||||
AutoExtract: false,
|
||||
DeleteAfterExtract: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -31,6 +35,10 @@ func TestDownloaderStoreConfig_Init(t *testing.T) {
|
||||
ProtocolConfig: map[string]any{},
|
||||
Proxy: &DownloaderProxyConfig{},
|
||||
Webhook: &WebhookConfig{},
|
||||
Archive: &ArchiveConfig{
|
||||
AutoExtract: false,
|
||||
DeleteAfterExtract: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -47,6 +55,10 @@ func TestDownloaderStoreConfig_Init(t *testing.T) {
|
||||
},
|
||||
Proxy: &DownloaderProxyConfig{},
|
||||
Webhook: &WebhookConfig{},
|
||||
Archive: &ArchiveConfig{
|
||||
AutoExtract: false,
|
||||
DeleteAfterExtract: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -63,6 +75,29 @@ func TestDownloaderStoreConfig_Init(t *testing.T) {
|
||||
Enable: true,
|
||||
},
|
||||
Webhook: &WebhookConfig{},
|
||||
Archive: &ArchiveConfig{
|
||||
AutoExtract: false,
|
||||
DeleteAfterExtract: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"Init Archive",
|
||||
&DownloaderStoreConfig{
|
||||
Archive: &ArchiveConfig{
|
||||
AutoExtract: true,
|
||||
DeleteAfterExtract: false,
|
||||
},
|
||||
},
|
||||
&DownloaderStoreConfig{
|
||||
MaxRunning: 5,
|
||||
ProtocolConfig: map[string]any{},
|
||||
Proxy: &DownloaderProxyConfig{},
|
||||
Webhook: &WebhookConfig{},
|
||||
Archive: &ArchiveConfig{
|
||||
AutoExtract: true,
|
||||
DeleteAfterExtract: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -76,6 +111,7 @@ func TestDownloaderStoreConfig_Init(t *testing.T) {
|
||||
Extra: tt.fields.Extra,
|
||||
Proxy: tt.fields.Proxy,
|
||||
Webhook: tt.fields.Webhook,
|
||||
Archive: tt.fields.Archive,
|
||||
}
|
||||
if got := cfg.Init(); !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("Init() = %v, want %v", got, tt.want)
|
||||
@@ -250,6 +286,45 @@ func TestDownloaderStoreConfig_Merge(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"Merge Archive No Override",
|
||||
&DownloaderStoreConfig{
|
||||
Archive: &ArchiveConfig{
|
||||
AutoExtract: true,
|
||||
},
|
||||
},
|
||||
args{
|
||||
beforeCfg: &DownloaderStoreConfig{
|
||||
Archive: &ArchiveConfig{
|
||||
AutoExtract: false,
|
||||
DeleteAfterExtract: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
&DownloaderStoreConfig{
|
||||
Archive: &ArchiveConfig{
|
||||
AutoExtract: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"Merge Archive Override",
|
||||
&DownloaderStoreConfig{},
|
||||
args{
|
||||
beforeCfg: &DownloaderStoreConfig{
|
||||
Archive: &ArchiveConfig{
|
||||
AutoExtract: false,
|
||||
DeleteAfterExtract: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
&DownloaderStoreConfig{
|
||||
Archive: &ArchiveConfig{
|
||||
AutoExtract: false,
|
||||
DeleteAfterExtract: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
@@ -261,6 +336,7 @@ func TestDownloaderStoreConfig_Merge(t *testing.T) {
|
||||
Extra: tt.fields.Extra,
|
||||
Proxy: tt.fields.Proxy,
|
||||
Webhook: tt.fields.Webhook,
|
||||
Archive: tt.fields.Archive,
|
||||
}
|
||||
if got := cfg.Merge(tt.args.beforeCfg); !reflect.DeepEqual(got, tt.want) {
|
||||
t.Errorf("Merge() = %v, want %v", got, tt.want)
|
||||
|
||||
@@ -877,6 +877,29 @@ func (d *Downloader) watch(task *Task) {
|
||||
|
||||
}()
|
||||
}
|
||||
|
||||
// Auto-extract archive files
|
||||
if e.AutoExtract && isArchiveFile(downloadFilePath) {
|
||||
go func() {
|
||||
// Extract to the same directory as the downloaded file
|
||||
destDir := task.Meta.Opts.Path
|
||||
extractErr := extractArchive(downloadFilePath, destDir, e.ArchivePassword)
|
||||
if extractErr != nil {
|
||||
d.Logger.Error().Err(extractErr).Msgf("auto extract archive failed, task id: %s", task.ID)
|
||||
} else {
|
||||
d.Logger.Info().Msgf("auto extract archive completed, task id: %s", task.ID)
|
||||
// Delete archive after successful extraction if enabled
|
||||
if e.DeleteAfterExtract {
|
||||
deleteErr := os.Remove(downloadFilePath)
|
||||
if deleteErr != nil {
|
||||
d.Logger.Error().Err(deleteErr).Msgf("delete archive after extraction failed, task id: %s", task.ID)
|
||||
} else {
|
||||
d.Logger.Info().Msgf("archive deleted after extraction, task id: %s", task.ID)
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
package download
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/mholt/archives"
|
||||
)
|
||||
|
||||
// supportedArchiveExtensions contains file extensions supported by mholt/archives library
|
||||
var supportedArchiveExtensions = []string{
|
||||
// Archive formats
|
||||
".zip",
|
||||
".tar",
|
||||
".tar.gz", ".tgz",
|
||||
".tar.bz2", ".tbz2",
|
||||
".tar.xz", ".txz",
|
||||
".tar.lz4", ".tlz4",
|
||||
".tar.sz", ".tsz",
|
||||
".tar.zst", ".tzst",
|
||||
".rar",
|
||||
".7z",
|
||||
// Compression formats
|
||||
".gz",
|
||||
".bz2",
|
||||
".xz",
|
||||
".lz4",
|
||||
".sz",
|
||||
".zst",
|
||||
".br",
|
||||
".lz",
|
||||
}
|
||||
|
||||
// isArchiveFile checks if a file is a supported archive format
|
||||
func isArchiveFile(filename string) bool {
|
||||
lowerName := strings.ToLower(filename)
|
||||
return slices.ContainsFunc(supportedArchiveExtensions, func(ext string) bool {
|
||||
return strings.HasSuffix(lowerName, ext)
|
||||
})
|
||||
}
|
||||
|
||||
// extractArchive extracts an archive file to a destination directory
|
||||
func extractArchive(archivePath string, destDir string, password string) error {
|
||||
// Open the archive file
|
||||
file, err := os.Open(archivePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
// Get file info for format identification
|
||||
stat, err := file.Stat()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Identify the archive format
|
||||
format, input, err := archives.Identify(context.Background(), archivePath, file)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Create destination directory if it doesn't exist
|
||||
if err := os.MkdirAll(destDir, 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Handle password-protected archives
|
||||
if password != "" {
|
||||
// Try to set password for formats that support it
|
||||
if rar, ok := format.(archives.Rar); ok {
|
||||
rar.Password = password
|
||||
format = rar
|
||||
}
|
||||
if sz, ok := format.(archives.SevenZip); ok {
|
||||
sz.Password = password
|
||||
format = sz
|
||||
}
|
||||
// Note: Zip format in archives doesn't have a Password field
|
||||
// Password-protected zips are not fully supported
|
||||
}
|
||||
|
||||
// Handle extraction based on format type
|
||||
switch f := format.(type) {
|
||||
case archives.Extractor:
|
||||
// For archive formats (zip, rar, 7z, tar, etc.)
|
||||
return f.Extract(context.Background(), input, func(ctx context.Context, fileInfo archives.FileInfo) error {
|
||||
return extractFile(ctx, fileInfo, destDir)
|
||||
})
|
||||
case archives.Decompressor:
|
||||
// For single-file compression formats (gz, bz2, xz, etc.)
|
||||
// Decompress to a file without the compression extension
|
||||
baseName := filepath.Base(archivePath)
|
||||
lowerBaseName := strings.ToLower(baseName)
|
||||
for _, ext := range supportedArchiveExtensions {
|
||||
if strings.HasSuffix(lowerBaseName, ext) {
|
||||
// Get the actual suffix from the original filename (preserving case)
|
||||
actualSuffix := baseName[len(baseName)-len(ext):]
|
||||
baseName = strings.TrimSuffix(baseName, actualSuffix)
|
||||
break
|
||||
}
|
||||
}
|
||||
destPath := filepath.Join(destDir, baseName)
|
||||
|
||||
reader, err := f.OpenReader(input)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer reader.Close()
|
||||
|
||||
destFile, err := os.Create(destPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer destFile.Close()
|
||||
|
||||
_, err = io.Copy(destFile, reader)
|
||||
return err
|
||||
case archives.Archiver:
|
||||
// This format is an archiver, try to extract using the extractor interface
|
||||
if ext, ok := format.(archives.Extractor); ok {
|
||||
// Reset file position
|
||||
if seeker, ok := input.(io.Seeker); ok {
|
||||
seeker.Seek(0, io.SeekStart)
|
||||
}
|
||||
return ext.Extract(context.Background(), io.NewSectionReader(file, 0, stat.Size()), func(ctx context.Context, fileInfo archives.FileInfo) error {
|
||||
return extractFile(ctx, fileInfo, destDir)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// extractFile handles extracting a single file from an archive
|
||||
func extractFile(ctx context.Context, fileInfo archives.FileInfo, destDir string) error {
|
||||
// Skip directories, they will be created when extracting files
|
||||
if fileInfo.IsDir() {
|
||||
destPath := filepath.Join(destDir, fileInfo.NameInArchive)
|
||||
return os.MkdirAll(destPath, fileInfo.Mode())
|
||||
}
|
||||
|
||||
// Sanitize the path to prevent path traversal attacks
|
||||
cleanPath := filepath.Clean(fileInfo.NameInArchive)
|
||||
if strings.HasPrefix(cleanPath, "..") || filepath.IsAbs(cleanPath) {
|
||||
// Skip files with suspicious paths
|
||||
return nil
|
||||
}
|
||||
|
||||
destPath := filepath.Join(destDir, cleanPath)
|
||||
|
||||
// Create parent directories
|
||||
if err := os.MkdirAll(filepath.Dir(destPath), 0755); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Open the file from the archive
|
||||
reader, err := fileInfo.Open()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer reader.Close()
|
||||
|
||||
// Create the destination file
|
||||
destFile, err := os.Create(destPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer destFile.Close()
|
||||
|
||||
// Copy the contents
|
||||
_, err = io.Copy(destFile, reader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Set file permissions
|
||||
return os.Chmod(destPath, fileInfo.Mode())
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
package download
|
||||
|
||||
import (
|
||||
"archive/zip"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestIsArchiveFile(t *testing.T) {
|
||||
tests := []struct {
|
||||
filename string
|
||||
expected bool
|
||||
}{
|
||||
// Archive formats
|
||||
{"file.zip", true},
|
||||
{"file.ZIP", true},
|
||||
{"file.tar", true},
|
||||
{"file.tar.gz", true},
|
||||
{"file.tgz", true},
|
||||
{"file.tar.bz2", true},
|
||||
{"file.tbz2", true},
|
||||
{"file.tar.xz", true},
|
||||
{"file.txz", true},
|
||||
{"file.tar.zst", true},
|
||||
{"file.tzst", true},
|
||||
{"file.rar", true},
|
||||
{"file.RAR", true},
|
||||
{"file.7z", true},
|
||||
// Compression formats
|
||||
{"file.gz", true},
|
||||
{"file.bz2", true},
|
||||
{"file.xz", true},
|
||||
{"file.lz4", true},
|
||||
{"file.sz", true},
|
||||
{"file.zst", true},
|
||||
{"file.br", true},
|
||||
{"file.lz", true},
|
||||
// Non-archive files
|
||||
{"file.txt", false},
|
||||
{"file.pdf", false},
|
||||
{"file.exe", false},
|
||||
{"archive", false},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.filename, func(t *testing.T) {
|
||||
result := isArchiveFile(tt.filename)
|
||||
if result != tt.expected {
|
||||
t.Errorf("isArchiveFile(%q) = %v, expected %v", tt.filename, result, tt.expected)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestExtractArchive_Zip(t *testing.T) {
|
||||
// Create a temporary directory
|
||||
tempDir, err := os.MkdirTemp("", "extract_test")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(tempDir)
|
||||
|
||||
// Create a test zip file
|
||||
zipPath := filepath.Join(tempDir, "test.zip")
|
||||
destDir := filepath.Join(tempDir, "extracted")
|
||||
|
||||
if err := createTestZip(zipPath); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Extract the archive
|
||||
err = extractArchive(zipPath, destDir, "")
|
||||
if err != nil {
|
||||
t.Fatalf("extractArchive failed: %v", err)
|
||||
}
|
||||
|
||||
// Verify the extracted files
|
||||
expectedFiles := []string{
|
||||
filepath.Join(destDir, "test.txt"),
|
||||
filepath.Join(destDir, "subdir", "nested.txt"),
|
||||
}
|
||||
|
||||
for _, path := range expectedFiles {
|
||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||
t.Errorf("expected file %q not found after extraction", path)
|
||||
}
|
||||
}
|
||||
|
||||
// Verify content
|
||||
content, err := os.ReadFile(filepath.Join(destDir, "test.txt"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if string(content) != "Hello, World!" {
|
||||
t.Errorf("unexpected content: %q", string(content))
|
||||
}
|
||||
}
|
||||
|
||||
func TestExtractArchive_NonArchive(t *testing.T) {
|
||||
// Create a temporary directory
|
||||
tempDir, err := os.MkdirTemp("", "extract_test")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer os.RemoveAll(tempDir)
|
||||
|
||||
// Create a non-archive file
|
||||
txtPath := filepath.Join(tempDir, "test.txt")
|
||||
if err := os.WriteFile(txtPath, []byte("not an archive"), 0644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
destDir := filepath.Join(tempDir, "extracted")
|
||||
|
||||
// Trying to extract a non-archive should return an error
|
||||
err = extractArchive(txtPath, destDir, "")
|
||||
if err == nil {
|
||||
t.Error("expected error when extracting non-archive file")
|
||||
}
|
||||
}
|
||||
|
||||
// createTestZip creates a test zip file with sample content
|
||||
func createTestZip(path string) error {
|
||||
zipFile, err := os.Create(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer zipFile.Close()
|
||||
|
||||
w := zip.NewWriter(zipFile)
|
||||
|
||||
// Add a file to the root
|
||||
f, err := w.Create("test.txt")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = f.Write([]byte("Hello, World!"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Add a file in a subdirectory
|
||||
f, err = w.Create("subdir/nested.txt")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = f.Write([]byte("Nested content"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return w.Close()
|
||||
}
|
||||
@@ -10,6 +10,12 @@ type OptsExtra struct {
|
||||
Connections int `json:"connections"`
|
||||
// AutoTorrent when task download complete, and it is a .torrent file, it will be auto create a new task for the torrent file
|
||||
AutoTorrent bool `json:"autoTorrent"`
|
||||
// AutoExtract when task download complete, and it is an archive file, it will be auto extracted
|
||||
AutoExtract bool `json:"autoExtract"`
|
||||
// ArchivePassword is the password for extracting password-protected archives
|
||||
ArchivePassword string `json:"archivePassword"`
|
||||
// DeleteAfterExtract when true, deletes the archive file after successful extraction
|
||||
DeleteAfterExtract bool `json:"deleteAfterExtract"`
|
||||
}
|
||||
|
||||
// Stats for download
|
||||
|
||||
@@ -10,6 +10,7 @@ class DownloaderConfig {
|
||||
ExtraConfig extra = ExtraConfig();
|
||||
ProxyConfig proxy = ProxyConfig();
|
||||
WebhookConfig webhook = WebhookConfig();
|
||||
ArchiveConfig archive = ArchiveConfig();
|
||||
|
||||
DownloaderConfig({
|
||||
this.downloadDir = '',
|
||||
@@ -226,3 +227,19 @@ class ExtraConfigGithubMirror {
|
||||
|
||||
Map<String, dynamic> toJson() => _$ExtraConfigGithubMirrorToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ArchiveConfig {
|
||||
bool autoExtract;
|
||||
bool deleteAfterExtract;
|
||||
|
||||
ArchiveConfig({
|
||||
this.autoExtract = true,
|
||||
this.deleteAfterExtract = true,
|
||||
});
|
||||
|
||||
factory ArchiveConfig.fromJson(Map<String, dynamic>? json) =>
|
||||
json == null ? ArchiveConfig() : _$ArchiveConfigFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ArchiveConfigToJson(this);
|
||||
}
|
||||
@@ -16,7 +16,9 @@ DownloaderConfig _$DownloaderConfigFromJson(Map<String, dynamic> json) =>
|
||||
..extra = ExtraConfig.fromJson(json['extra'] as Map<String, dynamic>?)
|
||||
..proxy = ProxyConfig.fromJson(json['proxy'] as Map<String, dynamic>)
|
||||
..webhook =
|
||||
WebhookConfig.fromJson(json['webhook'] as Map<String, dynamic>?);
|
||||
WebhookConfig.fromJson(json['webhook'] as Map<String, dynamic>?)
|
||||
..archive =
|
||||
ArchiveConfig.fromJson(json['archive'] as Map<String, dynamic>?);
|
||||
|
||||
Map<String, dynamic> _$DownloaderConfigToJson(DownloaderConfig instance) =>
|
||||
<String, dynamic>{
|
||||
@@ -26,6 +28,7 @@ Map<String, dynamic> _$DownloaderConfigToJson(DownloaderConfig instance) =>
|
||||
'extra': instance.extra.toJson(),
|
||||
'proxy': instance.proxy.toJson(),
|
||||
'webhook': instance.webhook.toJson(),
|
||||
'archive': instance.archive.toJson(),
|
||||
};
|
||||
|
||||
ProtocolConfig _$ProtocolConfigFromJson(Map<String, dynamic> json) =>
|
||||
@@ -232,3 +235,15 @@ Map<String, dynamic> _$ExtraConfigGithubMirrorToJson(
|
||||
'enabled': instance.enabled,
|
||||
'mirrors': instance.mirrors.map((e) => e.toJson()).toList(),
|
||||
};
|
||||
|
||||
ArchiveConfig _$ArchiveConfigFromJson(Map<String, dynamic> json) =>
|
||||
ArchiveConfig(
|
||||
autoExtract: json['autoExtract'] as bool? ?? true,
|
||||
deleteAfterExtract: json['deleteAfterExtract'] as bool? ?? true,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ArchiveConfigToJson(ArchiveConfig instance) =>
|
||||
<String, dynamic>{
|
||||
'autoExtract': instance.autoExtract,
|
||||
'deleteAfterExtract': instance.deleteAfterExtract,
|
||||
};
|
||||
@@ -26,10 +26,16 @@ class Options {
|
||||
class OptsExtraHttp {
|
||||
int connections;
|
||||
bool autoTorrent;
|
||||
bool autoExtract;
|
||||
String archivePassword;
|
||||
bool deleteAfterExtract;
|
||||
|
||||
OptsExtraHttp({
|
||||
this.connections = 0,
|
||||
this.autoTorrent = false,
|
||||
this.autoExtract = false,
|
||||
this.archivePassword = '',
|
||||
this.deleteAfterExtract = false,
|
||||
});
|
||||
|
||||
factory OptsExtraHttp.fromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -37,10 +37,16 @@ OptsExtraHttp _$OptsExtraHttpFromJson(Map<String, dynamic> json) =>
|
||||
OptsExtraHttp(
|
||||
connections: (json['connections'] as num?)?.toInt() ?? 0,
|
||||
autoTorrent: json['autoTorrent'] as bool? ?? false,
|
||||
autoExtract: json['autoExtract'] as bool? ?? false,
|
||||
archivePassword: json['archivePassword'] as String? ?? '',
|
||||
deleteAfterExtract: json['deleteAfterExtract'] as bool? ?? false,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$OptsExtraHttpToJson(OptsExtraHttp instance) =>
|
||||
<String, dynamic>{
|
||||
'connections': instance.connections,
|
||||
'autoTorrent': instance.autoTorrent,
|
||||
'autoExtract': instance.autoExtract,
|
||||
'archivePassword': instance.archivePassword,
|
||||
'deleteAfterExtract': instance.deleteAfterExtract,
|
||||
};
|
||||
@@ -23,7 +23,7 @@ class CreateController extends GetxController
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
advancedTabController = TabController(length: 2, vsync: this);
|
||||
advancedTabController = TabController(length: 3, vsync: this);
|
||||
directDownload.value = Get.find<AppController>()
|
||||
.downloaderConfig
|
||||
.value
|
||||
|
||||
@@ -56,10 +56,13 @@ class CreateView extends GetView<CreateController> {
|
||||
),
|
||||
];
|
||||
final _btTrackerController = TextEditingController();
|
||||
final _archivePasswordController = TextEditingController();
|
||||
|
||||
final _availableSchemes = ["http:", "https:", "magnet:"];
|
||||
|
||||
final _skipVerifyCertController = false.obs;
|
||||
final _autoExtractController = Rxn<bool>();
|
||||
final _deleteAfterExtractController = Rxn<bool>();
|
||||
|
||||
CreateView({Key? key}) : super(key: key);
|
||||
|
||||
@@ -77,6 +80,15 @@ class CreateView extends GetView<CreateController> {
|
||||
final downloadDir = appController.downloaderConfig.value.downloadDir;
|
||||
_pathController.text = renderPathPlaceholders(downloadDir);
|
||||
}
|
||||
// Initialize archive settings from global config if not already set
|
||||
if (_autoExtractController.value == null) {
|
||||
_autoExtractController.value =
|
||||
appController.downloaderConfig.value.archive.autoExtract;
|
||||
}
|
||||
if (_deleteAfterExtractController.value == null) {
|
||||
_deleteAfterExtractController.value =
|
||||
appController.downloaderConfig.value.archive.deleteAfterExtract;
|
||||
}
|
||||
|
||||
final CreateTask? routerParams = Get.rootDelegate.arguments();
|
||||
if (routerParams?.req?.url.isNotEmpty ?? false) {
|
||||
@@ -497,17 +509,20 @@ class CreateView extends GetView<CreateController> {
|
||||
const Divider(),
|
||||
TabBar(
|
||||
controller: controller.advancedTabController,
|
||||
tabs: const [
|
||||
Tab(
|
||||
tabs: [
|
||||
const Tab(
|
||||
text: 'HTTP',
|
||||
),
|
||||
Tab(
|
||||
const Tab(
|
||||
text: 'BitTorrent',
|
||||
),
|
||||
Tab(
|
||||
text: 'archives'.tr,
|
||||
)
|
||||
],
|
||||
),
|
||||
DefaultTabController(
|
||||
length: 2,
|
||||
length: 3,
|
||||
child: ContentSizeTabBarView(
|
||||
controller:
|
||||
controller.advancedTabController,
|
||||
@@ -602,6 +617,63 @@ class CreateView extends GetView<CreateController> {
|
||||
hintText: 'addTrackerHit'.tr,
|
||||
)),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(top: 10),
|
||||
child: CompactCheckbox(
|
||||
label: 'autoExtract'.tr,
|
||||
value: _autoExtractController
|
||||
.value ?? false,
|
||||
onChanged: (bool? value) {
|
||||
_autoExtractController
|
||||
.value = value ?? false;
|
||||
},
|
||||
textStyle: const TextStyle(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => Visibility(
|
||||
visible: _autoExtractController.value ?? false,
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(top: 10),
|
||||
child: TextFormField(
|
||||
controller: _archivePasswordController,
|
||||
obscureText: true,
|
||||
decoration: InputDecoration(
|
||||
labelText: 'archivePassword'.tr,
|
||||
hintText: 'archivePasswordHint'.tr,
|
||||
),
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(top: 10),
|
||||
child: CompactCheckbox(
|
||||
label: 'deleteAfterExtract'.tr,
|
||||
value: _deleteAfterExtractController
|
||||
.value ?? false,
|
||||
onChanged: (bool? value) {
|
||||
_deleteAfterExtractController
|
||||
.value = value ?? false;
|
||||
},
|
||||
textStyle: const TextStyle(
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
@@ -798,7 +870,10 @@ class CreateView extends GetView<CreateController> {
|
||||
Object? parseReqOptsExtra() {
|
||||
return OptsExtraHttp()
|
||||
..connections = int.tryParse(_connectionsController.text) ?? 0
|
||||
..autoTorrent = true;
|
||||
..autoTorrent = true
|
||||
..autoExtract = _autoExtractController.value ?? false
|
||||
..archivePassword = _archivePasswordController.text
|
||||
..deleteAfterExtract = _deleteAfterExtractController.value ?? false;
|
||||
}
|
||||
|
||||
String _hitText() {
|
||||
|
||||
@@ -148,6 +148,46 @@ class SettingView extends GetView<SettingController> {
|
||||
);
|
||||
});
|
||||
|
||||
// Archive auto extract configuration
|
||||
final buildAutoExtract = _buildConfigItem('autoExtract', () {
|
||||
return appController.downloaderConfig.value.archive.autoExtract
|
||||
? 'on'.tr
|
||||
: 'off'.tr;
|
||||
}, (Key key) {
|
||||
return Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Switch(
|
||||
value: appController.downloaderConfig.value.archive.autoExtract,
|
||||
onChanged: (bool value) async {
|
||||
appController.downloaderConfig.update((val) {
|
||||
val!.archive.autoExtract = value;
|
||||
});
|
||||
await debounceSave();
|
||||
},
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
// Archive delete after extract configuration
|
||||
final buildDeleteAfterExtract = _buildConfigItem('deleteAfterExtract', () {
|
||||
return appController.downloaderConfig.value.archive.deleteAfterExtract
|
||||
? 'on'.tr
|
||||
: 'off'.tr;
|
||||
}, (Key key) {
|
||||
return Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Switch(
|
||||
value: appController.downloaderConfig.value.archive.deleteAfterExtract,
|
||||
onChanged: (bool value) async {
|
||||
appController.downloaderConfig.update((val) {
|
||||
val!.archive.deleteAfterExtract = value;
|
||||
});
|
||||
await debounceSave();
|
||||
},
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
// Download categories configuration
|
||||
buildDownloadCategories() {
|
||||
final categories = downloaderCfg.value.extra.downloadCategories
|
||||
@@ -1315,6 +1355,14 @@ class SettingView extends GetView<SettingController> {
|
||||
buildAutoStartup(),
|
||||
]),
|
||||
)),
|
||||
Text('archives'.tr),
|
||||
Card(
|
||||
child: Column(
|
||||
children: _addDivider([
|
||||
buildAutoExtract(),
|
||||
buildDeleteAfterExtract(),
|
||||
]),
|
||||
)),
|
||||
const Text('HTTP'),
|
||||
Card(
|
||||
child: Column(
|
||||
|
||||
@@ -116,6 +116,11 @@ const deDE = {
|
||||
'taskUrl': 'Aufgaben-URL',
|
||||
'downloadPath': 'Download-Pfad',
|
||||
'skipVerifyCert': 'Zertifikatsüberprüfung überspringen',
|
||||
'archives': 'Archive',
|
||||
'autoExtract': 'Archive automatisch entpacken',
|
||||
'archivePassword': 'Archiv-Passwort',
|
||||
'archivePasswordHint': 'Leer lassen, wenn nicht passwortgeschützt',
|
||||
'deleteAfterExtract': 'Archiv nach Entpacken löschen',
|
||||
'name': 'Name',
|
||||
'size': 'Größe',
|
||||
'unknown': 'Unbekannt',
|
||||
|
||||
@@ -124,6 +124,11 @@ const enUS = {
|
||||
'taskUrl': 'Task URL',
|
||||
'downloadPath': 'Download Path',
|
||||
'skipVerifyCert': 'Skip Certificate Verification',
|
||||
'archives': 'Archives',
|
||||
'autoExtract': 'Auto Extract Archives',
|
||||
'archivePassword': 'Archive Password',
|
||||
'archivePasswordHint': 'Leave empty if not password protected',
|
||||
'deleteAfterExtract': 'Delete Archive After Extraction',
|
||||
'name': 'Name',
|
||||
'size': 'Size',
|
||||
'unknown': 'Unknown',
|
||||
|
||||
@@ -108,6 +108,11 @@ const esES = {
|
||||
'taskUrl': 'URL de la Tarea',
|
||||
'downloadPath': 'Ruta de Descarga',
|
||||
'skipVerifyCert': 'Omitir Verificación de Certificado',
|
||||
'archives': 'Archivos',
|
||||
'autoExtract': 'Extraer archivos automáticamente',
|
||||
'archivePassword': 'Contraseña del archivo',
|
||||
'archivePasswordHint': 'Dejar vacío si no tiene contraseña',
|
||||
'deleteAfterExtract': 'Eliminar archivo después de extraer',
|
||||
'insertPlaceholder': 'Insertar marcador de posición',
|
||||
'placeholderYear': 'Año actual',
|
||||
'placeholderMonth': 'Mes actual (01-12)',
|
||||
|
||||
@@ -63,6 +63,11 @@ const faIR = {
|
||||
'از تمامی افرادی که در ساخت و توسعهی جامعهی Gopeed مشارکت کردهاند، سپاسگزاری میکنیم!',
|
||||
'browserExtension': 'افزونه مرورگر',
|
||||
'skipVerifyCert': 'رد کردن تأیید گواهینامه',
|
||||
'archives': 'آرشیوها',
|
||||
'autoExtract': 'استخراج خودکار بایگانیها',
|
||||
'archivePassword': 'رمز عبور بایگانی',
|
||||
'archivePasswordHint': 'اگر رمز ندارد خالی بگذارید',
|
||||
'deleteAfterExtract': 'حذف آرشیو پس از استخراج',
|
||||
'insertPlaceholder': 'درج نگهدارنده',
|
||||
'placeholderYear': 'سال جاری',
|
||||
'placeholderMonth': 'ماه جاری (01-12)',
|
||||
|
||||
@@ -100,6 +100,11 @@ const frFR = {
|
||||
'browserExtension': 'Extension du navigateur',
|
||||
'launchAtStartup': 'Lancer au démarrage',
|
||||
'skipVerifyCert': 'Ignorer la vérification du certificat',
|
||||
'archives': 'Archives',
|
||||
'autoExtract': 'Extraire automatiquement les archives',
|
||||
'archivePassword': 'Mot de passe de l\'archive',
|
||||
'archivePasswordHint': 'Laisser vide si non protégé par mot de passe',
|
||||
'deleteAfterExtract': "Supprimer l'archive après extraction",
|
||||
'insertPlaceholder': 'Insérer un espace réservé',
|
||||
'placeholderYear': 'Année en cours',
|
||||
'placeholderMonth': 'Mois en cours (01-12)',
|
||||
|
||||
@@ -116,6 +116,11 @@ const huHU = {
|
||||
'taskUrl': 'Feladat URL',
|
||||
'downloadPath': 'Letöltési útvonal',
|
||||
'skipVerifyCert': 'Tanúsítvány ellenőrzés átugrása',
|
||||
'archives': 'Archívumok',
|
||||
'autoExtract': 'Archívumok automatikus kicsomagolása',
|
||||
'archivePassword': 'Archívum jelszó',
|
||||
'archivePasswordHint': 'Hagyja üresen, ha nincs jelszóval védve',
|
||||
'deleteAfterExtract': 'Archívum törlése kicsomagolás után',
|
||||
'name': 'Név',
|
||||
'size': 'Méret',
|
||||
'unknown': 'Ismeretlen',
|
||||
|
||||
@@ -110,6 +110,11 @@ const idID = {
|
||||
'taskUrl': 'URL Tugas',
|
||||
'downloadPath': 'Direktori Unduhan',
|
||||
'skipVerifyCert': 'Lupakan verifikasi sertifikat',
|
||||
'archives': 'Arsip',
|
||||
'autoExtract': 'Ekstrak Arsip Otomatis',
|
||||
'archivePassword': 'Kata Sandi Arsip',
|
||||
'archivePasswordHint': 'Kosongkan jika tidak dilindungi kata sandi',
|
||||
'deleteAfterExtract': 'Hapus arsip setelah ekstraksi',
|
||||
'insertPlaceholder': 'Sisipkan placeholder',
|
||||
'placeholderYear': 'Tahun saat ini',
|
||||
'placeholderMonth': 'Bulan saat ini (01-12)',
|
||||
|
||||
@@ -98,6 +98,11 @@ const itIT = {
|
||||
'browserExtension': 'Estensione del browser',
|
||||
'launchAtStartup': "Lancia all'avvio",
|
||||
'skipVerifyCert': 'Salta la verifica del certificato',
|
||||
'archives': 'Archivi',
|
||||
'autoExtract': 'Estrai automaticamente gli archivi',
|
||||
'archivePassword': 'Password archivio',
|
||||
'archivePasswordHint': 'Lasciare vuoto se non protetto da password',
|
||||
'deleteAfterExtract': "Elimina l'archivio dopo l'estrazione",
|
||||
'insertPlaceholder': 'Inserisci segnaposto',
|
||||
'placeholderYear': 'Anno corrente',
|
||||
'placeholderMonth': 'Mese corrente (01-12)',
|
||||
|
||||
@@ -64,6 +64,11 @@ const jaJP = {
|
||||
'thanksDesc': 'Gopeedコミュニティの建設に協力してくださったすべての貢献者の方々に感謝します!',
|
||||
'browserExtension': 'ブラウザ拡張機能',
|
||||
'skipVerifyCert': '証明書の検証をスキップ',
|
||||
'archives': 'アーカイブ',
|
||||
'autoExtract': 'アーカイブを自動展開',
|
||||
'archivePassword': 'アーカイブパスワード',
|
||||
'archivePasswordHint': 'パスワードなしの場合は空のままにしてください',
|
||||
'deleteAfterExtract': '展開後にアーカイブを削除',
|
||||
'insertPlaceholder': 'プレースホルダーを挿入',
|
||||
'placeholderYear': '現在の年',
|
||||
'placeholderMonth': '現在の月 (01-12)',
|
||||
|
||||
@@ -96,6 +96,11 @@ const plPL = {
|
||||
'browserExtension': 'Wtyczka dla przeglądarki',
|
||||
'launchAtStartup': 'Uruchom na starcie',
|
||||
'skipVerifyCert': 'Pomiń weryfikację certyfikatu',
|
||||
'archives': 'Archiwa',
|
||||
'autoExtract': 'Automatycznie wyodrębnij archiwa',
|
||||
'archivePassword': 'Hasło archiwum',
|
||||
'archivePasswordHint': 'Pozostaw puste, jeśli nie ma hasła',
|
||||
'deleteAfterExtract': 'Usuń archiwum po rozpakowaniu',
|
||||
'insertPlaceholder': 'Wstaw placeholder',
|
||||
'placeholderYear': 'Bieżący rok',
|
||||
'placeholderMonth': 'Bieżący miesiąc (01-12)',
|
||||
|
||||
@@ -113,6 +113,11 @@ const ptBR = {
|
||||
'taskUrl': 'Tarefa URL',
|
||||
'downloadPath': 'Download Path',
|
||||
'skipVerifyCert': 'Pular Verificação de Certificado',
|
||||
'archives': 'Arquivos',
|
||||
'autoExtract': 'Extrair arquivos automaticamente',
|
||||
'archivePassword': 'Senha do arquivo',
|
||||
'archivePasswordHint': 'Deixar vazio se não estiver protegido por senha',
|
||||
'deleteAfterExtract': 'Excluir arquivo após extração',
|
||||
'name': 'Nome',
|
||||
'size': 'Tamanho',
|
||||
'unknown': 'Desconhecido',
|
||||
|
||||
@@ -113,6 +113,11 @@ const ruRU = {
|
||||
'taskUrl': 'URL задачи',
|
||||
'downloadPath': 'Путь загрузки',
|
||||
'skipVerifyCert': 'Пропустить проверку сертификата',
|
||||
'archives': 'Архивы',
|
||||
'autoExtract': 'Автоматически распаковать архивы',
|
||||
'archivePassword': 'Пароль архива',
|
||||
'archivePasswordHint': 'Оставить пустым, если архив не защищён паролем',
|
||||
'deleteAfterExtract': 'Удалить архив после распаковки',
|
||||
'name': 'Название',
|
||||
'size': 'Размер',
|
||||
'unknown': 'Неизвестно',
|
||||
|
||||
@@ -98,6 +98,11 @@ const taTA = {
|
||||
'browserExtension': 'உலாவி நீட்டிப்பு',
|
||||
'launchAtStartup': 'தொடக்கத்தின் போது இயங்கு',
|
||||
'skipVerifyCert': 'திருத்தி சான்று சரிபார்க்கவும்',
|
||||
'archives': 'காப்பகங்கள்',
|
||||
'autoExtract': 'காப்பகங்களை தானாக பிரித்தெடு',
|
||||
'archivePassword': 'காப்பக கடவுச்சொல்',
|
||||
'archivePasswordHint': 'கடவுச்சொல் இல்லையென்றால் காலியாக விடவும்',
|
||||
'deleteAfterExtract': 'பிரித்தெடுத்த பிறகு காப்பகத்தை நீக்கு',
|
||||
'insertPlaceholder': 'இடங்காட்டி செருக',
|
||||
'placeholderYear': 'தற்போதைய ஆண்டு',
|
||||
'placeholderMonth': 'தற்போதைய மாதம் (01-12)',
|
||||
|
||||
@@ -114,6 +114,11 @@ const trTR = {
|
||||
'taskUrl': 'Görev URL’si',
|
||||
'downloadPath': 'İndirme Yolu',
|
||||
'skipVerifyCert': 'Sertifika Doğrulamayı Atla',
|
||||
'archives': 'Arşivler',
|
||||
'autoExtract': 'Arşivleri otomatik çıkart',
|
||||
'archivePassword': 'Arşiv şifresi',
|
||||
'archivePasswordHint': 'Şifre yoksa boş bırakın',
|
||||
'deleteAfterExtract': 'Çıkarmadan sonra arşivi sil',
|
||||
'name': 'Ad',
|
||||
'size': 'Boyut',
|
||||
'unknown': 'Bilinmeyen',
|
||||
|
||||
@@ -113,6 +113,11 @@ const ukUA = {
|
||||
'taskUrl': 'URL завдання',
|
||||
'downloadPath': 'Шлях завантаження',
|
||||
'skipVerifyCert': 'Пропустити перевірку сертифіката',
|
||||
'archives': 'Архіви',
|
||||
'autoExtract': 'Автоматично розпаковувати архіви',
|
||||
'archivePassword': 'Пароль архіву',
|
||||
'archivePasswordHint': 'Залишити порожнім, якщо архів не захищений паролем',
|
||||
'deleteAfterExtract': 'Видалити архів після розпакування',
|
||||
'name': 'Назва',
|
||||
'size': 'Розмір',
|
||||
'unknown': 'Невідомо',
|
||||
|
||||
@@ -91,6 +91,11 @@ const viVN = {
|
||||
'Cảm ơn tất cả những người đóng góp đã giúp xây dựng và phát triển cộng đồng Gopeed!',
|
||||
'browserExtension': 'Tiện ích mở rộng trình duyệt',
|
||||
'skipVerifyCert': 'Bỏ qua xác thực chứng chỉ',
|
||||
'archives': 'Tập tin nén',
|
||||
'autoExtract': 'Tự động giải nén tập tin nén',
|
||||
'archivePassword': 'Mật khẩu tập tin nén',
|
||||
'archivePasswordHint': 'Để trống nếu không có mật khẩu',
|
||||
'deleteAfterExtract': 'Xóa tập tin nén sau khi giải nén',
|
||||
'insertPlaceholder': 'Chèn placeholder',
|
||||
'placeholderYear': 'Năm hiện tại',
|
||||
'placeholderMonth': 'Tháng hiện tại (01-12)',
|
||||
|
||||
@@ -122,6 +122,11 @@ const zhCN = {
|
||||
'taskUrl': '任务链接',
|
||||
'downloadPath': '下载路径',
|
||||
'skipVerifyCert': '跳过证书验证',
|
||||
'archives': '压缩包',
|
||||
'autoExtract': '自动解压压缩包',
|
||||
'archivePassword': '压缩包密码',
|
||||
'archivePasswordHint': '如无密码请留空',
|
||||
'deleteAfterExtract': '解压后删除压缩包',
|
||||
'name': '名称',
|
||||
'size': '大小',
|
||||
'unknown': '未知',
|
||||
|
||||
@@ -110,6 +110,11 @@ const zhTW = {
|
||||
'taskUrl': '任務連結',
|
||||
'downloadPath': '下載路徑',
|
||||
'skipVerifyCert': '跳過憑證驗證',
|
||||
'archives': '壓縮檔',
|
||||
'autoExtract': '自動解壓縮壓縮包',
|
||||
'archivePassword': '壓縮包密碼',
|
||||
'archivePasswordHint': '如無密碼請留空',
|
||||
'deleteAfterExtract': '解壓後刪除壓縮檔',
|
||||
'name': '名稱',
|
||||
'size': '大小',
|
||||
'unknown': '未知',
|
||||
|
||||
Reference in new issue
Block a user