From 350228889a6eeeb532294a82280a2fb2119329fa Mon Sep 17 00:00:00 2001 From: ze0s <43699394+zze0s@users.noreply.github.com> Date: Tue, 10 Dec 2024 01:35:24 +0100 Subject: [PATCH] feat(clients): add qbit v5 support (#2) * chore: rename module * feat(clients): migrate qbit to autobrr/go-qbittorrent pkg * feat(clients): get file contents * feat(clients): go mod tidy * build: update goreleaser build flags * build: update build flags --- .goreleaser.yml | 6 +- Makefile | 2 +- README.md | 2 +- client/client.go | 2 +- client/deluge.go | 10 +-- client/interface.go | 2 +- client/qbittorrent.go | 100 ++++++++++++++---------- client/tagInterface.go | 2 +- cmd/clean.go | 18 ++--- cmd/helpers.go | 10 +-- cmd/orphan.go | 14 ++-- cmd/relabel.go | 20 ++--- cmd/retag.go | 16 ++-- cmd/root.go | 10 +-- cmd/update.go | 8 +- config/config.go | 7 +- config/torrent.go | 4 +- expression/check.go | 4 +- expression/compile.go | 4 +- go.mod | 23 +++--- go.sum | 38 ++++----- hardlinkfilemap/hardlinkfilemap.go | 5 +- hardlinkfilemap/interface.go | 2 +- hardlinkfilemap/noophardllinkfilemap.go | 2 +- httputils/retryclient.go | 4 +- main.go | 2 +- pathutils/find.go | 2 +- torrentfilemap/struct.go | 2 +- torrentfilemap/torrentfilemap.go | 2 +- tracker/bhd.go | 6 +- tracker/ptp.go | 6 +- 31 files changed, 178 insertions(+), 157 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 82e376d..a80babd 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -15,9 +15,9 @@ builds: - arm64 ldflags: - -s -w - - -X "github.com/l3uddz/tqm/runtime.Version={{ .Version }}" - - -X "github.com/l3uddz/tqm/runtime.GitCommit={{ .ShortCommit }}" - - -X "github.com/l3uddz/tqm/runtime.Timestamp={{ .Timestamp }}" + - -X "github.com/autobrr/tqm/runtime.Version={{ .Version }}" + - -X "github.com/autobrr/tqm/runtime.GitCommit={{ .ShortCommit }}" + - -X "github.com/autobrr/tqm/runtime.Timestamp={{ .Timestamp }}" flags: - -trimpath diff --git a/Makefile b/Makefile index f506f90..55c7197 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ ${BUILD_PATH}/${CMD}: ${GO_FILES} go.sum CGO_ENABLED=0 go build \ -mod vendor \ -trimpath \ - -ldflags "-s -w -X github.com/l3uddz/tqm/runtime.Version=${VERSION} -X github.com/l3uddz/tqm/runtime.GitCommit=${GIT_COMMIT} -X github.com/l3uddz/tqm/runtime.Timestamp=${TIMESTAMP}" \ + -ldflags "-s -w -X github.com/autobrr/tqm/runtime.Version=${VERSION} -X github.com/autobrr/tqm/runtime.GitCommit=${GIT_COMMIT} -X github.com/autobrr/tqm/runtime.Timestamp=${TIMESTAMP}" \ -o ${BUILD_PATH}/${CMD} \ . diff --git a/README.md b/README.md index 4776ea9..9cc170b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![made-with-golang](https://img.shields.io/badge/Made%20with-Golang-blue.svg?style=flat-square)](https://golang.org/) -[![License: GPL v3](https://img.shields.io/badge/License-GPL%203-blue.svg?style=flat-square)](https://github.com/l3uddz/tqm/blob/master/LICENSE.md) +[![License: GPL v3](https://img.shields.io/badge/License-GPL%203-blue.svg?style=flat-square)](https://github.com/autobrr/tqm/blob/master/LICENSE.md) [![Discord](https://img.shields.io/discord/381077432285003776.svg?colorB=177DC1&label=Discord&style=flat-square)](https://discord.io/cloudbox) [![Contributing](https://img.shields.io/badge/Contributing-gray.svg?style=flat-square)](CONTRIBUTING.md) [![Donate](https://img.shields.io/badge/Donate-gray.svg?style=flat-square)](#donate) diff --git a/client/client.go b/client/client.go index 874e9c9..0db0b88 100644 --- a/client/client.go +++ b/client/client.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/l3uddz/tqm/expression" + "github.com/autobrr/tqm/expression" ) func NewClient(clientType string, clientName string, exp *expression.Expressions) (Interface, error) { diff --git a/client/deluge.go b/client/deluge.go index db5675d..5995129 100644 --- a/client/deluge.go +++ b/client/deluge.go @@ -5,15 +5,13 @@ import ( "path" "time" - "github.com/dustin/go-humanize" - - "github.com/l3uddz/tqm/expression" + "github.com/autobrr/tqm/config" + "github.com/autobrr/tqm/expression" + "github.com/autobrr/tqm/logger" + "github.com/dustin/go-humanize" delugeclient "github.com/gdm85/go-libdeluge" "github.com/sirupsen/logrus" - - "github.com/l3uddz/tqm/config" - "github.com/l3uddz/tqm/logger" ) /* Struct */ diff --git a/client/interface.go b/client/interface.go index 208baff..6b1265e 100644 --- a/client/interface.go +++ b/client/interface.go @@ -1,7 +1,7 @@ package client import ( - "github.com/l3uddz/tqm/config" + "github.com/autobrr/tqm/config" ) type Interface interface { diff --git a/client/qbittorrent.go b/client/qbittorrent.go index 4b4465e..85af57f 100644 --- a/client/qbittorrent.go +++ b/client/qbittorrent.go @@ -1,6 +1,7 @@ package client import ( + "context" "fmt" "io/ioutil" "os" @@ -8,15 +9,15 @@ import ( "strings" "time" + "github.com/autobrr/tqm/config" + "github.com/autobrr/tqm/expression" + "github.com/autobrr/tqm/logger" + "github.com/autobrr/tqm/sliceutils" + "github.com/autobrr/tqm/stringutils" + + qbit "github.com/autobrr/go-qbittorrent" "github.com/dustin/go-humanize" - qbittorrent "github.com/l3uddz/go-qbt" "github.com/sirupsen/logrus" - - "github.com/l3uddz/tqm/config" - "github.com/l3uddz/tqm/expression" - "github.com/l3uddz/tqm/logger" - "github.com/l3uddz/tqm/sliceutils" - "github.com/l3uddz/tqm/stringutils" ) /* Struct */ @@ -30,7 +31,7 @@ type QBittorrent struct { // internal log *logrus.Entry clientType string - client *qbittorrent.Client + client *qbit.Client // need to be loaded by LoadLabelPathMap labelPathMap map[string]string @@ -65,7 +66,16 @@ func NewQBittorrent(name string, exp *expression.Expressions) (TagInterface, err // init client qbl := logrus.New() qbl.Out = ioutil.Discard - tc.client = qbittorrent.NewClient(strings.TrimSuffix(*tc.Url, "/"), qbl) + //tc.client = qbittorrent.NewClient(strings.TrimSuffix(*tc.Url, "/"), qbl) + tc.client = qbit.NewClient(qbit.Config{ + Host: *tc.Url, + Username: tc.User, + Password: tc.Password, + TLSSkipVerify: true, + BasicUser: tc.User, + BasicPass: tc.Password, + Log: nil, + }) return &tc, nil } @@ -78,12 +88,13 @@ func (c *QBittorrent) Type() string { func (c *QBittorrent) Connect() error { // login - if err := c.client.Login(c.User, c.Password); err != nil { + if err := c.client.Login(); err != nil { return fmt.Errorf("login: %w", err) } // retrieve & validate api version - apiVersion, err := c.client.Application.GetAPIVersion() + //apiVersion, err := c.client.Application.GetAPIVersion() + apiVersion, err := c.client.GetWebAPIVersion() if err != nil { return fmt.Errorf("get api version: %w", err) } else if stringutils.Atof64(apiVersion[0:3], 0.0) < 2.2 { @@ -95,12 +106,12 @@ func (c *QBittorrent) Connect() error { } func (c *QBittorrent) LoadLabelPathMap() error { - p, err := c.client.Application.GetAppPreferences() + p, err := c.client.GetAppPreferences() if err != nil { return fmt.Errorf("get app preferences: %w", err) } - cats, err := c.client.Torrent.GetCategories() + cats, err := c.client.GetCategories() if err != nil { return fmt.Errorf("get categories: %w", err) } @@ -130,7 +141,7 @@ func (c *QBittorrent) LabelPathMap() map[string]string { func (c *QBittorrent) GetTorrents() (map[string]config.Torrent, error) { // retrieve torrents from client c.log.Tracef("Retrieving torrents...") - t, err := c.client.Torrent.GetList(nil) + t, err := c.client.GetTorrents(qbit.TorrentFilterOptions{}) if err != nil { return nil, fmt.Errorf("get torrents: %w", err) } @@ -142,17 +153,18 @@ func (c *QBittorrent) GetTorrents() (map[string]config.Torrent, error) { t := t // get additional torrent details - td, err := c.client.Torrent.GetProperties(t.Hash) + //td, err := c.client.Torrent.GetProperties(t.Hash) + td, err := c.client.GetTorrentProperties(t.Hash) if err != nil { return nil, fmt.Errorf("get torrent properties: %v: %w", t.Hash, err) } - ts, err := c.client.Torrent.GetTrackers(t.Hash) + ts, err := c.client.GetTorrentTrackers(t.Hash) if err != nil { return nil, fmt.Errorf("get torrent trackers: %v: %w", t.Hash, err) } - tf, err := c.client.Torrent.GetContents(t.Hash) + tf, err := c.client.GetFilesInformation(t.Hash) if err != nil { return nil, fmt.Errorf("get torrent files: %v: %w", t.Hash, err) } @@ -163,23 +175,25 @@ func (c *QBittorrent) GetTorrents() (map[string]config.Torrent, error) { for _, tracker := range ts { // skip disabled trackers - if strings.Contains(tracker.URL, "[DHT]") || strings.Contains(tracker.URL, "[LSD]") || - strings.Contains(tracker.URL, "[PeX]") { + if strings.Contains(tracker.Url, "[DHT]") || strings.Contains(tracker.Url, "[LSD]") || + strings.Contains(tracker.Url, "[PeX]") { continue } // use status of first enabled tracker - trackerName = parseTrackerDomain(tracker.URL) + trackerName = parseTrackerDomain(tracker.Url) trackerStatus = tracker.Message break } // added time - addedTimeSecs := int64(time.Since(td.AdditionDate).Seconds()) + addedTimeSecs := int64(time.Since(time.Unix(int64(td.AdditionDate), 0)).Seconds()) + + seedingTime := time.Duration(td.SeedingTime) * time.Second // torrent files var files []string - for _, f := range tf { + for _, f := range *tf { files = append(files, filepath.Join(td.SavePath, f.Name)) } @@ -194,8 +208,8 @@ func (c *QBittorrent) GetTorrents() (map[string]config.Torrent, error) { Hash: t.Hash, Name: t.Name, Path: td.SavePath, - TotalBytes: int64(t.Size), - DownloadedBytes: int64(td.TotalDownloaded), + TotalBytes: t.Size, + DownloadedBytes: td.TotalDownloaded, State: string(t.State), Files: files, Tags: tags, @@ -214,9 +228,9 @@ func (c *QBittorrent) GetTorrents() (map[string]config.Torrent, error) { AddedSeconds: addedTimeSecs, AddedHours: float32(addedTimeSecs) / 60 / 60, AddedDays: float32(addedTimeSecs) / 60 / 60 / 24, - SeedingSeconds: int64(td.SeedingTime.Seconds()), - SeedingHours: float32(td.SeedingTime.Seconds()) / 60 / 60, - SeedingDays: float32(td.SeedingTime.Seconds()) / 60 / 60 / 24, + SeedingSeconds: int64(seedingTime.Seconds()), + SeedingHours: float32(seedingTime.Seconds()) / 60 / 60, + SeedingDays: float32(seedingTime.Seconds()) / 60 / 60 / 24, Label: t.Category, Seeds: int64(td.SeedsTotal), Peers: int64(td.PeersTotal), @@ -236,21 +250,21 @@ func (c *QBittorrent) GetTorrents() (map[string]config.Torrent, error) { func (c *QBittorrent) RemoveTorrent(hash string, deleteData bool) (bool, error) { // pause torrent - if err := c.client.Torrent.StopTorrents([]string{hash}); err != nil { + if err := c.client.Pause([]string{hash}); err != nil { return false, fmt.Errorf("pause torrent: %v: %w", hash, err) } time.Sleep(1 * time.Second) // resume torrent - if err := c.client.Torrent.ResumeTorrents([]string{hash}); err != nil { + if err := c.client.Resume([]string{hash}); err != nil { return false, fmt.Errorf("resume torrent: %v: %w", hash, err) } // sleep before re-announcing torrent time.Sleep(2 * time.Second) - if err := c.client.Torrent.ReannounceTorrents([]string{hash}); err != nil { + if err := c.client.ReAnnounceTorrents([]string{hash}); err != nil { return false, fmt.Errorf("re-announce torrent: %v: %w", hash, err) } @@ -258,7 +272,7 @@ func (c *QBittorrent) RemoveTorrent(hash string, deleteData bool) (bool, error) time.Sleep(2 * time.Second) // remove - if err := c.client.Torrent.DeleteTorrents([]string{hash}, deleteData); err != nil { + if err := c.client.DeleteTorrents([]string{hash}, deleteData); err != nil { return false, fmt.Errorf("delete torrent: %v: %w", hash, err) } @@ -274,19 +288,19 @@ func (c *QBittorrent) SetTorrentLabel(hash string, label string, hardlink bool) } // get torrent details - td, err := c.client.Torrent.GetProperties(hash) + td, err := c.client.GetTorrentProperties(hash) if err != nil { return fmt.Errorf("get torrent properties: %w", err) } if filepath.Clean(td.SavePath) != filepath.Clean(lp) { // get torrent files - tf, err := c.client.Torrent.GetContents(hash) + tf, err := c.client.GetFilesInformation(hash) if err != nil { return fmt.Errorf("get torrent files: %w", err) } - for _, f := range tf { + for _, f := range *tf { source := filepath.Join(td.SavePath, f.Name) target := filepath.Join(lp, f.Name) if _, err := os.Stat(source); err != nil { @@ -309,22 +323,22 @@ func (c *QBittorrent) SetTorrentLabel(hash string, label string, hardlink bool) // qbit force moves the files, overwriting existing files // manually settings location, and then setting category works // and causes qbit to recheck instead of move - if err := c.client.Torrent.SetAutomaticManagement([]string{hash}, false); err != nil { + if err := c.client.SetAutoManagement([]string{hash}, false); err != nil { return fmt.Errorf("set automatic management: %w", err) } - if err := c.client.Torrent.SetLocations([]string{hash}, lp); err != nil { + if err := c.client.SetLocation([]string{hash}, lp); err != nil { return fmt.Errorf("set location: %w", err) } } // set label - if err := c.client.Torrent.SetCategories([]string{hash}, label); err != nil { + if err := c.client.SetCategory([]string{hash}, label); err != nil { return fmt.Errorf("set torrent label: %v: %w", label, err) } // enable autotmm if c.EnableAutoTmmAfterRelabel && !hardlink { - if err := c.client.Torrent.SetAutomaticManagement([]string{hash}, true); err != nil { + if err := c.client.SetAutoManagement([]string{hash}, true); err != nil { return fmt.Errorf("enable autotmm: %w", err) } } @@ -334,7 +348,7 @@ func (c *QBittorrent) SetTorrentLabel(hash string, label string, hardlink bool) func (c *QBittorrent) GetCurrentFreeSpace(path string) (int64, error) { // get current main stats - data, err := c.client.Sync.GetMainData(0) + data, err := c.client.SyncMainDataCtx(context.Background(), 0) if err != nil { return 0, fmt.Errorf("get main data: %w", err) } @@ -422,7 +436,7 @@ func (c *QBittorrent) AddTags(hash string, tags []string) error { return nil } - if err := c.client.Torrent.AddTags([]string{hash}, tags); err != nil { + if err := c.client.AddTags([]string{hash}, strings.Join(tags, ",")); err != nil { return fmt.Errorf("add torrent tags: %v: %w", tags, err) } @@ -434,7 +448,7 @@ func (c *QBittorrent) RemoveTags(hash string, tags []string) error { return nil } - if err := c.client.Torrent.RemoveTags([]string{hash}, tags); err != nil { + if err := c.client.RemoveTags([]string{hash}, strings.Join(tags, ",")); err != nil { return fmt.Errorf("add torrent tags: %v: %w", tags, err) } @@ -446,7 +460,7 @@ func (c *QBittorrent) CreateTags(tags []string) error { return nil } - if err := c.client.Torrent.CreateTags(tags); err != nil { + if err := c.client.CreateTags(tags); err != nil { return fmt.Errorf("create torrent tags: %v: %w", tags, err) } @@ -458,7 +472,7 @@ func (c *QBittorrent) DeleteTags(tags []string) error { return nil } - if err := c.client.Torrent.DeleteTags(tags); err != nil { + if err := c.client.DeleteTags(tags); err != nil { return fmt.Errorf("delete torrent tags: %v: %w", tags, err) } diff --git a/client/tagInterface.go b/client/tagInterface.go index a7dcce2..bca2631 100644 --- a/client/tagInterface.go +++ b/client/tagInterface.go @@ -1,7 +1,7 @@ package client import ( - "github.com/l3uddz/tqm/config" + "github.com/autobrr/tqm/config" ) type RetagInfo struct { diff --git a/cmd/clean.go b/cmd/clean.go index 6d91e86..a99fd0b 100644 --- a/cmd/clean.go +++ b/cmd/clean.go @@ -4,17 +4,17 @@ import ( "encoding/json" "time" + "github.com/autobrr/tqm/client" + "github.com/autobrr/tqm/config" + "github.com/autobrr/tqm/expression" + "github.com/autobrr/tqm/hardlinkfilemap" + "github.com/autobrr/tqm/logger" + "github.com/autobrr/tqm/sliceutils" + "github.com/autobrr/tqm/torrentfilemap" + "github.com/autobrr/tqm/tracker" + "github.com/dustin/go-humanize" "github.com/spf13/cobra" - - "github.com/l3uddz/tqm/client" - "github.com/l3uddz/tqm/config" - "github.com/l3uddz/tqm/expression" - "github.com/l3uddz/tqm/hardlinkfilemap" - "github.com/l3uddz/tqm/logger" - "github.com/l3uddz/tqm/sliceutils" - "github.com/l3uddz/tqm/torrentfilemap" - "github.com/l3uddz/tqm/tracker" ) var cleanCmd = &cobra.Command{ diff --git a/cmd/helpers.go b/cmd/helpers.go index f289d49..af1518d 100644 --- a/cmd/helpers.go +++ b/cmd/helpers.go @@ -4,13 +4,13 @@ import ( "strings" "time" + "github.com/autobrr/tqm/client" + "github.com/autobrr/tqm/config" + "github.com/autobrr/tqm/hardlinkfilemap" + "github.com/autobrr/tqm/torrentfilemap" + "github.com/dustin/go-humanize" "github.com/sirupsen/logrus" - - "github.com/l3uddz/tqm/client" - "github.com/l3uddz/tqm/config" - "github.com/l3uddz/tqm/hardlinkfilemap" - "github.com/l3uddz/tqm/torrentfilemap" ) func removeSlice(slice []string, remove []string) []string { diff --git a/cmd/orphan.go b/cmd/orphan.go index 2d29c52..0b6cbbf 100644 --- a/cmd/orphan.go +++ b/cmd/orphan.go @@ -5,15 +5,15 @@ import ( "os" "strings" + "github.com/autobrr/tqm/client" + "github.com/autobrr/tqm/config" + "github.com/autobrr/tqm/logger" + paths "github.com/autobrr/tqm/pathutils" + "github.com/autobrr/tqm/torrentfilemap" + "github.com/autobrr/tqm/tracker" + "github.com/dustin/go-humanize" "github.com/spf13/cobra" - - "github.com/l3uddz/tqm/client" - "github.com/l3uddz/tqm/config" - "github.com/l3uddz/tqm/logger" - paths "github.com/l3uddz/tqm/pathutils" - "github.com/l3uddz/tqm/torrentfilemap" - "github.com/l3uddz/tqm/tracker" ) var orphanCmd = &cobra.Command{ diff --git a/cmd/relabel.go b/cmd/relabel.go index 091d2d7..a426eb6 100644 --- a/cmd/relabel.go +++ b/cmd/relabel.go @@ -4,17 +4,17 @@ import ( "encoding/json" "time" + "github.com/autobrr/tqm/client" + "github.com/autobrr/tqm/config" + "github.com/autobrr/tqm/expression" + "github.com/autobrr/tqm/hardlinkfilemap" + "github.com/autobrr/tqm/logger" + "github.com/autobrr/tqm/sliceutils" + "github.com/autobrr/tqm/torrentfilemap" + "github.com/autobrr/tqm/tracker" + "github.com/dustin/go-humanize" "github.com/spf13/cobra" - - "github.com/l3uddz/tqm/client" - "github.com/l3uddz/tqm/config" - "github.com/l3uddz/tqm/expression" - "github.com/l3uddz/tqm/hardlinkfilemap" - "github.com/l3uddz/tqm/logger" - "github.com/l3uddz/tqm/sliceutils" - "github.com/l3uddz/tqm/torrentfilemap" - "github.com/l3uddz/tqm/tracker" ) var relabelCmd = &cobra.Command{ @@ -142,7 +142,7 @@ var relabelCmd = &cobra.Command{ // add HardlinkedOutsideClient field to torrents for h, t := range torrents { t.HardlinkedOutsideClient = hfm.HardlinkedOutsideClient(t) - torrents[h] = t + torrents[h] = t } } else { log.Warnf("Not mapping hardlinks for client %q", clientName) diff --git a/cmd/retag.go b/cmd/retag.go index 233a710..d6aefb4 100644 --- a/cmd/retag.go +++ b/cmd/retag.go @@ -4,16 +4,16 @@ import ( "encoding/json" "time" + "github.com/autobrr/tqm/client" + "github.com/autobrr/tqm/config" + "github.com/autobrr/tqm/expression" + "github.com/autobrr/tqm/hardlinkfilemap" + "github.com/autobrr/tqm/logger" + "github.com/autobrr/tqm/sliceutils" + "github.com/autobrr/tqm/tracker" + "github.com/dustin/go-humanize" "github.com/spf13/cobra" - - "github.com/l3uddz/tqm/client" - "github.com/l3uddz/tqm/config" - "github.com/l3uddz/tqm/expression" - "github.com/l3uddz/tqm/hardlinkfilemap" - "github.com/l3uddz/tqm/logger" - "github.com/l3uddz/tqm/sliceutils" - "github.com/l3uddz/tqm/tracker" ) var retagCmd = &cobra.Command{ diff --git a/cmd/root.go b/cmd/root.go index fa2373a..5ddded6 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -5,12 +5,12 @@ import ( "os" "path/filepath" - "github.com/l3uddz/tqm/runtime" - "github.com/l3uddz/tqm/stringutils" - "github.com/l3uddz/tqm/tracker" + "github.com/autobrr/tqm/config" + "github.com/autobrr/tqm/logger" + "github.com/autobrr/tqm/runtime" + "github.com/autobrr/tqm/stringutils" + "github.com/autobrr/tqm/tracker" - "github.com/l3uddz/tqm/config" - "github.com/l3uddz/tqm/logger" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/cobra" diff --git a/cmd/update.go b/cmd/update.go index 5de6dad..01f4257 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -2,11 +2,13 @@ package cmd import ( "bufio" + "os" + + "github.com/autobrr/tqm/runtime" + "github.com/blang/semver" - "github.com/l3uddz/tqm/runtime" "github.com/rhysd/go-github-selfupdate/selfupdate" "github.com/spf13/cobra" - "os" ) var updateCmd = &cobra.Command{ @@ -26,7 +28,7 @@ var updateCmd = &cobra.Command{ // detect latest version log.Info("Checking for the latest version...") - latest, found, err := selfupdate.DetectLatest("l3uddz/tqm") + latest, found, err := selfupdate.DetectLatest("autobrr/tqm") if err != nil { log.WithError(err).Fatal("Failed determining latest available version") } diff --git a/config/config.go b/config/config.go index dee4fbe..a6d8e1a 100644 --- a/config/config.go +++ b/config/config.go @@ -3,12 +3,13 @@ package config import ( "fmt" + "github.com/autobrr/tqm/logger" + "github.com/autobrr/tqm/stringutils" + "github.com/autobrr/tqm/tracker" + "github.com/knadh/koanf" "github.com/knadh/koanf/parsers/yaml" "github.com/knadh/koanf/providers/file" - "github.com/l3uddz/tqm/logger" - "github.com/l3uddz/tqm/stringutils" - "github.com/l3uddz/tqm/tracker" ) type Configuration struct { diff --git a/config/torrent.go b/config/torrent.go index 2946a52..7257c16 100644 --- a/config/torrent.go +++ b/config/torrent.go @@ -4,8 +4,8 @@ import ( "math" "strings" - "github.com/l3uddz/tqm/sliceutils" - "github.com/l3uddz/tqm/tracker" + "github.com/autobrr/tqm/sliceutils" + "github.com/autobrr/tqm/tracker" ) var ( diff --git a/expression/check.go b/expression/check.go index 2e1825a..38bbdf8 100644 --- a/expression/check.go +++ b/expression/check.go @@ -3,10 +3,10 @@ package expression import ( "fmt" + "github.com/autobrr/tqm/config" + "github.com/antonmedv/expr" "github.com/antonmedv/expr/vm" - - "github.com/l3uddz/tqm/config" ) func CheckTorrentSingleMatch(t *config.Torrent, exp []*vm.Program) (bool, error) { diff --git a/expression/compile.go b/expression/compile.go index b0f9ef3..cc79280 100644 --- a/expression/compile.go +++ b/expression/compile.go @@ -3,9 +3,9 @@ package expression import ( "fmt" - "github.com/antonmedv/expr" + "github.com/autobrr/tqm/config" - "github.com/l3uddz/tqm/config" + "github.com/antonmedv/expr" ) func Compile(filter *config.FilterConfiguration) (*Expressions, error) { diff --git a/go.mod b/go.mod index a034d8a..4dd774b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ -module github.com/l3uddz/tqm +module github.com/autobrr/tqm -go 1.19 +go 1.23 require ( github.com/antonmedv/expr v1.9.0 @@ -9,7 +9,6 @@ require ( github.com/dustin/go-humanize v1.0.0 github.com/gdm85/go-libdeluge v0.5.6 github.com/knadh/koanf v1.4.2 - github.com/l3uddz/go-qbt v1.0.1 github.com/mattn/go-colorable v0.1.12 // indirect github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect @@ -22,20 +21,26 @@ require ( github.com/spf13/cobra v1.5.0 github.com/ulikunitz/xz v0.5.10 // indirect github.com/x-cray/logrus-prefixed-formatter v0.5.2 - golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect - golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b // indirect + golang.org/x/crypto v0.30.0 // indirect + golang.org/x/net v0.32.0 // indirect golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c // indirect - golang.org/x/sys v0.0.0-20220731174439-a90be440212d // indirect - golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 // indirect + golang.org/x/sys v0.28.0 // indirect + golang.org/x/term v0.27.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect ) require ( + github.com/autobrr/go-qbittorrent v1.11.0 github.com/hashicorp/go-retryablehttp v0.7.1 github.com/lucperkins/rek v0.1.3 go.uber.org/ratelimit v0.2.0 ) +require ( + github.com/Masterminds/semver v1.5.0 // indirect + github.com/avast/retry-go v3.0.0+incompatible // indirect +) + require ( github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect github.com/fsnotify/fsnotify v1.5.4 // indirect @@ -52,10 +57,8 @@ require ( github.com/scylladb/go-set v1.0.2 github.com/spf13/pflag v1.0.5 // indirect github.com/tcnksm/go-gitconfig v0.1.2 // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/text v0.21.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -replace github.com/l3uddz/go-qbt v1.0.1 => github.com/SweetMNM/go-qbt v1.0.2-0.20220928185535-3f64c8c30e9a diff --git a/go.sum b/go.sum index 2cc1ff0..2c256e9 100644 --- a/go.sum +++ b/go.sum @@ -3,14 +3,18 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= -github.com/SweetMNM/go-qbt v1.0.2-0.20220928185535-3f64c8c30e9a h1:sfH+z9GrSf4Mjc80vzucQC/zTX56mvMHKlaLViqbvQc= -github.com/SweetMNM/go-qbt v1.0.2-0.20220928185535-3f64c8c30e9a/go.mod h1:mykjBxqNo3lUI09JHTbMW1FZHZw/BWyfaqrbAj63hwg= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 h1:MzBOUgng9orim59UnfUTLRjMpd09C5uEVQ6RPGeCaVI= github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129/go.mod h1:rFgpPQZYZ8vdbc+48xibu8ALc3yeyd64IhHS+PU6Yyg= github.com/antonmedv/expr v1.9.0 h1:j4HI3NHEdgDnN9p6oI6Ndr0G5QryMY0FNxT4ONrFDGU= github.com/antonmedv/expr v1.9.0/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmHhwGEk8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/autobrr/go-qbittorrent v1.11.0 h1:Xmt28ECvZYDiamabEUtDZvJxiO/NaoGjJF4mHESDXq4= +github.com/autobrr/go-qbittorrent v1.11.0/go.mod h1:sIwIdqDcFbN67tSC5p5Lp27M8/BQFoSoW5XqXyVdHF0= +github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0= +github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY= github.com/aws/aws-sdk-go-v2 v1.9.2/go.mod h1:cK/D0BBs0b/oWPIcX/Z/obahJK1TT7IPVjy53i/mX/4= github.com/aws/aws-sdk-go-v2/config v1.8.3/go.mod h1:4AEiLtAb8kLs7vgw2ZV3p2VZ1+hBavOc84hqxVNpCyw= github.com/aws/aws-sdk-go-v2/credentials v1.4.3/go.mod h1:FNNC6nQZQUuyhq5aE5c7ata8o9e4ECGmS4lAXC7o1mQ= @@ -35,6 +39,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/set v0.2.1 h1:nn2CaJyknWE/6txyUDGwysr3G5QC6xWB/PtVjPBbeaA= github.com/fatih/set v0.2.1/go.mod h1:+RKtMCH+favT2+3YecHGxcc0b4KyVWA1QWWJUs4E0CI= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= @@ -64,6 +69,7 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-github/v30 v30.1.0 h1:VLDx+UolQICEOKu2m4uAoMti1SxuEBAl7RSEG16L+Oo= github.com/google/go-github/v30 v30.1.0/go.mod h1:n8jBpHl45a/rlBUtRJMOG4GhNADUQFEufcolZ95JfU8= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= @@ -109,7 +115,6 @@ github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/knadh/koanf v1.4.2 h1:2itp+cdC6miId4pO4Jw7c/3eiYD26Z/Sz3ATJMwHxIs= github.com/knadh/koanf v1.4.2/go.mod h1:4NCo0q4pmU398vF9vq2jStF9MWQZ8JEDcDMHlDCr4h0= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -176,7 +181,6 @@ github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIH github.com/sanity-io/litter v1.2.0/go.mod h1:JF6pZUFgu2Q0sBZ+HSV35P8TVPI1TTzEwyu9FXAw2W4= github.com/scylladb/go-set v1.0.2 h1:SkvlMCKhP0wyyct6j+0IHJkBkSZL+TDzZ4E7f7BCcRE= github.com/scylladb/go-set v1.0.2/go.mod h1:DkpGd78rljTxKAnTDPFqXSGxvETQnJyuSOQwsHycqfs= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU= @@ -184,14 +188,14 @@ github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tcnksm/go-gitconfig v0.1.2 h1:iiDhRitByXAEyjgBqsKi9QU4o2TNtv9kPP3RgPgXBPw= github.com/tcnksm/go-gitconfig v0.1.2/go.mod h1:/8EhP4H7oJZdIPyT+/UIsG87kTzrzM4UsLGSItWYCpE= github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= @@ -205,8 +209,8 @@ go.uber.org/ratelimit v0.2.0 h1:UQE2Bgi7p2B85uP5dC2bbRtig0C+OeNRnNEafLjsLPA= go.uber.org/ratelimit v0.2.0/go.mod h1:YYBV4e4naJvhpitQrWJu1vCpgB7CboMe0qhltKt6mUg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.30.0 h1:RwoQn3GkWiMkzlX562cLB7OxWvjH1L8xutO2WoJcRoY= +golang.org/x/crypto v0.30.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -221,9 +225,8 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b h1:3ogNYyK4oIQdIKzTu68hQrr4iuVxF3AxKl9Aj/eDrw0= -golang.org/x/net v0.0.0-20220802222814-0bcc04d9c69b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= +golang.org/x/net v0.32.0 h1:ZqPmj8Kzc+Y6e0+skZsuACbx+wzMgo5MQsJh9Qd6aYI= +golang.org/x/net v0.32.0/go.mod h1:CwU0IoeOlnQQWJ6ioyFrfRuomB8GKF6KbYXZVyeXNfs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -240,7 +243,6 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -251,17 +253,17 @@ golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220731174439-a90be440212d h1:Sv5ogFZatcgIMMtBSTTAgMYsicp25MXBubjXNDKwm80= -golang.org/x/sys v0.0.0-20220731174439-a90be440212d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20220722155259-a9ba230a4035 h1:Q5284mrmYTpACcm+eAKjKJH48BBwSyfJqmmGDTtT8Vc= -golang.org/x/term v0.0.0-20220722155259-a9ba230a4035/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q= +golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/hardlinkfilemap/hardlinkfilemap.go b/hardlinkfilemap/hardlinkfilemap.go index 0391ab7..f1e063b 100644 --- a/hardlinkfilemap/hardlinkfilemap.go +++ b/hardlinkfilemap/hardlinkfilemap.go @@ -4,8 +4,9 @@ import ( "os" "strings" - "github.com/l3uddz/tqm/config" - "github.com/l3uddz/tqm/logger" + "github.com/autobrr/tqm/config" + "github.com/autobrr/tqm/logger" + "github.com/scylladb/go-set/strset" ) diff --git a/hardlinkfilemap/interface.go b/hardlinkfilemap/interface.go index cd6302d..4b4c448 100644 --- a/hardlinkfilemap/interface.go +++ b/hardlinkfilemap/interface.go @@ -1,6 +1,6 @@ package hardlinkfilemap -import "github.com/l3uddz/tqm/config" +import "github.com/autobrr/tqm/config" type HardlinkFileMapI interface { AddByTorrent(torrent config.Torrent) diff --git a/hardlinkfilemap/noophardllinkfilemap.go b/hardlinkfilemap/noophardllinkfilemap.go index 4a7b8c8..974da67 100644 --- a/hardlinkfilemap/noophardllinkfilemap.go +++ b/hardlinkfilemap/noophardllinkfilemap.go @@ -1,6 +1,6 @@ package hardlinkfilemap -import "github.com/l3uddz/tqm/config" +import "github.com/autobrr/tqm/config" type noopHardlinkFileMap struct { } diff --git a/httputils/retryclient.go b/httputils/retryclient.go index 63e5685..071300a 100644 --- a/httputils/retryclient.go +++ b/httputils/retryclient.go @@ -4,11 +4,11 @@ import ( "net/http" "time" + "github.com/autobrr/tqm/runtime" + "github.com/hashicorp/go-retryablehttp" "github.com/sirupsen/logrus" "go.uber.org/ratelimit" - - "github.com/l3uddz/tqm/runtime" ) func NewRetryableHttpClient(timeout time.Duration, rl ratelimit.Limiter, log *logrus.Entry) *http.Client { diff --git a/main.go b/main.go index f122371..c1cad49 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/l3uddz/tqm/cmd" + "github.com/autobrr/tqm/cmd" ) func main() { diff --git a/pathutils/find.go b/pathutils/find.go index e7c5f35..2214ff4 100644 --- a/pathutils/find.go +++ b/pathutils/find.go @@ -6,7 +6,7 @@ import ( "path/filepath" "time" - "github.com/l3uddz/tqm/logger" + "github.com/autobrr/tqm/logger" ) /* Structs */ diff --git a/torrentfilemap/struct.go b/torrentfilemap/struct.go index c463b01..d6f166a 100644 --- a/torrentfilemap/struct.go +++ b/torrentfilemap/struct.go @@ -1,7 +1,7 @@ package torrentfilemap import ( - "github.com/l3uddz/tqm/config" + "github.com/autobrr/tqm/config" ) type TorrentFileMap struct { diff --git a/torrentfilemap/torrentfilemap.go b/torrentfilemap/torrentfilemap.go index 3e1a135..ae8c947 100644 --- a/torrentfilemap/torrentfilemap.go +++ b/torrentfilemap/torrentfilemap.go @@ -3,7 +3,7 @@ package torrentfilemap import ( "strings" - "github.com/l3uddz/tqm/config" + "github.com/autobrr/tqm/config" ) func New(torrents map[string]config.Torrent) *TorrentFileMap { diff --git a/tracker/bhd.go b/tracker/bhd.go index 147cda0..705676b 100644 --- a/tracker/bhd.go +++ b/tracker/bhd.go @@ -7,12 +7,12 @@ import ( "strings" "time" + "github.com/autobrr/tqm/httputils" + "github.com/autobrr/tqm/logger" + "github.com/lucperkins/rek" "github.com/sirupsen/logrus" "go.uber.org/ratelimit" - - "github.com/l3uddz/tqm/httputils" - "github.com/l3uddz/tqm/logger" ) type BHDConfig struct { diff --git a/tracker/ptp.go b/tracker/ptp.go index 79ea813..3fe24b5 100644 --- a/tracker/ptp.go +++ b/tracker/ptp.go @@ -8,12 +8,12 @@ import ( "strings" "time" + "github.com/autobrr/tqm/httputils" + "github.com/autobrr/tqm/logger" + "github.com/lucperkins/rek" "github.com/sirupsen/logrus" "go.uber.org/ratelimit" - - "github.com/l3uddz/tqm/httputils" - "github.com/l3uddz/tqm/logger" ) type PTPConfig struct {