feat(indexers): update SeedPool IRC announce parsing (#1835)

* feat(indexers): update SeedPool IRC port

* feat(indexers): SeedPool add db migration

* fix(indexers): adapt regex, tests and vars

* fix(indexers): set internal var to origin to fix parsing

---------

Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com>
This commit is contained in:
ze0s 2024-11-24 18:34:40 +01:00 committed by GitHub
parent b0a30dd136
commit be9a956598
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 43 additions and 8 deletions

View file

@ -990,5 +990,9 @@ UPDATE irc_network
`UPDATE indexer `UPDATE indexer
SET base_url = 'https://redacted.sh/' SET base_url = 'https://redacted.sh/'
WHERE base_url = 'https://redacted.ch/'; WHERE base_url = 'https://redacted.ch/';
`,
`UPDATE irc_network
SET port = '6697', tls = true
WHERE server = 'irc.seedhost.org';
`, `,
} }

View file

@ -1632,5 +1632,9 @@ UPDATE irc_network
`UPDATE indexer `UPDATE indexer
SET base_url = 'https://redacted.sh/' SET base_url = 'https://redacted.sh/'
WHERE base_url = 'https://redacted.ch/'; WHERE base_url = 'https://redacted.ch/';
`,
`UPDATE irc_network
SET port = '6697', tls = true
WHERE server = 'irc.seedhost.org';
`, `,
} }

View file

@ -683,7 +683,7 @@ func (r *Release) MapVars(def *IndexerDefinition, varMap map[string]string) erro
} }
if freeleech, err := getStringMapValue(varMap, "freeleech"); err == nil { if freeleech, err := getStringMapValue(varMap, "freeleech"); err == nil {
fl := StringEqualFoldMulti(freeleech, "1", "free", "freeleech", "freeleech!", "yes", "VIP") fl := StringEqualFoldMulti(freeleech, "1", "free", "freeleech", "freeleech!", "yes", "VIP", "★")
if fl { if fl {
r.Freeleech = true r.Freeleech = true
// default to 100 and override if freeleechPercent is present in next function // default to 100 and override if freeleechPercent is present in next function

View file

@ -22,12 +22,13 @@ settings:
irc: irc:
network: SeedPool network: SeedPool
server: irc.seedpool.org server: irc.seedpool.org
port: 6669 port: 6697
tls: false tls: true
channels: channels:
- "#announce" - "#announce"
announcers: announcers:
- seedpool - seedpool
- uploader
settings: settings:
- name: nick - name: nick
type: text type: text
@ -39,20 +40,46 @@ irc:
type: single type: single
lines: lines:
- tests: - tests:
- line: Movie The.Best.Show.Ever.2024.1080p.WEB.h264-EDITH https://seedpool.org/torrents/23463 3.27 GiB - line: 【 BoxSet 】 Some - Box Set (2023) S01 (2160p DSNP WEB-DL Hybrid H265 DV HDR DDP 5.1 English - GROUP) ჻ seedpool@https://seedpool.org/torrents/00000 ჻ 39.74 GiB
expect:
category: BoxSet
torrentName: Some - Box Set (2023) S01 (2160p DSNP WEB-DL Hybrid H265 DV HDR DDP 5.1 English - GROUP)
uploader: "seedpool"
baseUrl: https://seedpool.org/
torrentId: "00000"
torrentSize: 39.74 GiB
origin: ""
freeleech: ""
- line: 【 Music 】 Music.0-Day.FLAC.2024-11-24.seedpool ჻ seedpool@https://seedpool.org/torrents/00000 ჻ 56.73 GiB ჻ iNTERNAL ჻ ★
expect:
category: Music
torrentName: Music.0-Day.FLAC.2024-11-24.seedpool
uploader: "seedpool"
baseUrl: https://seedpool.org/
torrentId: "00000"
torrentSize: 56.73 GiB
origin: "iNTERNAL"
freeleech: "★"
- line: 【 Movie 】 Some Movie 2024 1080p BluRay REMUX AVC DTS-HD-MA 5 1-UnKn0wn ჻ seedpool@https://seedpool.org/torrents/00000 ჻ 17.85 GiB ჻ ★
expect: expect:
category: Movie category: Movie
torrentName: The.Best.Show.Ever.2024.1080p.WEB.h264-EDITH torrentName: Some Movie 2024 1080p BluRay REMUX AVC DTS-HD-MA 5 1-UnKn0wn
uploader: "seedpool"
baseUrl: https://seedpool.org/ baseUrl: https://seedpool.org/
torrentId: "23463" torrentId: "00000"
torrentSize: 3.27 GiB torrentSize: 17.85 GiB
pattern: '(.+) (.+) (https?\:\/\/.+\/)torrents\/(\d+) (.*)' origin: ""
freeleech: "★"
pattern: '^【 (.+?) 】 (.*?) ჻ (.*?)@(https:\/\/.*?\/)torrents/(\d+) ჻ ([^჻]+)(?: ჻ (iNTERNAL))?(?: ჻ (★))?$'
vars: vars:
- category - category
- torrentName - torrentName
- uploader
- baseUrl - baseUrl
- torrentId - torrentId
- torrentSize - torrentSize
- origin
- freeleech
match: match:
infourl: "/torrents/{{ .torrentId }}" infourl: "/torrents/{{ .torrentId }}"