feat(indexers): add support for optional baseurl override (#551)

* feat(indexers): optional baseurl override

* feat(indexers): update baseUrl parsing

* refactor(indexers): BREAKING move parse to IRC struct

* Move Parse as part of IRC struct from Indexer
* Updated definitions
* Build torrentUrl in stages
* Use new url.JoinPath to build torrentUrl
* Update tests

* refactor(indexers): select option obj

* refactor(indexers): make backwards compatible
This commit is contained in:
ze0s 2022-12-03 15:40:45 +01:00 committed by GitHub
parent 301180e55b
commit 25a165b764
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
66 changed files with 1533 additions and 1211 deletions

View file

@ -58,31 +58,31 @@ irc:
label: Invite command
help: "Replace IRCKEY with: Edit Profile -> Access Settings -> IRC Key"
parse:
type: multi
lines:
- test:
- "New: (מה שקורה בצללים - עונה 4, פרק 3 / What We Do in the Shadows - S04E03 *היידפנישן*) Category: סדרות - HD Size: 825.43 MiB Seeders: 0 Leechers: 0"
- "New: (לגו מלחמת הכוכבים: חופשת קיץ / LEGO Star Wars Summer Vacation *היידפנישן*) Category: סרטים - HD Size: 1.02 GiB Seeders: 0 Leechers: 0"
- "New: (תמונות מחיי נישואין - עונה 1 / Scenes from a Marriage (US) - S01 *היידפנישן מלא*) Category: סדרות - HD מלא Size: 18.61 GiB Seeders: 0 Leechers: 0"
pattern: '^New: \((.*)\) Category: (.*) Size: ([\d\.,]+ \w+) Seeders: .+ Leechers: .+'
vars:
- name1
- category
- torrentSize
- test:
- "Link: https://hebits.net/torrents.php?torrentid=80081"
pattern: '^Link: https?\:\/\/?[w{3}.]*([^\/]+).*(?:&|\?)torrentid=(\d+)'
vars:
- baseUrl
- torrentId
- test:
- "Release: What.We.Do.in.the.Shadows.S04E03.The.Grand.Opening.720p.AMZN.WEB.DL.DDP5.1.H.264-FLUX"
- "Release: LEGO.Star.Wars.Summer.Vacation.2022.720p.WEB-DL.H.264.HebDub-iSrael"
- "Release: Scenes.From.a.Marriage.US.S01.1080p.AMZN.WEB-DL.DDP5.1.H.264-FLUX"
pattern: "^Release: (.*)"
vars:
- torrentName
parse:
type: multi
lines:
- test:
- "New: (מה שקורה בצללים - עונה 4, פרק 3 / What We Do in the Shadows - S04E03 *היידפנישן*) Category: סדרות - HD Size: 825.43 MiB Seeders: 0 Leechers: 0"
- "New: (לגו מלחמת הכוכבים: חופשת קיץ / LEGO Star Wars Summer Vacation *היידפנישן*) Category: סרטים - HD Size: 1.02 GiB Seeders: 0 Leechers: 0"
- "New: (תמונות מחיי נישואין - עונה 1 / Scenes from a Marriage (US) - S01 *היידפנישן מלא*) Category: סדרות - HD מלא Size: 18.61 GiB Seeders: 0 Leechers: 0"
pattern: '^New: \((.*)\) Category: (.*) Size: ([\d\.,]+ \w+) Seeders: .+ Leechers: .+'
vars:
- name1
- category
- torrentSize
- test:
- "Link: https://hebits.net/torrents.php?torrentid=80081"
pattern: '^Link: (https?\:\/\/?[w{3}.]*[^\/]+\/).+torrentid=(\d+)'
vars:
- baseUrl
- torrentId
- test:
- "Release: What.We.Do.in.the.Shadows.S04E03.The.Grand.Opening.720p.AMZN.WEB.DL.DDP5.1.H.264-FLUX"
- "Release: LEGO.Star.Wars.Summer.Vacation.2022.720p.WEB-DL.H.264.HebDub-iSrael"
- "Release: Scenes.From.a.Marriage.US.S01.1080p.AMZN.WEB-DL.DDP5.1.H.264-FLUX"
pattern: "^Release: (.*)"
vars:
- torrentName
match:
torrenturl: "https://{{ .baseUrl }}/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .passkey }}"
match:
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .passkey }}"