From be9a956598f4b79946e0940dd1b5a616c6f9b6f7 Mon Sep 17 00:00:00 2001 From: ze0s <43699394+zze0s@users.noreply.github.com> Date: Sun, 24 Nov 2024 18:34:40 +0100 Subject: [PATCH] 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> --- internal/database/postgres_migrate.go | 4 +++ internal/database/sqlite_migrate.go | 4 +++ internal/domain/release.go | 2 +- internal/indexer/definitions/seedpool.yaml | 41 ++++++++++++++++++---- 4 files changed, 43 insertions(+), 8 deletions(-) diff --git a/internal/database/postgres_migrate.go b/internal/database/postgres_migrate.go index 6a40aa5..9aeb9c2 100644 --- a/internal/database/postgres_migrate.go +++ b/internal/database/postgres_migrate.go @@ -990,5 +990,9 @@ UPDATE irc_network `UPDATE indexer SET base_url = 'https://redacted.sh/' WHERE base_url = 'https://redacted.ch/'; +`, + `UPDATE irc_network + SET port = '6697', tls = true + WHERE server = 'irc.seedhost.org'; `, } diff --git a/internal/database/sqlite_migrate.go b/internal/database/sqlite_migrate.go index 69a122d..f15ef92 100644 --- a/internal/database/sqlite_migrate.go +++ b/internal/database/sqlite_migrate.go @@ -1632,5 +1632,9 @@ UPDATE irc_network `UPDATE indexer SET base_url = 'https://redacted.sh/' WHERE base_url = 'https://redacted.ch/'; +`, + `UPDATE irc_network + SET port = '6697', tls = true + WHERE server = 'irc.seedhost.org'; `, } diff --git a/internal/domain/release.go b/internal/domain/release.go index 4ba4a68..d5a6cb7 100644 --- a/internal/domain/release.go +++ b/internal/domain/release.go @@ -683,7 +683,7 @@ func (r *Release) MapVars(def *IndexerDefinition, varMap map[string]string) erro } 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 { r.Freeleech = true // default to 100 and override if freeleechPercent is present in next function diff --git a/internal/indexer/definitions/seedpool.yaml b/internal/indexer/definitions/seedpool.yaml index 858d2ba..0d8aaa3 100644 --- a/internal/indexer/definitions/seedpool.yaml +++ b/internal/indexer/definitions/seedpool.yaml @@ -22,12 +22,13 @@ settings: irc: network: SeedPool server: irc.seedpool.org - port: 6669 - tls: false + port: 6697 + tls: true channels: - "#announce" announcers: - seedpool + - uploader settings: - name: nick type: text @@ -39,20 +40,46 @@ irc: type: single lines: - 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: 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/ - torrentId: "23463" - torrentSize: 3.27 GiB - pattern: '(.+) (.+) (https?\:\/\/.+\/)torrents\/(\d+) (.*)' + torrentId: "00000" + torrentSize: 17.85 GiB + origin: "" + freeleech: "★" + pattern: '^【 (.+?) 】 (.*?) ჻ (.*?)@(https:\/\/.*?\/)torrents/(\d+) ჻ ([^჻]+)(?: ჻ (iNTERNAL))?(?: ჻ (★))?$' vars: - category - torrentName + - uploader - baseUrl - torrentId - torrentSize + - origin + - freeleech match: infourl: "/torrents/{{ .torrentId }}"