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>
This commit is contained in:
Frederick Robinson 2023-11-18 06:41:39 -08:00 committed by GitHub
parent e842a7bd42
commit fef0da5711
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
83 changed files with 1887 additions and 565 deletions

View file

@ -9,7 +9,7 @@ privacy: private
protocol: torrent
supports:
- irc
source: gazelle
# source: gazelle
settings:
- name: passkey
type: secret
@ -61,24 +61,42 @@ irc:
parse:
type: multi
lines:
- test:
- "New: (מה שקורה בצללים - עונה 4, פרק 3 / What We Do in the Shadows - S04E03 *היידפנישן*) Category: סדרות - HD Size: 825.43 MiB Seeders: 0 Leechers: 0"
- "New: (לגו מלחמת הכוכבים: חופשת קיץ / LEGO Star Wars Summer Vacation *היידפנישן*) Category: סרטים - HD Size: 1.02 GiB Seeders: 0 Leechers: 0"
- "New: (תמונות מחיי נישואין - עונה 1 / Scenes from a Marriage (US) - S01 *היידפנישן מלא*) Category: סדרות - HD מלא Size: 18.61 GiB Seeders: 0 Leechers: 0"
- tests:
- line: 'New: (מה שקורה בצללים - עונה 4, פרק 3 / What We Do in the Shadows - S04E03 *היידפנישן*) Category: סדרות - HD Size: 825.43 MiB Seeders: 0 Leechers: 0'
expect:
category: סדרות - HD
torrentSize: 825.43 MiB
- line: 'New: (לגו מלחמת הכוכבים: חופשת קיץ / LEGO Star Wars Summer Vacation *היידפנישן*) Category: סרטים - HD Size: 1.02 GiB Seeders: 0 Leechers: 0'
expect:
category: סרטים - HD
torrentSize: 1.02 GiB
- line: 'New: (תמונות מחיי נישואין - עונה 1 / Scenes from a Marriage (US) - S01 *היידפנישן מלא*) Category: סדרות - HD מלא Size: 18.61 GiB Seeders: 0 Leechers: 0'
expect:
category: סדרות - HD מלא
torrentSize: 18.61 GiB
pattern: '^New: .* Category: (.*) Size: (.*) Seeders: .+ Leechers: .+'
vars:
- category
- torrentSize
- test:
- "Link: https://hebits.net/torrents.php?torrentid=80081"
- tests:
- line: 'Link: https://hebits.net/torrents.php?torrentid=80081'
expect:
baseUrl: https://hebits.net/
torrentId: "80081"
pattern: '^Link: (https:\/\/.*\/).*torrentid=(\d+)'
vars:
- baseUrl
- torrentId
- test:
- "Release: What.We.Do.in.the.Shadows.S04E03.The.Grand.Opening.720p.AMZN.WEB.DL.DDP5.1.H.264-FLUX"
- "Release: LEGO.Star.Wars.Summer.Vacation.2022.720p.WEB-DL.H.264.HebDub-iSrael"
- "Release: Scenes.From.a.Marriage.US.S01.1080p.AMZN.WEB-DL.DDP5.1.H.264-FLUX"
- tests:
- line: 'Release: What.We.Do.in.the.Shadows.S04E03.The.Grand.Opening.720p.AMZN.WEB.DL.DDP5.1.H.264-FLUX'
expect:
torrentName: What.We.Do.in.the.Shadows.S04E03.The.Grand.Opening.720p.AMZN.WEB.DL.DDP5.1.H.264-FLUX
- line: 'Release: LEGO.Star.Wars.Summer.Vacation.2022.720p.WEB-DL.H.264.HebDub-iSrael'
expect:
torrentName: LEGO.Star.Wars.Summer.Vacation.2022.720p.WEB-DL.H.264.HebDub-iSrael
- line: 'Release: Scenes.From.a.Marriage.US.S01.1080p.AMZN.WEB-DL.DDP5.1.H.264-FLUX'
expect:
torrentName: Scenes.From.a.Marriage.US.S01.1080p.AMZN.WEB-DL.DDP5.1.H.264-FLUX
pattern: "^Release: (.*)"
vars:
- torrentName