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

@ -11,7 +11,7 @@ protocol: torrent
supports:
- irc
- rss
source: custom
# source: custom
settings:
- name: passkey
type: secret
@ -47,55 +47,83 @@ irc:
label: NickServ Password
help: NickServ password
categories:
- 4K Movies
- 4K TV
- 4K TV Boxsets
- Anime
- Audiobooks
- Blu-Ray
- Books Magazines
- Cams/TS
- Documentaries
- DVDR
- Foreign
- Kids
- Mac Games
- MMA
- Movie Boxsets
- Movies
- Music
- Music Videos
- Nintendo
- Other
- PC Games
- Pictures
- Playstation
- PPV
- Soaps
- Sports / MotorSports
- Sports / Olympics
- Sports / UK Football
- TOTM
- TOTW (x2 upload)
- TV Boxsets
- TV Boxsets / HD Boxsets
- TV Boxsets / HEVC Boxsets
- TV-HD
- TV-HD / HEVC
- TV-SD
- Wii Games
- Wrestling
- Xbox Games
# categories:
# - 4K Movies
# - 4K TV
# - 4K TV Boxsets
# - Anime
# - Audiobooks
# - Blu-Ray
# - Books Magazines
# - Cams/TS
# - Documentaries
# - DVDR
# - Foreign
# - Kids
# - Mac Games
# - MMA
# - Movie Boxsets
# - Movies
# - Music
# - Music Videos
# - Nintendo
# - Other
# - PC Games
# - Pictures
# - Playstation
# - PPV
# - Soaps
# - Sports / MotorSports
# - Sports / Olympics
# - Sports / UK Football
# - TOTM
# - TOTW (x2 upload)
# - TV Boxsets
# - TV Boxsets / HD Boxsets
# - TV Boxsets / HEVC Boxsets
# - TV-HD
# - TV-HD / HEVC
# - TV-SD
# - Wii Games
# - Wrestling
# - Xbox Games
parse:
type: single
lines:
- test:
- "xspeeds.eu - New Torrent: ( The.Best.Show.S03E07.720p.BluRay.x264-GROUP ) Size: ( 1.96 GB ) Category: ( TV-HD ) Uploader: ( uploader1 ) Link: ( https://www.xspeeds.eu/details.php?id=0000000 )"
- "xspeeds.eu - New Torrent: ( Some.Show.S21E06.1080p.HEVC.x265-GROUP1 ) Size: ( 1.04 GB ) Category: ( HEVC ) Uploader: ( uploader2 ) Link: ( https://www.xspeeds.eu/details.php?id=0000000 )"
- "xspeeds.eu - New Torrent: ( Some.Show.S21E06.XviD-GROUP2 ) Size: ( 861.32 MB ) Category: ( TV-SD ) Uploader: ( uploader2 ) Link: ( https://www.xspeeds.eu/details.php?id=0000000 )"
- "xspeeds.eu - New Torrent: ( TOTW.Show.1-6.Boxset.iNTERNAL.1080P.BluRay.H265-GRP3 ) Size: ( 46.03 GB ) Category: ( TOTW (x2 upload) ) Uploader: ( uploader3 ) Link: ( https://www.xspeeds.eu/details.php?id=0000000 )"
- tests:
- line: 'xspeeds.eu - New Torrent: ( The.Best.Show.S03E07.720p.BluRay.x264-GROUP ) Size: ( 1.96 GB ) Category: ( TV-HD ) Uploader: ( uploader1 ) Link: ( https://www.xspeeds.eu/details.php?id=0000000 )'
expect:
torrentName: The.Best.Show.S03E07.720p.BluRay.x264-GROUP
torrentSize: 1.96 GB
category: TV-HD
uploader: uploader1
baseUrl: https://www.xspeeds.eu/
torrentId: "0000000"
- line: 'xspeeds.eu - New Torrent: ( Some.Show.S21E06.1080p.HEVC.x265-GROUP1 ) Size: ( 1.04 GB ) Category: ( HEVC ) Uploader: ( uploader2 ) Link: ( https://www.xspeeds.eu/details.php?id=0000000 )'
expect:
torrentName: Some.Show.S21E06.1080p.HEVC.x265-GROUP1
torrentSize: 1.04 GB
category: HEVC
uploader: uploader2
baseUrl: https://www.xspeeds.eu/
torrentId: "0000000"
- line: 'xspeeds.eu - New Torrent: ( Some.Show.S21E06.XviD-GROUP2 ) Size: ( 861.32 MB ) Category: ( TV-SD ) Uploader: ( uploader2 ) Link: ( https://www.xspeeds.eu/details.php?id=0000000 )'
expect:
torrentName: Some.Show.S21E06.XviD-GROUP2
torrentSize: 861.32 MB
category: TV-SD
uploader: uploader2
baseUrl: https://www.xspeeds.eu/
torrentId: "0000000"
- line: 'xspeeds.eu - New Torrent: ( TOTW.Show.1-6.Boxset.iNTERNAL.1080P.BluRay.H265-GRP3 ) Size: ( 46.03 GB ) Category: ( TOTW (x2 upload) ) Uploader: ( uploader3 ) Link: ( https://www.xspeeds.eu/details.php?id=0000000 )'
expect:
torrentName: TOTW.Show.1-6.Boxset.iNTERNAL.1080P.BluRay.H265-GRP3
torrentSize: 46.03 GB
category: TOTW (x2 upload)
uploader: uploader3
baseUrl: https://www.xspeeds.eu/
torrentId: "0000000"
pattern: '\s*xspeeds.eu - New Torrent: \( (.*) \) Size: \( (.*) \)\s*Category: \( (.*) \) Uploader: \( (.*) \) Link: \( (https?\:\/\/[^\/]+\/).*[&\?]id=(\d+) \)'
vars:
- torrentName