mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(indexers): add T66y (#2044)
* Adds t66y indexer + irc support for templated infohashes and magnet uris. * Removed trackers from t66y magnets. * No need to templatize the torrenthash. * Fixed tests. * Opps, correct tests again. * Moved torrentHash to mapvars. * Removed field and renamed arg. * feat(indexers): add test parseurls magneturi --------- Co-authored-by: ze0s <ze0s@riseup.net>
This commit is contained in:
parent
5da0ebbe1f
commit
6073480bc4
4 changed files with 111 additions and 2 deletions
|
@ -250,6 +250,7 @@ type IndexerIRCParseLine struct {
|
|||
type IndexerIRCParseMatch struct {
|
||||
TorrentURL string `json:"torrenturl"`
|
||||
TorrentName string `json:"torrentname"`
|
||||
MagnetURI string `json:"magneturi"`
|
||||
InfoURL string `json:"infourl"`
|
||||
Encode []string `json:"encode"`
|
||||
}
|
||||
|
@ -331,6 +332,15 @@ func (p *IndexerIRCParseMatch) ParseURLs(baseURL string, vars map[string]string,
|
|||
rls.DownloadURL = downloadURL.String()
|
||||
}
|
||||
|
||||
if p.MagnetURI != "" {
|
||||
magnetURI, err := parseTemplateURL("magnet:", p.MagnetURI, vars, "magneturi")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
rls.MagnetURI = magnetURI.String()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -399,7 +409,7 @@ func (p *IndexerIRCParse) Parse(def *IndexerDefinition, vars map[string]string,
|
|||
return errors.Wrap(err, "could not parse urls for release")
|
||||
}
|
||||
|
||||
// parse torrent var
|
||||
// parse torrent name
|
||||
if err := def.IRC.Parse.Match.ParseTorrentName(mergedVars, rls); err != nil {
|
||||
return errors.Wrap(err, "could not parse release name")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue