mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat: add usenet support (#543)
* feat(autobrr): implement usenet support * feat(sonarr): implement usenet support * feat(radarr): implement usenet support * feat(announce): implement usenet support * announce: cast a line * feat(release): prevent unknown protocol transfer * release: lines for days. * feat: add newznab and sabnzbd support * feat: add category to sabnzbd * feat(newznab): map categories * feat(newznab): map categories --------- Co-authored-by: ze0s <43699394+zze0s@users.noreply.github.com> Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
parent
b2d93d50c5
commit
13a74f7cc8
29 changed files with 1588 additions and 37 deletions
|
@ -154,16 +154,44 @@ type ReleaseProtocol string
|
|||
|
||||
const (
|
||||
ReleaseProtocolTorrent ReleaseProtocol = "torrent"
|
||||
ReleaseProtocolNzb ReleaseProtocol = "nzb"
|
||||
)
|
||||
|
||||
func (r ReleaseProtocol) String() string {
|
||||
switch r {
|
||||
case ReleaseProtocolTorrent:
|
||||
return "torrent"
|
||||
case ReleaseProtocolNzb:
|
||||
return "nzb"
|
||||
default:
|
||||
return "torrent"
|
||||
}
|
||||
}
|
||||
|
||||
type ReleaseImplementation string
|
||||
|
||||
const (
|
||||
ReleaseImplementationIRC ReleaseImplementation = "IRC"
|
||||
ReleaseImplementationTorznab ReleaseImplementation = "TORZNAB"
|
||||
ReleaseImplementationNewznab ReleaseImplementation = "NEWZNAB"
|
||||
ReleaseImplementationRSS ReleaseImplementation = "RSS"
|
||||
)
|
||||
|
||||
func (r ReleaseImplementation) String() string {
|
||||
switch r {
|
||||
case ReleaseImplementationIRC:
|
||||
return "IRC"
|
||||
case ReleaseImplementationTorznab:
|
||||
return "TORZNAB"
|
||||
case ReleaseImplementationNewznab:
|
||||
return "NEWZNAB"
|
||||
case ReleaseImplementationRSS:
|
||||
return "RSS"
|
||||
default:
|
||||
return "IRC"
|
||||
}
|
||||
}
|
||||
|
||||
type ReleaseQueryParams struct {
|
||||
Limit uint64
|
||||
Offset uint64
|
||||
|
@ -291,7 +319,9 @@ func (r *Release) DownloadTorrentFile() error {
|
|||
}
|
||||
|
||||
func (r *Release) downloadTorrentFile(ctx context.Context) error {
|
||||
if r.HasMagnetUri() {
|
||||
if r.Protocol != ReleaseProtocolTorrent {
|
||||
return errors.New("download_file: protocol is not %s: %s", ReleaseProtocolTorrent, r.Protocol)
|
||||
} else if r.HasMagnetUri() {
|
||||
return fmt.Errorf("error trying to download magnet link: %s", r.MagnetURI)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue