mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(feeds): parse magnet URI from enclosure (#1514)
fix(feeds): parse magnet from enclosure
This commit is contained in:
parent
ce17292573
commit
56aa7dd5cb
2 changed files with 45 additions and 1 deletions
|
@ -9,6 +9,7 @@ import (
|
|||
"net/url"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/autobrr/autobrr/internal/domain"
|
||||
|
@ -133,9 +134,16 @@ func (j *RSSJob) processItem(item *gofeed.Item) *domain.Release {
|
|||
if e.Type == "application/x-bittorrent" && e.URL != "" {
|
||||
rls.DownloadURL = e.URL
|
||||
}
|
||||
if e.Length != "" && e.Length != "39399" {
|
||||
if e.Length != "" && e.Length != "1" && e.Length != "39399" {
|
||||
rls.ParseSizeBytesString(e.Length)
|
||||
}
|
||||
|
||||
if j.Feed.Settings != nil && j.Feed.Settings.DownloadType == domain.FeedDownloadTypeMagnet {
|
||||
if !strings.HasPrefix(rls.MagnetURI, "magnet:?") && strings.HasPrefix(e.URL, "magnet:?") {
|
||||
rls.MagnetURI = e.URL
|
||||
rls.DownloadURL = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if rls.DownloadURL == "" && item.Link != "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue