From f811b804139eda2c06b813de9add172b42fd7a8d Mon Sep 17 00:00:00 2001 From: xoaaC <35452459+xoaaC@users.noreply.github.com> Date: Thu, 10 Nov 2022 10:35:59 +0100 Subject: [PATCH] fix(indexers): GGn regex pattern (#516) * Fixed regex to still match the announce if there are no flags in it. * customize freeleech parsing from regex * Fix match when there is no year given (instead of 0) for a release. Made capture group 4 lazy/optional/ungreedy. Created a non-capturing group for the `:: NSFW! ::` section to exclude the seperators and the tag itself from the tags var. I think we should exclude a possible `:: NSFW! ::` section after the tags section from matching for 2 reasons: 1. There is already an "adult" tag. Use it. 2. The `:: NSFW! ::` may get truncated if the announce line is too long. Matching the tag against `adult` is more consistent. Fix match when `:: NSFW! ::` section gets truncated because the announce line is too long. Tested with a sample size of 554 announces of which 554 resulted in a match. * fix(indexers): ggn change flags to releaseTags and freeleech --- internal/indexer/definitions/gazellegames.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/indexer/definitions/gazellegames.yaml b/internal/indexer/definitions/gazellegames.yaml index 045413a..8808446 100644 --- a/internal/indexer/definitions/gazellegames.yaml +++ b/internal/indexer/definitions/gazellegames.yaml @@ -85,14 +85,14 @@ parse: - test: - "Uploader :-: Nintendo 3DS :-: Cool.Game.KOR.3DS-BigBlueBox in Cool Game [2013] ::Korean, Multi-Region, Scene:: https://gazellegames.net/torrents.php?torrentid=00000 - adventure, role_playing_game, nintendo;" - "Uploader :-: Windows :-: Other.Game-HI2U in Other Game [2016] ::English, Scene:: FREELEECH! :: https://gazellegames.net/torrents.php?torrentid=00000 - action, adventure, casual, indie, role.playing.game;" - pattern: '^(.+) :-: (.+) :-: (.+) \[(\d+)\] ::(.+?):: ?(.+? ::)? (https?:\/\/[^\/]+\/)torrents.php\?torrentid=(\d+) ?-? ?(.*?)?;?$' + pattern: '^(.+) :-: (.+) :-: (.+) \[(\d+)?\] ::(.+?)?:: ?(.+?)?(?:! ::)? (https?:\/\/[^\/]+\/)torrents.php\?torrentid=(\d+)(?: - )?([a-zA-Z0-9, _\.]+)?;?(?:[ :]*(?:[NSFW]*)?[! :]*)?$' vars: - uploader - category - torrentName - year - - flags - - bonus + - releaseTags + - freeleech - baseUrl - torrentId - tags