autobrr/internal/indexer/definitions/ncore.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

85 lines
2.3 KiB
YAML

#id: nCore
name: nCore
identifier: ncore
description: nCore
language: en-us
urls:
- https://ncore.pro/
privacy: private
protocol: torrent
supports:
- irc
- rss
# source: unknown
settings:
- name: passkey
type: secret
required: true
label: Passkey
help: "Check a torrent download link. key='value' is your passkey."
irc:
network: P2P-Network
server: irc.p2p-network.net
port: 6697
tls: true
channels:
- "#ncore-bot"
announcers:
- nCore
settings:
- name: nick
type: text
required: true
label: Nick
help: Bot nick. Eg. user|autodl
- name: auth.account
type: text
required: false
label: NickServ Account
help: NickServ account. Make sure to group your user and bot.
- name: auth.password
type: secret
required: false
label: NickServ Password
help: NickServ password
#- name: invite_command
# type: secret
# default: "NBOT !invite IRCKEY"
# required: true
# label: Invite command
# help: Invite auth with the key from https://ncore.pro/irc.php. Replace IRCKEY
parse:
type: single
lines:
- tests:
- line: '[NEW TORRENT in mp3] Artist name - Album name > 115.63 MiB in 17F > https://ncore.pro/torrents.php?action=details&id=0000000'
expect:
category: mp3
torrentName: Artist name - Album name
torrentSize: 115.63 MiB
baseUrl: https://ncore.pro/
torrentId: "0000000"
- line: '[NEW TORRENT in xvidser_hun] Some.Show.S02E67.RTLM.WEB-DL.H264.HUN-GROUP > 269.31 MiB in 2F > https://ncore.pro/torrents.php?action=details&id=0000000'
expect:
category: xvidser_hun
torrentName: Some.Show.S02E67.RTLM.WEB-DL.H264.HUN-GROUP
torrentSize: 269.31 MiB
baseUrl: https://ncore.pro/
torrentId: "0000000"
pattern: '\[NEW TORRENT in (.*)\] (.*) > (.*) in .* > (https?://.*/).*action=.*id=(.*)'
vars:
- category
- torrentName
- torrentSize
- baseUrl
- torrentId
match:
infourl: "/torrents.php?action=details&id={{ .torrentId }}"
# https://ncore.pro/torrents.php?action=download&id=0000&key=00000
torrenturl: "/torrents.php?action=download&id={{ .torrentId }}&key={{ .passkey }}"