-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for musetransfer, quickfile, anonfile and download.gg.
- Loading branch information
Showing
92 changed files
with
1,913 additions
and
1,256 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.227.0/containers/go/.devcontainer/base.Dockerfile | ||
|
||
# [Choice] Go version (use -bullseye variants on local arm64/Apple Silicon): 1, 1.16, 1.17, 1-bullseye, 1.16-bullseye, 1.17-bullseye, 1-buster, 1.16-buster, 1.17-buster | ||
ARG VARIANT="1.18-bullseye" | ||
FROM mcr.microsoft.com/vscode/devcontainers/go:0-${VARIANT} | ||
|
||
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10 | ||
ARG NODE_VERSION="none" | ||
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi | ||
|
||
# [Optional] Uncomment this section to install additional OS packages. | ||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | ||
# && apt-get -y install --no-install-recommends <your-package-list-here> | ||
|
||
# [Optional] Uncomment the next lines to use go get to install anything else you need | ||
# USER vscode | ||
# RUN go get -x <your-dependency-or-tool> | ||
|
||
# [Optional] Uncomment this line to install global node packages. | ||
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.227.0/containers/go | ||
{ | ||
"name": "Go", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"args": { | ||
// Update the VARIANT arg to pick a version of Go: 1, 1.18, 1.17 | ||
// Append -bullseye or -buster to pin to an OS version. | ||
// Use -bullseye variants on local arm64/Apple Silicon. | ||
"VARIANT": "1-bullseye", | ||
// Options | ||
"NODE_VERSION": "none" | ||
} | ||
}, | ||
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"go.toolsManagement.checkForUpdates": "local", | ||
"go.useLanguageServer": true, | ||
"go.gopath": "/go" | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"golang.Go" | ||
], | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
// "postCreateCommand": "go version", | ||
|
||
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.idea/* | ||
.idea | ||
.DS_Store | ||
.DS_Store | ||
**.js | ||
transfer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,37 @@ | ||
package apis | ||
|
||
import ( | ||
"github.com/Mikubill/transfer/apis/methods" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var ( | ||
Crypto bool | ||
Key string | ||
DebugMode bool | ||
NoBarMode bool | ||
MuteMode bool | ||
transferConfig methods.TransferConfig | ||
DebugMode bool | ||
MuteMode bool | ||
) | ||
|
||
func InitCmd(cmd *cobra.Command) { | ||
cmd.PersistentFlags().BoolVarP(&Crypto, | ||
cmd.PersistentFlags().BoolVarP(&transferConfig.CryptoMode, | ||
"encrypt", "", false, "encrypt stream when upload") | ||
cmd.PersistentFlags().StringVarP(&Key, | ||
cmd.PersistentFlags().StringVarP(&transferConfig.CryptoKey, | ||
"encrypt-key", "", "", "specify the encrypt key") | ||
cmd.PersistentFlags().BoolVarP(&NoBarMode, | ||
cmd.PersistentFlags().BoolVarP(&transferConfig.NoBarMode, | ||
"no-progress", "", false, "disable progress bar to reduce output") | ||
cmd.PersistentFlags().BoolVarP(&MuteMode, | ||
"silent", "", false, "enable silent mode to mute output") | ||
cmd.PersistentFlags().BoolVarP(&DebugMode, | ||
"verbose", "v", false, "enable verbose mode to debug") | ||
cmd.Flags().StringVarP(&downConf.Prefix, | ||
// workround | ||
transferConfig.DebugMode = &DebugMode | ||
|
||
cmd.Flags().StringVarP(&DownloadConfig.Prefix, | ||
"output", "o", ".", "download to another file/folder") | ||
cmd.Flags().BoolVarP(&downConf.ForceMode, | ||
cmd.Flags().BoolVarP(&DownloadConfig.ForceMode, | ||
"force", "f", false, "attempt to download file regardless error") | ||
cmd.Flags().IntVarP(&downConf.Parallel, | ||
cmd.Flags().IntVarP(&DownloadConfig.Parallel, | ||
"parallel", "p", 3, "set download task count") | ||
cmd.Flags().StringVarP(&downConf.Ticket, | ||
cmd.Flags().StringVarP(&DownloadConfig.Ticket, | ||
"ticket", "t", "", "set download ticket") | ||
cmd.HelpFunc() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.