mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
fix(indexers): PolishSource downloads (#837)
* test: dump req and res for torrent download * chore: remove req res dump
This commit is contained in:
parent
8487475e73
commit
969a9e7025
2 changed files with 12 additions and 10 deletions
|
@ -332,16 +332,10 @@ func (r *Release) downloadTorrentFile(ctx context.Context) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
jar, err := cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List})
|
|
||||||
if err != nil {
|
|
||||||
return errors.Wrap(err, "could not create cookiejar")
|
|
||||||
}
|
|
||||||
|
|
||||||
customTransport := http.DefaultTransport.(*http.Transport).Clone()
|
customTransport := http.DefaultTransport.(*http.Transport).Clone()
|
||||||
customTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
|
customTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
|
||||||
client := &http.Client{
|
client := &http.Client{
|
||||||
Transport: customTransport,
|
Transport: customTransport,
|
||||||
Jar: jar,
|
|
||||||
Timeout: time.Second * 45,
|
Timeout: time.Second * 45,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,7 +344,15 @@ func (r *Release) downloadTorrentFile(ctx context.Context) error {
|
||||||
return errors.Wrap(err, "error downloading file")
|
return errors.Wrap(err, "error downloading file")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req.Header.Set("User-Agent", "autobrr")
|
||||||
|
|
||||||
if r.RawCookie != "" {
|
if r.RawCookie != "" {
|
||||||
|
jar, err := cookiejar.New(&cookiejar.Options{PublicSuffixList: publicsuffix.List})
|
||||||
|
if err != nil {
|
||||||
|
return errors.Wrap(err, "could not create cookiejar")
|
||||||
|
}
|
||||||
|
client.Jar = jar
|
||||||
|
|
||||||
// set the cookie on the header instead of req.AddCookie
|
// set the cookie on the header instead of req.AddCookie
|
||||||
// since we have a raw cookie like "uid=10; pass=000"
|
// since we have a raw cookie like "uid=10; pass=000"
|
||||||
req.Header.Set("Cookie", r.RawCookie)
|
req.Header.Set("Cookie", r.RawCookie)
|
||||||
|
|
|
@ -58,9 +58,9 @@ irc:
|
||||||
type: single
|
type: single
|
||||||
lines:
|
lines:
|
||||||
- test:
|
- test:
|
||||||
- "Some.Show.S09E01.HDTV.x264-GROUP > TV/SD > 359.285 MB / 2 F > [ http://polishsource.cz/details.php?id=000000 ]-[ 5h 25min 15sec after pre ]"
|
- " Some.Show.S09E01.HDTV.x264-GROUP > TV/SD > 359.285 MB / 2 F > [ http://polishsource.cz/details.php?id=000000 ]-[ 5h 25min 15sec after pre ]"
|
||||||
- "Some.Movie.2011.DVDRip.x264-GROUP2 > Movies/x264 (Documentary) > 563.296 MB / 2 F > [ http://polishsource.cz/details.php?id=000000 ]-[ 2min 48sec after pre ]"
|
- " Some.Movie.2011.DVDRip.x264-GROUP2 > Movies/x264 (Documentary) > 563.296 MB / 2 F > [ http://polishsource.cz/details.php?id=000000 ]-[ 2min 48sec after pre ]"
|
||||||
pattern: '(.*) > (.*) > (.*) \/.*>\s*\[ (https?\:\/\/.+\/).*[&?]id=(\d+)\s\](?:-\[ (.*) \])?'
|
pattern: '^ (.*) > (.*) > (.*) \/.*>\s*\[ (https?\:\/\/.+\/).*[&?]id=(\d+)\s\](?:-\[ (.*) \])?'
|
||||||
vars:
|
vars:
|
||||||
- torrentName
|
- torrentName
|
||||||
- category
|
- category
|
||||||
|
@ -71,6 +71,6 @@ irc:
|
||||||
|
|
||||||
match:
|
match:
|
||||||
infourl: "/details.php?id={{ .torrentId }}"
|
infourl: "/details.php?id={{ .torrentId }}"
|
||||||
torrenturl: "/downloadssl.php?id={{ .torrentId }}&torr={{ .torrentName }}.torrent&passkey={{ .passkey }}"
|
torrenturl: "/download.php?id={{ .torrentId }}&torr={{ .torrentName }}.torrent&passkey={{ .passkey }}"
|
||||||
encode:
|
encode:
|
||||||
- torrentName
|
- torrentName
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue