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

91 lines
2.7 KiB
YAML

---
#id: tracker01
name: MyAnonamouse
identifier: myanonamouse
description: MyAnonaMouse (MAM) is a large ebook and audiobook tracker.
language: en-us
urls:
- https://www.myanonamouse.net/
privacy: private
protocol: torrent
supports:
- irc
- rss
# source: custom
settings:
- name: cookie
type: secret
required: true
label: Cookie (mam_id)
help: "Check how to get cookies in your browser and find the mam_id cookie. Changes monthly. Format mam_id=$ID;"
irc:
network: MyAnonamouse
server: irc.myanonamouse.net
port: 6697
tls: true
channels:
- "#announce"
announcers:
- MouseBot
settings:
- name: nick
type: text
required: true
label: Nick
help: Bot nick. Eg. user_bot
- name: auth.account
type: text
required: true
label: NickServ Account
help: NickServ account. Make sure to group your user and bot. Use main nick here.
- name: auth.password
type: secret
required: true
label: NickServ Password
help: NickServ password
parse:
type: single
lines:
- tests:
- line: 'New Torrent: Some famous book By: Author name Category: ( Ebooks - Science Fiction ) Size: ( 1.00 MiB ) Filetype: ( epub, mobi ) Language: ( English ) Link: ( https://www.myanonamouse.net/t/000000 )'
expect:
torrentName: Some famous book
author: Author name
category: Ebooks - Science Fiction
torrentSize: 1.00 MiB
tags: epub, mobi
language: English
baseUrl: https://www.myanonamouse.net/
torrentId: "000000"
freeleech: ""
- line: 'New Torrent: Some famous book By: Author name Category: ( Ebooks - Science Fiction ) Size: ( 2.11 MiB ) Filetype: ( epub, mobi ) Language: ( English ) Link: ( https://www.myanonamouse.net/t/000000 ) VIP'
expect:
torrentName: Some famous book
author: Author name
category: Ebooks - Science Fiction
torrentSize: 2.11 MiB
tags: epub, mobi
language: English
baseUrl: https://www.myanonamouse.net/
torrentId: "000000"
freeleech: VIP
pattern: 'New Torrent: (.*) By: (.*) Category: \( (.*) \) Size: \( (.*) \) Filetype: \( (.*) \) Language: \( (.*) \) Link: \( (https?\:\/\/[^\/]+\/).*?(\d+)\s*\)\s*(VIP)?'
vars:
- torrentName
- author
- category
- torrentSize
- tags
- language
- baseUrl
- torrentId
- freeleech
match:
infourl: "/t/{{ .torrentId }}"
torrenturl: "/tor/download.php?tid={{ .torrentId }}"
torrentname: "{{ .torrentName }} by {{ .author }} [{{ .language }} / {{ .tags }}]"