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

@ -5,7 +5,7 @@ identifier: bithdtv
description: Bit-HDTV (BHDTV) is a specialized HD tracker in movies and TV with so many daily uploads.
language: en-us
urls:
- https://www.bit-hdtv.com
- https://www.bit-hdtv.com/
privacy: private
protocol: torrent
supports:
@ -48,19 +48,19 @@ irc:
label: NickServ Password
help: NickServ password
parse:
type: single
lines:
- test:
- "New torrent: Fear.the.walking.bee.s01e01.720p.WEB.h264-lemoncakes | Cat.: TV | WEB-DL | 720p | Uploader: ze0s | https://www.bit-hdtv.com/details.php?id=448412837123"
- "New torrent: Y.r.u.there.2022.1080p.BluRay.DDP5.1.x264-egg | Cat.: Movies | Encode x264 | 1080p | Uploader: Anonymous | https://www.bit-hdtv.com/details.php?id=69"
pattern: 'New torrent: (.*) \|\s*Cat.: ([^\|]*) \| .* Uploader: (.*) \| (https?\:\/\/[^\/]+).*id=(\d+)'
vars:
- torrentName
- category
- uploader
- baseUrl
- torrentId
parse:
type: single
lines:
- test:
- "New torrent: Fear.the.walking.bee.s01e01.720p.WEB.h264-lemoncakes | Cat.: TV | WEB-DL | 720p | Uploader: ze0s | https://www.bit-hdtv.com/details.php?id=448412837123"
- "New torrent: Y.r.u.there.2022.1080p.BluRay.DDP5.1.x264-egg | Cat.: Movies | Encode x264 | 1080p | Uploader: Anonymous | https://www.bit-hdtv.com/details.php?id=69"
pattern: 'New torrent: (.*) \|\s*Cat.: ([^\|]*) \| .* Uploader: (.*) \| (https?\:\/\/[^\/]+\/).*id=(\d+)'
vars:
- torrentName
- category
- uploader
- baseUrl
- torrentId
match:
torrenturl: "{{ .baseUrl }}/rssdownload.php?id={{ .torrentId }}&passkey={{ .passkey }}"
match:
torrenturl: "/rssdownload.php?id={{ .torrentId }}&passkey={{ .passkey }}"