2022-08-04 00:05:19 +02:00
|
|
|
package parsers
|
|
|
|
|
2022-08-15 16:43:27 +02:00
|
|
|
import "git.milar.in/nyaanime/model"
|
2022-08-04 00:05:19 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
how to get all torrent names on a nyaa page:
|
|
|
|
|
|
|
|
let s = "";
|
2022-08-15 16:43:27 +02:00
|
|
|
document.querySelectorAll("tr > td:nth-child(2) > a:not(.comments)").forEach(element => {
|
2022-08-04 00:05:19 +02:00
|
|
|
s += element.textContent + "\n";
|
|
|
|
})
|
|
|
|
console.log(s);
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
var Parsers = []model.Parser{
|
|
|
|
{
|
|
|
|
Identity: "Erai-Raws",
|
2022-08-04 18:13:41 +02:00
|
|
|
TorrentParser: regexTorrentParser(
|
|
|
|
`^\[Erai-raws\] (.*) - (.*?) \[(.*?)p\](?:\[HEVC\])?(?:\[Multiple Subtitle\])? (\[.*?\]+)?$`,
|
|
|
|
TorrentParseOptions{
|
2022-08-15 13:06:19 +02:00
|
|
|
Name: 1,
|
|
|
|
Episode: 2,
|
|
|
|
Resolution: 3,
|
|
|
|
Subtitles: 4,
|
|
|
|
SubtitleParser: SquareBracketsLanguageParser,
|
|
|
|
DefaultLanguages: []string{"ja"},
|
2022-08-04 18:13:41 +02:00
|
|
|
},
|
2022-08-04 00:05:19 +02:00
|
|
|
),
|
|
|
|
FileParser: nil,
|
|
|
|
},
|
2022-08-25 18:21:45 +02:00
|
|
|
|
|
|
|
{
|
|
|
|
Identity: "SubsPlease",
|
|
|
|
TorrentParser: regexTorrentParser(
|
|
|
|
`^\[SubsPlease\] (.*) - (\d+?) \((.*?)\) \[.*?\].mkv$`,
|
|
|
|
TorrentParseOptions{
|
|
|
|
Name: 1,
|
|
|
|
Episode: 2,
|
|
|
|
Resolution: 3,
|
|
|
|
DefaultLanguages: []string{"ja"},
|
|
|
|
DefaultSubtitles: []string{"en"},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
FileParser: nil,
|
|
|
|
},
|
2022-08-04 00:05:19 +02:00
|
|
|
}
|