feat(indexers): add animebytes (#87)

* feat: Added support for AB indexer.

* docs: Changed readme to inlcude all the supported trackers.

* feat: improve releasetags parsing and regex
This commit is contained in:
KaiserBh 2022-01-17 01:28:01 +11:00 committed by GitHub
parent 284a2f9590
commit 8ff8e6bbb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 127 additions and 6 deletions

View file

@ -7,7 +7,7 @@ autobrr monitors IRC announce channels to get releases as soon as they are avail
## Features:
* Single binary + config for easy setup
* Support for 15 trackers
* Support for 21 trackers
* Easy to use UI
* Available torrent actions:
* qBittorrent
@ -26,6 +26,7 @@ Is your tracker missing? Add an issue to request it.
<summary>Trackers</summary>
* AlphaRatio
* AnimeBytes
* BeyondHD
* BTN
* EMP
@ -33,11 +34,16 @@ Is your tracker missing? Add an issue to request it.
* GazelleGames
* HD-Torrents
* IPTorrents
* Milkie
* MoreThanTV
* Nebulance
* Orpheus
* PTP
* RED
* Superbits
* TorrentDay
* TorrentLeech
* TorrentSeeds
* TranceTraffic
* UHDBits
</details>

View file

@ -190,6 +190,19 @@ func (r *Release) extractResolution() error {
return nil
}
func (r *Release) extractResolutionFromTags(tag string) error {
if r.Resolution != "" {
return nil
}
v, err := findLast(tag, `\b(([0-9]{3,4}p|i))\b`)
if err != nil {
return err
}
r.Resolution = v
return nil
}
func (r *Release) extractSource() error {
v, err := findLast(r.TorrentName, `(?i)\b(((?:PPV\.)?[HP]DTV|(?:HD)?CAM|B[DR]Rip|(?:HD-?)?TS|(?:PPV )?WEB-?DL(?: DVDRip)?|HDRip|DVDRip|DVDRIP|CamRip|WEB|W[EB]BRip|Blu-?Ray|DvDScr|telesync|CD|DVD|Vinyl|DAT|Cassette))\b`)
if err != nil {
@ -214,7 +227,21 @@ func (r *Release) extractSourceFromTags(tag string) error {
}
func (r *Release) extractCodec() error {
v, err := findLast(r.TorrentName, `(?i)\b(HEVC|[hx]\.?26[45]|xvid|divx|AVC|MPEG-?2|AV1|VC-?1|VP9|WebP)\b`)
v, err := findLast(r.TorrentName, `(?i)\b(HEVC|[hx]\.?26[45] 10-bit|[hx]\.?26[45]|xvid|divx|AVC|MPEG-?2|AV1|VC-?1|VP9|WebP)\b`)
if err != nil {
return err
}
r.Codec = v
return nil
}
func (r *Release) extractCodecFromTags(tag string) error {
if r.Codec != "" {
return nil
}
v, err := findLast(tag, `(?i)\b(HEVC|[hx]\.?26[45] 10-bit|[hx]\.?26[45]|xvid|divx|AVC|MPEG-?2|AV1|VC-?1|VP9|WebP)\b`)
if err != nil {
return err
}
@ -305,6 +332,19 @@ func (r *Release) extractGroup() error {
return nil
}
func (r *Release) extractAnimeGroupFromTags(tag string) error {
if r.Group != "" {
return nil
}
v, err := findLast(tag, `(?:RAW|Softsubs|Hardsubs)\s\((.+)\)`)
if err != nil {
return err
}
r.Group = v
return nil
}
func (r *Release) extractRegion() error {
v, err := findLast(r.TorrentName, `(?i)\b(R([0-9]))\b`)
if err != nil {
@ -392,7 +432,7 @@ func (r *Release) extractFreeleechFromTags(tag string) error {
}
// Start with the basic most common ones
v, err := findLast(tag, `Freeleech!`)
v, err := findLast(tag, `(Freeleech!|Freeleech)`)
if err != nil {
return err
}
@ -469,16 +509,21 @@ func (r *Release) extractReleaseTags() error {
return nil
}
tags := SplitAny(r.ReleaseTags, ",|/ ")
tags := SplitAny(r.ReleaseTags, ",|/")
for _, t := range tags {
t = strings.Trim(t, " ")
var err error
err = r.extractAudioFromTags(t)
err = r.extractResolutionFromTags(t)
err = r.extractCodecFromTags(t)
err = r.extractContainerFromTags(t)
err = r.extractSourceFromTags(t)
err = r.extractFreeleechFromTags(t)
err = r.extractLogScoreFromTags(t)
err = r.extractBitrateFromTags(t)
err = r.extractAnimeGroupFromTags(t)
if err != nil {
continue

View file

@ -0,0 +1,66 @@
---
#id: animebytes
name: AnimeBytes
identifier: animebytes
description: AnimeBytes (AB) is a private torrent tracker for Anime, Manga, J-Music, OSTS, Hentai, Games and Light Novel.
language: en-us
urls:
- https://animebytes.tv/
privacy: private
protocol: torrent
supports:
- irc
- rss
source: gazelle
settings:
- name: passkey
type: secret
label: PassKey
help: Settings -> Account -> Passkey.
irc:
network: AnimeBytes-IRC
server: irc.animebytes.tv
port: 7000
tls: true
channels:
- "#announce"
announcers:
- Satsuki
settings:
- name: nickserv.account
type: text
required: true
label: NickServ Account
help: NickServ account. Make sure to group your user and bot. Eg. user|autodl
- name: nickserv.password
type: secret
required: false
label: NickServ Password
help: NickServ password
- name: invite_command
type: secret
default: "/msg Satsuki enter #announce {AB username} ircKey"
required: true
label: Invite command
help: Invite auth with Satsuki, animebytes.tv/irc
parse:
type: single
lines:
- test:
- "Other Show! 3rd Season - TV Series [2020] :: Blu-ray / MKV / h265 10-bit / 1080p / FLAC 5.0 / RAW (LoliHouse) / Freeleech || https://animebytes.tv/torrents.php?id=000000&torrentid=00000000 || music || Uploaded by: Anonymous"
- "Show 1 - TV Series [2004] :: DVD / MKV / h264 10-bit / 712x478 / FLAC 2.0 / Dual Audio / Softsubs (WSE) || https://animebytes.tv/torrents.php?id=0000&torrentid=000000 || coming.of.age, romance, seinen, slice.of.life, tragedy || Uploaded by: Uploader"
- "Artist - Album! Original Sound Track [2011] :: MP3 / V0 (VBR) / CD || https://animebytes.tv/torrents2.php?id=000000&torrentid=0000000 || soundtrack || Uploaded by: Test-Uploader"
pattern: '(.*) \[(\d+)\] :: (.*) \|\| (https.*)\/torrents.*\?id=\d+&torrentid=(\d+) \|\| (.+?(?:(?:\|\| Uploaded by|$))?)(?:\|\| Uploaded by: (.*))?$'
vars:
- torrentName
- year
- releaseTags
- baseUrl
- torrentId
- tags
- uploader
match:
torrenturl: "{{ .baseUrl }}/torrent/{{ .torrentId }}/download/{{ .passkey }}"

View file

@ -25,17 +25,22 @@ export const codecs = [
"h265",
"x264",
"x265",
"h264 10-bit",
"h265 10-bit",
"x264 10-bit",
"x265 10-bit",
"XviD"
];
export const CODECS_OPTIONS = codecs.map(v => ({ value: v, label: v, key: v}));
export const sources = [
"WEB-DL",
"BluRay",
"BD5",
"BD9",
"BDr",
"BDRip",
"BluRay",
"BRRip",
"CAM",
"DVDR",
@ -48,7 +53,6 @@ export const sources = [
"HDTV",
"Mixed",
"SiteRip",
"WEB-DL",
"Webrip"
];