mirror of
https://codeberg.org/hyperreal/go-torrent-helper
synced 2024-11-01 16:53:09 +01:00
Fix goquery code
This commit is contained in:
parent
049e3ec49b
commit
394739d135
@ -18,7 +18,7 @@ type Kali struct {
|
||||
|
||||
func (k Kali) AddNewTorrents(transmissionbt *transmissionrpc.Client) error {
|
||||
// Send HTTP GET request and receive response
|
||||
k.URL = fmt.Sprintf("https://cdimage.kali.org/kali-%s/", k.Relver)
|
||||
k.URL = fmt.Sprintf("https://cdimage.kali.org/kali-%s", k.Relver)
|
||||
respBody, err := common.GetResponse(k.URL)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -34,7 +34,7 @@ func (k Kali) AddNewTorrents(transmissionbt *transmissionrpc.Client) error {
|
||||
var torrentURLs []string
|
||||
doc.Find("a").Each(func(i int, s *goquery.Selection) {
|
||||
if strings.Contains(s.Text(), ".torrent") {
|
||||
torrentURLs = append(torrentURLs, fmt.Sprintf("%s/kali-linux-%s-%s.torrent", k.URL, k.Relver, s.Text()))
|
||||
torrentURLs = append(torrentURLs, fmt.Sprintf("%s/%s", k.URL, s.Text()))
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user