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

@ -50,24 +50,24 @@ irc:
label: NickServ Password
help: NickServ password
parse:
type: single
lines:
- test:
- "New Torrent: סדרה - עונה 4 פרק 5 | Show S04E05 2160p UHDTV x265-Release-Group Category: סדרות ישראליות HD By: Uploader1 Size: 2.88GB Link: http://fuzer.me/attachment.php?attachmentid=101010 [Show.S04E05.2160p.UHDTV.x265-Release-Group]"
- "New Torrent: סדרה אפילו יותר טובה - עונה 1 פרק 7 - תרגום בצד | Even Better Show S01E07 1080p AMZN WEB-DL DDP5.1 H.264 Category: סדרות HD By: EvenBett3rUploader Size: 2.27GB Link: http://fuzer.me/attachment.php?attachmentid=222222 [Even.Better.Show.S01E07.14.45.1080p.AMZN.WEB-DL.DDP5.1.H.264]"
- "New Torrent: הכי טובה - עונה 1 פרק 5 - תרגום בצד | The Best S01E05 1080p WEB H264-TEST Category: סדרות HD By: Uploader5 Size: 3.25GB Link: http://fuzer.me/attachment.php?attachmentid=616161 [The.Best.S01E05.1080p.WEB.H264-TEST]"
pattern: 'New Torrent: (.*) Category: (.*) By: (.*) Size: (.*) Link: https?\:\/\/([^\/]+)\/.*[&\?]attachmentid=(\d+) \[(.*)\]'
vars:
- name1
- category
- uploader
- torrentSize
- baseUrl
- torrentId
- torrentName
parse:
type: single
lines:
- test:
- "New Torrent: סדרה - עונה 4 פרק 5 | Show S04E05 2160p UHDTV x265-Release-Group Category: סדרות ישראליות HD By: Uploader1 Size: 2.88GB Link: http://fuzer.me/attachment.php?attachmentid=101010 [Show.S04E05.2160p.UHDTV.x265-Release-Group]"
- "New Torrent: סדרה אפילו יותר טובה - עונה 1 פרק 7 - תרגום בצד | Even Better Show S01E07 1080p AMZN WEB-DL DDP5.1 H.264 Category: סדרות HD By: EvenBett3rUploader Size: 2.27GB Link: http://fuzer.me/attachment.php?attachmentid=222222 [Even.Better.Show.S01E07.14.45.1080p.AMZN.WEB-DL.DDP5.1.H.264]"
- "New Torrent: הכי טובה - עונה 1 פרק 5 - תרגום בצד | The Best S01E05 1080p WEB H264-TEST Category: סדרות HD By: Uploader5 Size: 3.25GB Link: http://fuzer.me/attachment.php?attachmentid=616161 [The.Best.S01E05.1080p.WEB.H264-TEST]"
pattern: 'New Torrent: (.*) Category: (.*) By: (.*) Size: (.*) Link: https?\:\/\/([^\/]+)\/.*[&\?]attachmentid=(\d+) \[(.*)\]'
vars:
- name1
- category
- uploader
- torrentSize
- baseUrl
- torrentId
- torrentName
match:
torrenturl: "https://www.{{ .baseUrl }}/rss/torrent.php/{{ .torrentId }}/{{ .uid }}/{{ .passkey }}/{{ .torrentName }}.torrent"
encode:
- torrentName
match:
torrenturl: "/rss/torrent.php/{{ .torrentId }}/{{ .uid }}/{{ .passkey }}/{{ .torrentName }}.torrent"
encode:
- torrentName