From f59e133398e79e46608a50c8852e3e46453fe05e Mon Sep 17 00:00:00 2001 From: Daniel Williams Date: Sat, 14 Oct 2023 11:11:23 +0100 Subject: [PATCH] feat(indexers): SubsPlease parse title (#1170) * Update subsplease.yaml regex to parse title This change aims to parse any multiple-word title to populate the title macro. * Update subsplease.yaml also captures title for batch releases I replaced the (.*?) part with ([^-()]+), which matches one or more characters that are not dashes or parentheses. This will stop at either a dash - or an opening parenthesis ( * Parsing title by matching a sequence instead of using a character class Using whitespace - (dash) whitespace numerical or whitespace ( (open bracket) numerical to end the title pattern * specify character amount of `\d` token --------- Co-authored-by: martylukyy <35452459+martylukyy@users.noreply.github.com> --- internal/indexer/definitions/subsplease.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/indexer/definitions/subsplease.yaml b/internal/indexer/definitions/subsplease.yaml index 969da08..ef87afc 100644 --- a/internal/indexer/definitions/subsplease.yaml +++ b/internal/indexer/definitions/subsplease.yaml @@ -46,11 +46,16 @@ irc: type: single lines: - test: - - "[Release] [SubsPlease] Title - 01 (480p) [636F636B].mkv (420.69MB) - https://nyaa.si/view/0000000 - https://nyaa.si/view/0000000/torrent" - pattern: '\[Release\] (.*(SubsPlease).*?)\.?(mkv)? \((\d+.?\d*[KMGTP]?B)\) - (.*) - (.*)' + - "[Release] [SubsPlease] Multiple Word Title - 01 (480p) [636F636B].mkv (420.69MB) - https://nyaa.si/view/0000000 - https://nyaa.si/view/0000000/torrent" + - "[Release] [SubsPlease] Multiple Word Title (01-12) (1080p) [Batch] (420GB) - https://nyaa.si/view/0000000 - https://nyaa.si/view/0000000/torrent" + - "[Release] [SubsPlease] Dashes - In-Title - 01 (480p) [636F636B].mkv (420.69MB) - https://nyaa.si/view/0000000 - https://nyaa.si/view/0000000/torrent" + - "[Release] [SubsPlease] Title - 1st Season (01-04) (1080p) [Batch] (420GB) - https://nyaa.si/view/0000000 - https://nyaa.si/view/0000000/torrent" + - "[Release] [SubsPlease] Special Title - 08.5 (480p) [5353245D].mkv (420.69MB) - https://nyaa.si/view/0000000 - https://nyaa.si/view/0000000/torrent" + pattern: '\[Release\] (.*(SubsPlease)] (.+?) (?:-\s\d{2,}|\(\d{2,}).*?\.?)(mkv)? \((\d+.?\d*[KMGTP]?B)\) - (.*) - (.*)' vars: - torrentName - releaseGroup + - title - releaseTags - torrentSize - infoUrl