From 9aaf79e7bb5153f545ea0fe056c9f5a2c370934d Mon Sep 17 00:00:00 2001 From: Ludvig Lundgren Date: Mon, 30 Aug 2021 20:11:23 +0200 Subject: [PATCH] refactor: indexer definitions (#21) --- internal/indexer/definitions/beyondhd.yaml | 4 ++-- internal/indexer/definitions/btn.yaml | 4 ++-- internal/indexer/definitions/filelist.yaml | 2 +- internal/indexer/definitions/gazellegames.yaml | 2 +- internal/indexer/definitions/hd-torrents.yaml | 9 ++++----- internal/indexer/definitions/iptorrents.yaml | 2 +- internal/indexer/definitions/nebulance.yaml | 2 +- internal/indexer/definitions/orpheus.yaml | 7 +++++-- internal/indexer/definitions/ptp.yaml | 16 ++++++++-------- internal/indexer/definitions/red.yaml | 8 +++++--- internal/indexer/definitions/torrentleech.yaml | 4 ++-- internal/indexer/definitions/uhdbits.yaml | 3 ++- 12 files changed, 34 insertions(+), 29 deletions(-) diff --git a/internal/indexer/definitions/beyondhd.yaml b/internal/indexer/definitions/beyondhd.yaml index 03545c8..98129e5 100644 --- a/internal/indexer/definitions/beyondhd.yaml +++ b/internal/indexer/definitions/beyondhd.yaml @@ -51,7 +51,7 @@ parse: lines: - test: - "New Torrent: That.Show.S01.1080p.Blu-ray.AVC.DTS-HD.MA.5.1-Test Category: TV By: Uploader Size: 137.73 GB Link: https://beyond-hd.me/details.php?id=00000" - pattern: 'New Torrent:(.*)Category:(.*)By:(.*)Size:(.*)Link: https?\:\/\/([^\/]+\/).*[&\?]id=(\d+)' + pattern: 'New Torrent: (.*) Category: (.*) By: (.*) Size: (.*) Link: (https?\:\/\/[^\/]+\/).*[&\?]id=(\d+)' vars: - torrentName - category @@ -61,4 +61,4 @@ parse: - torrentId match: - torrenturl: "https://{{ .baseUrl }}torrent/download/auto.{{ .torrentId }}.{{ .passkey }}" + torrenturl: "{{ .baseUrl }}torrent/download/auto.{{ .torrentId }}.{{ .rsskey }}" diff --git a/internal/indexer/definitions/btn.yaml b/internal/indexer/definitions/btn.yaml index d8914cc..41164d7 100644 --- a/internal/indexer/definitions/btn.yaml +++ b/internal/indexer/definitions/btn.yaml @@ -54,7 +54,7 @@ parse: lines: - test: - "NOW BROADCASTING! [ The Show S06E07 720p WEB-DL DD 5.1 H.264 - LP ]" - pattern: ^NOW BROADCASTING! \[(.*)\] + pattern: ^NOW BROADCASTING! \[ (.*) \] vars: - torrentName - test: @@ -69,7 +69,7 @@ parse: vars: - year - category - - tags + - releaseTags - uploader - preTime - test: diff --git a/internal/indexer/definitions/filelist.yaml b/internal/indexer/definitions/filelist.yaml index ee77b73..d4c81d2 100644 --- a/internal/indexer/definitions/filelist.yaml +++ b/internal/indexer/definitions/filelist.yaml @@ -46,7 +46,7 @@ parse: - 'New Torrent: This.Really.Old.Movie.1965.DVDRip.DD1.0.x264 -- [Filme SD] [1.91 GB] -- https://filelist.io/details.php?id=000000 -- by uploader1' - 'New Torrent: This.New.Movie.2021.1080p.Blu-ray.AVC.DTS-HD.MA.5.1-BEATRIX -- [FreeLeech!] -- [Filme Blu-Ray] [26.78 GB] -- https://filelist.io/details.php?id=000000 -- by uploader1' - 'New Torrent: This.New.Movie.2021.1080p.Remux.AVC.DTS-HD.MA.5.1-playBD -- [FreeLeech!] -- [Internal!] -- [Filme Blu-Ray] [17.69 GB] -- https://filelist.io/details.php?id=000000 -- by uploader1' - pattern: 'New Torrent: (.*?) (?:-- \[(FreeLeech!)] )?(?:-- \[(Internal!)] )?-- \[(.*)] \[(.*)] -- (https?:\/\/filelist.io\/).*id=(.*) -- by (.*)' + pattern: 'New Torrent: (.*?) (?:-- \[(FreeLeech)!] )?(?:-- \[(Internal)!] )?-- \[(.*)] \[(.*)] -- (https?:\/\/filelist.io\/).*id=(.*) -- by (.*)' vars: - torrentName - freeleech diff --git a/internal/indexer/definitions/gazellegames.yaml b/internal/indexer/definitions/gazellegames.yaml index 5d28d0d..a6f4dcf 100644 --- a/internal/indexer/definitions/gazellegames.yaml +++ b/internal/indexer/definitions/gazellegames.yaml @@ -55,7 +55,7 @@ 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+) ?-? ?(.*?)?;?$' vars: - uploader - category diff --git a/internal/indexer/definitions/hd-torrents.yaml b/internal/indexer/definitions/hd-torrents.yaml index dee2971..3dba54e 100644 --- a/internal/indexer/definitions/hd-torrents.yaml +++ b/internal/indexer/definitions/hd-torrents.yaml @@ -15,7 +15,7 @@ supports: source: xbtit settings: - name: cookie - type: text + type: secret label: Cookie help: "Check how to get cookies in your browser and find the uid and pass cookies. Example: uid=1234; pass=asdf12347asdf13" @@ -33,7 +33,7 @@ irc: type: text required: true label: NickServ Account - help: NickServ account. Make sure to group your user and bot. Eg. user|bot + help: NickServ account. Make sure to group your user and bot. Eg. user-bot - name: nickserv.password type: secret required: true @@ -45,16 +45,15 @@ parse: lines: - test: - "New Torrent in category [Movies/Remux] That Movie (2008) Blu-ray 1080p REMUX AVC DTS-HD MA 7 1 (14.60 GB) uploaded! Download: https://hd-torrents.org/download.php?id=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" - pattern: 'New Torrent in category \[([^\]]*)\] (.*) \(([^\)]*)\) uploaded! Download\: https?\:\/\/([^\/]+\/).*[&\?]id=([a-f0-9]+)' + pattern: 'New Torrent in category \[([^\]]*)\] (.*) \(([^\)]*)\) uploaded! Download\: (https?\:\/\/.*[&\?]id=.+)' vars: - category - torrentName - torrentSize - baseUrl - - torrentId match: - torrenturl: "https://{{ .baseUrl }}download.php?id={{ .torrentId }}&f={{ .torrentName }}.torrent" + torrenturl: "{{ .baseUrl }}&f={{ .torrentName }}.torrent" cookie: true encode: - torrentName diff --git a/internal/indexer/definitions/iptorrents.yaml b/internal/indexer/definitions/iptorrents.yaml index 9ee046b..e070bab 100644 --- a/internal/indexer/definitions/iptorrents.yaml +++ b/internal/indexer/definitions/iptorrents.yaml @@ -47,7 +47,7 @@ parse: - test: - "[Movies/XviD] The Movie 2010 DVDRip XviD-GROUP FREELEECH - http://www.iptorrents.com/details.php?id=000000 - 716.219 MB" - "[Movies/XviD] The Movie 2010 DVDRip XviD-GROUP - http://www.iptorrents.com/details.php?id=000000 - 716.219 MB" - pattern: '^\[([^\]]*)](.*?)\s*(FREELEECH)*\s*-\s+https?\:\/\/([^\/]+).*[&\?]id=(\d+)\s*-(.*)' + pattern: '^\[([^\]]*)] (.*?)\s*(FREELEECH)*\s*-\s+(https?\:\/\/[^\/]+).*[&\?]id=(\d+)\s*- (.*)' vars: - category - torrentName diff --git a/internal/indexer/definitions/nebulance.yaml b/internal/indexer/definitions/nebulance.yaml index efac41f..3e74b8d 100644 --- a/internal/indexer/definitions/nebulance.yaml +++ b/internal/indexer/definitions/nebulance.yaml @@ -48,7 +48,7 @@ parse: - test: - "[Episodes] The Show - S02E08 [WebRip / x264 / MKV / 720p / HD / VLAD / The.Show.S02E08.Episode.Name.720p.ANPL.WEBRip.AAC2.0.x264-GROUP.mkv] [702.00 MB - Uploader: UPLOADER] - http://nebulance.io/torrents.php?id=000 [Tags: comedy,subtitles,cbs]" - "[Seasons] Other Show - S10 [HDTV / x264 / MKV / MP4 / 480p / SD / BTN / Other.Show.S10.HDTV.x264-GROUP] [5.27 GB - Uploader: UPLOADER] - http://nebulance.io/torrents.php?id=0000 [Tags: comedy,subtitles,cbs]" - pattern: '\[(.*?)\] (.*?) \[(.*?)\] \[(.*?) - Uploader: (.*?)\] - (https?://.*)id=(\d+) \[Tags: (.*)\]' + pattern: '\[(.*?)\] (.*?) \[(.*?)\] \[(.*?) - Uploader: (.*?)\] - (https?:\/\/.*)id=(\d+) \[Tags: (.*)\]' vars: - category - torrentName diff --git a/internal/indexer/definitions/orpheus.yaml b/internal/indexer/definitions/orpheus.yaml index 4bf2e62..e214eb6 100644 --- a/internal/indexer/definitions/orpheus.yaml +++ b/internal/indexer/definitions/orpheus.yaml @@ -55,11 +55,14 @@ parse: - test: - "TORRENT: That Artist - Albuum [2002] [Single] - FLAC / Lossless / WEB - 2000s,house,uk.garage,garage.house - https://orpheus.network/torrents.php?id=000000 / https://orpheus.network/torrents.php?action=download&id=0000000" - "TORRENT: Something [2021] [Album] - FLAC / Lossless / CD - - https://orpheus.network/torrents.php?id=000000 / https://orpheus.network/torrents.php?action=download&id=0000000" - pattern: 'TORRENT: (.*) - (.*) - https?://.* / (https?://.*id=\d+)' + pattern: 'TORRENT: (.*) \[(.+?)\] \[(.+?)\] - (.*) - \s*(.*) - https?:\/\/.* \/ (https?:\/\/.*id=\d+)' vars: - torrentName + - year + - category + - releaseTags - tags - - torrentId + - baseUrl match: torrenturl: "{{ .baseUrl }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" diff --git a/internal/indexer/definitions/ptp.yaml b/internal/indexer/definitions/ptp.yaml index 41fa8aa..7e00d40 100644 --- a/internal/indexer/definitions/ptp.yaml +++ b/internal/indexer/definitions/ptp.yaml @@ -28,7 +28,7 @@ irc: port: 7000 tls: true channels: - - "#ptp-announce" + - "#ptp-announce-dev" announcers: - Hummingbird settings: @@ -44,7 +44,7 @@ irc: help: NickServ password - name: invite_command type: secret - default: "Hummingbird ENTER USERNAME IRCKey #ptp-announce" + default: "Hummingbird ENTER USERNAME IRCKey #ptp-announce-dev" required: true label: Invite command help: Invite auth with Hummingbird. @@ -53,14 +53,14 @@ parse: type: single lines: - test: - - "That Movie [2008] by Director - XviD / DVD / AVI / 640x352 - http://passthepopcorn.me/torrents.php?id=00000 / http://passthepopcorn.me/torrents.php?action=download&id=00000 - crime, drama, mystery" - - "Some Old Movie [1988] by Director - x264 / Blu-ray / MKV / 720p - http://passthepopcorn.me/torrents.php?id=00000 / http://passthepopcorn.me/torrents.php?action=download&id=00000 - comedy, crime" - pattern: '^(.*)-\s*https?:.*[&\?]id=.*https?\:\/\/([^\/]+\/).*[&\?]id=(\d+)\s*-\s*(.*)' + - "That Movie [1972] by Some Director | x264 / Blu-ray / MKV / 1080p | 204371 | 964303 | That.Movie.1972.1080p.BluRay.FLAC.x264-GROUP | comedy, drama, romance" + pattern: '.* \[(.*)\] by .* \| (.*) \| .* \| (.*) \| (.*) \| (.*)' vars: - - torrentName - - baseUrl + - year + - releaseTags - torrentId + - torrentName - tags match: - torrenturl: "https://{{ .baseUrl }}torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" + torrenturl: "https://passthepopcorn.me/torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" diff --git a/internal/indexer/definitions/red.yaml b/internal/indexer/definitions/red.yaml index 128940f..9bafb1f 100644 --- a/internal/indexer/definitions/red.yaml +++ b/internal/indexer/definitions/red.yaml @@ -55,12 +55,14 @@ parse: - test: - "Artist - Albumname [2008] [Single] - FLAC / Lossless / Log / 100% / Cue / CD - https://redacted.ch/torrents.php?id=0000000 / https://redacted.ch/torrents.php?action=download&id=0000000 - hip.hop,rhythm.and.blues,2000s" - "A really long name here - Concertos 5 and 6, Suite No 2 [1991] [Album] - FLAC / Lossless / Log / 100% / Cue / CD - https://redacted.ch/torrents.php?id=0000000 / https://redacted.ch/torrents.php?action=download&id=0000000 - classical" - pattern: '^(.*)\s+-\s+https?:.*[&\?]id=.*https?\:\/\/([^\/]+\/).*[&\?]id=(\d+)\s*-\s*(.*)' + pattern: '^(.*)\s+\[(.*)\] \[(.*)\] - (.*) -\s+https?:.*[&\?]id=.*(https?\:\/\/.*)\s* -\s*(.*)' vars: - torrentName + - year + - category + - releaseTags - baseUrl - - torrentId - tags match: - torrenturl: "https://{{ .baseUrl }}torrents.php?action=download&id={{ .torrentId }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" + torrenturl: "{{ .baseUrl }}&authkey={{ .authkey }}&torrent_pass={{ .torrent_pass }}" diff --git a/internal/indexer/definitions/torrentleech.yaml b/internal/indexer/definitions/torrentleech.yaml index 66b721c..1d0762e 100644 --- a/internal/indexer/definitions/torrentleech.yaml +++ b/internal/indexer/definitions/torrentleech.yaml @@ -46,7 +46,7 @@ parse: - test: - "New Torrent Announcement: Name:'debian live 10 6 0 amd64 standard iso' uploaded by 'Anonymous' - http://www.tracker01.test/torrent/000000" - "New Torrent Announcement: Name:'debian live 10 6 0 amd64 standard iso' uploaded by 'Anonymous' freeleech - http://www.tracker01.test/torrent/000000" - pattern: New Torrent Announcement:\s*<([^>]*)>\s*Name:'(.*)' uploaded by '([^']*)'\s*(freeleech)*\s*-\s*https?\:\/\/([^\/]+\/)torrent\/(\d+) + pattern: New Torrent Announcement:\s*<([^>]*)>\s*Name:'(.*)' uploaded by '([^']*)'\s*(freeleech)*\s*-\s*(https?\:\/\/[^\/]+\/)torrent\/(\d+) vars: - category - torrentName @@ -56,7 +56,7 @@ parse: - torrentId match: - torrenturl: "https://{{ .baseUrl }}rss/download/{{ .torrentId }}/{{ .rsskey }}/{{ .torrentName }}.torrent" + torrenturl: "{{ .baseUrl }}rss/download/{{ .torrentId }}/{{ .rsskey }}/{{ .torrentName }}.torrent" encode: - torrentName diff --git a/internal/indexer/definitions/uhdbits.yaml b/internal/indexer/definitions/uhdbits.yaml index 9345829..097f586 100644 --- a/internal/indexer/definitions/uhdbits.yaml +++ b/internal/indexer/definitions/uhdbits.yaml @@ -55,9 +55,10 @@ parse: lines: - test: - "New Torrent: A Movie [2015] - GROUP Type: Movie / 1080p / Encode / Freeleech: 100 Size: 7.00GB - https://uhdbits.org/torrents.php?id=00000 / https://uhdbits.org/torrents.php?action=download&id=00000" - pattern: 'New Torrent: (.*) Type: (.*?) Freeleech: (.*) Size: (.*) - https?:\/\/.* \/ (https?:\/\/.*id=\d+)' + pattern: 'New Torrent: (.*) Type: (.*?) \/ (.*?) Freeleech: (.*) Size: (.*) - https?:\/\/.* \/ (https?:\/\/.*id=\d+)' vars: - torrentName + - category - releaseTags - freeleechPercent - torrentSize