autobrr/internal/indexer/definitions/alpharatio.yaml
Frederick Robinson fef0da5711
feat(definitions): add expectations for test lines (#1257)
* factor out test helpers

* refactor, add tests for animebytes

* revert test refactor

* better name

* change format, migrate some examples

* migrated remaining test cases

* add comment about `Test` vs `Tests`

* refactor

* reorder expectations to match vars

* generate

* turn on strict unmarshalling, remove old `Test` from schema

* start modifying actual definitions

* done with the As

* Bs

* C, D

* E, F

* G, H, I, ... L

* M, N

* O, P

* R

* bonus error. without this, pattern/vars disagreement can panic.

* S

* T, U

* X.. Now we know our ABCs next time won't you sing with meeeee

* fix another test

* another driveby change

* be less strict parsing custom definitions

* fix(definitions): load custom definitions

---------

Co-authored-by: ze0s <ze0s@riseup.net>
2023-11-18 15:41:39 +01:00

88 lines
2.5 KiB
YAML

---
#id: alpharatio
name: AlphaRatio
identifier: alpharatio
description: AlphaRatio (AR) is a private torrent tracker for 0DAY / GENERAL
language: en-us
urls:
- https://alpharatio.cc/
privacy: private
protocol: torrent
supports:
- irc
- rss
# source: gazelle
settings:
- name: authkey
type: secret
required: true
label: Auth key
help: Right click DL on a torrent and get the authkey.
- name: torrent_pass
type: secret
required: true
label: Torrent pass
help: Right click DL on a torrent and get the torrent_pass.
irc:
network: AlphaRatio
server: irc.alpharatio.cc
port: 7000
tls: true
channels:
- "#Announce"
announcers:
- Voyager
settings:
- name: nick
type: text
required: true
label: Nick
help: Bot nick. Eg. user_bot
- name: invite_command
type: secret
default: "Voyager autobot USERNAME IRCKEY"
required: true
label: Invite command
help: Invite auth with Voyager. Replace USERNAME with site nick and set IRCKEY.
parse:
type: multi
forcesizeunit: MB
lines:
- tests:
- line: '[new release]-[moviehd]-[that.movie.2017.internal.1080p.bluray.crf.x264-group]-[url]-[ https://alpharatio.cc/torrents.php?id=000000 ]-[ 000000 ]-[ uploaded 2 mins, 59 secs after pre. ]'
expect:
category: moviehd
torrentName: that.movie.2017.internal.1080p.bluray.crf.x264-group
baseUrl: https://alpharatio.cc/
groupId: "000000"
torrentId: "000000"
preTime: 2 mins, 59 secs
pattern: '\[.*\]-\[(.*)\]-\[(.*)\]-\[.*\]-\[ (https?://.+/).*id=(.*) ]-\[ (\d+) \](?:-\[ \w* (.*) after .* ])?'
vars:
- category
- torrentName
- baseUrl
- groupId
- torrentId
- preTime
- tests:
- line: '[AutoDL]-[MovieHD]-[000000]-[ 1 | 10659 | 1 | 1 ]-[That.Movie.2017.INTERNAL.1080p.BluRay.CRF.x264-GROUP]'
expect:
scene: "1"
torrentSize: "10659"
freeleech: "1"
auto: "1"
pattern: '\[.*\]-\[.*\]-\[.*\]-\[ ([01]) \| (\d+) \| ([01]) \| ([01]) \]-\[.*\]'
vars:
- scene
- torrentSize
- freeleech
- auto
match:
infourl: "/torrents.php?id={{ .groupId }}&torrentid={{ .torrentId }}"
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}"