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:
Alex Belanger 2025-04-27 12:37:31 -04:00 committed by GitHub
parent 5da0ebbe1f
commit 6073480bc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 111 additions and 2 deletions

View file

@ -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")
}