Skip to content

Commit eb2f902

Browse files
committed
feat: drop git-clone downloader and improve github-release binary selection logic
1 parent a82153e commit eb2f902

15 files changed

Lines changed: 155 additions & 932 deletions

File tree

cmd/git-clone.go

Lines changed: 0 additions & 57 deletions
This file was deleted.

cmd/google-drive.go

Lines changed: 0 additions & 57 deletions
This file was deleted.

cmd/highway.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ package cmd
22

33
import (
44
"github.com/tanq16/danzo/internal/highway"
5-
gitclonejob "github.com/tanq16/danzo/internal/jobs/git-clone"
65
ghreleasejob "github.com/tanq16/danzo/internal/jobs/github-release"
7-
gdrivejob "github.com/tanq16/danzo/internal/jobs/google-drive"
86
httpjob "github.com/tanq16/danzo/internal/jobs/http"
97
m3u8job "github.com/tanq16/danzo/internal/jobs/live-stream"
108
s3job "github.com/tanq16/danzo/internal/jobs/s3"
@@ -23,9 +21,7 @@ func newHighway() *highway.Highway {
2321
func registerJobTypes(hw *highway.Highway) {
2422
hw.RegisterType("http", httpjob.Unmarshal)
2523
hw.RegisterType("s3", s3job.Unmarshal)
26-
hw.RegisterType("git-clone", gitclonejob.Unmarshal)
2724
hw.RegisterType("github-release", ghreleasejob.Unmarshal)
28-
hw.RegisterType("google-drive", gdrivejob.Unmarshal)
2925
hw.RegisterType("live-stream", m3u8job.Unmarshal)
3026
hw.RegisterType("ytdlp", ytdlpjob.Unmarshal)
3127
hw.RegisterType("torrent", torrentjob.Unmarshal)

cmd/root.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,7 @@ func init() {
9191
rootCmd.AddCommand(newHTTPCmd())
9292
rootCmd.AddCommand(newM3U8Cmd())
9393
rootCmd.AddCommand(newS3Cmd())
94-
rootCmd.AddCommand(newGitCloneCmd())
9594
rootCmd.AddCommand(newGHReleaseCmd())
96-
rootCmd.AddCommand(newGDriveCmd())
9795
rootCmd.AddCommand(newResumeCmd())
9896
rootCmd.AddCommand(newYtdlpCmd())
9997
rootCmd.AddCommand(newTorrentCmd())

cmd/ytdlp.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import (
1212
)
1313

1414
var ytdlpFlags struct {
15-
outputPath string
15+
outputPath string
16+
cookies string
17+
cookiesFromBrowser string
1618
}
1719

1820
var ytdlpCmd = &cobra.Command{
@@ -28,7 +30,7 @@ var ytdlpCmd = &cobra.Command{
2830

2931
disp := display.New(display.DefaultConfig())
3032

31-
job := ytdlpjob.New(args[0], ytdlpFlags.outputPath, globalHTTPConfig)
33+
job := ytdlpjob.New(args[0], ytdlpFlags.outputPath, ytdlpFlags.cookies, ytdlpFlags.cookiesFromBrowser, globalHTTPConfig)
3234
disp.RegisterJob(job.ID())
3335
hw.Submit(job)
3436

@@ -48,4 +50,6 @@ func newYtdlpCmd() *cobra.Command {
4850

4951
func init() {
5052
ytdlpCmd.Flags().StringVarP(&ytdlpFlags.outputPath, "output", "o", "", "Output path for the download")
53+
ytdlpCmd.Flags().StringVar(&ytdlpFlags.cookies, "cookies", "", "File name to read cookies from")
54+
ytdlpCmd.Flags().StringVar(&ytdlpFlags.cookiesFromBrowser, "cookies-from-browser", "", "Browser name to load cookies from (e.g. chrome, firefox)")
5155
}

internal/jobs/git-clone/auth.go

Lines changed: 0 additions & 40 deletions
This file was deleted.

internal/jobs/git-clone/download.go

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)