Adding Regex to remove (Author) from LP names
This commit is contained in:
parent
83ccd79db3
commit
5deb41b6f1
|
@ -9,6 +9,7 @@ type Config struct {
|
||||||
DatabaseConnection string
|
DatabaseConnection string
|
||||||
EpisodeRegex string
|
EpisodeRegex string
|
||||||
RemoveRegex string
|
RemoveRegex string
|
||||||
|
LPRenameRegex string
|
||||||
YoutubeKey string
|
YoutubeKey string
|
||||||
GronkhUrl string
|
GronkhUrl string
|
||||||
ImageDirectory string
|
ImageDirectory string
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
"EpisodeRegex": "^(?:Folge |Folge |Special |Folge S01E|Folge ß|Folge ESIDENT EVIL REVELATIONS 2 \\[|Folge #|Folge 1 – Galaktischer Krie\\: |Folge 15; Zurück in der neuen Wel\\: |Folge 6½ \\[German\\] – Dr\\. Kleiners Vortra\\: |Folge ESIDENT EVIL REVELATIONS 2 \\[)([0-9]+)(?:½\\: |\\: | – |; |\\.5\\: |½ \\[German\\] – | Verwirrspiele & Hinterhalt\\: 18 |] |\\. KIPPLASTER RACING Schwadro\\: 95\\. |[,.][0-9a-zA-Z]+\\: | Titanenlord Ursego\\: 41 |[a-zA-Z]\\: )",
|
"EpisodeRegex": "^(?:Folge |Folge |Special |Folge S01E|Folge ß|Folge ESIDENT EVIL REVELATIONS 2 \\[|Folge #|Folge 1 – Galaktischer Krie\\: |Folge 15; Zurück in der neuen Wel\\: |Folge 6½ \\[German\\] – Dr\\. Kleiners Vortra\\: |Folge ESIDENT EVIL REVELATIONS 2 \\[)([0-9]+)(?:½\\: |\\: | – |; |\\.5\\: |½ \\[German\\] – | Verwirrspiele & Hinterhalt\\: 18 |] |\\. KIPPLASTER RACING Schwadro\\: 95\\. |[,.][0-9a-zA-Z]+\\: | Titanenlord Ursego\\: 41 |[a-zA-Z]\\: )",
|
||||||
"RemoveRegex": "^(?:Folge Special\\: |Folge special\\: | – Let’s Play [1080][PS4\\: SIDENT EVIL REVELATIONS 2 [23] Getrennt..! – Let’s Play [1080][PS4]|Folge pecial\\: )",
|
"RemoveRegex": "^(?:Folge Special\\: |Folge special\\: | – Let’s Play [1080][PS4\\: SIDENT EVIL REVELATIONS 2 [23] Getrennt..! – Let’s Play [1080][PS4]|Folge pecial\\: )",
|
||||||
|
"LPRenameRegex": "^(?:\\(Gronkh|Sarazar|Amras|Trashtazmani|Honeyball|TrueMG|Rahmschnitzel|LookslikeLink|Suishomaru|HerrDekay|Hijuga|Zombey\\))",
|
||||||
"YoutubeKey": "FOOOBAAAARRRRRRR",
|
"YoutubeKey": "FOOOBAAAARRRRRRR",
|
||||||
"DatabaseConnection": "host=localhost user=gronkhde dbname=gronkhde sslmode=disable",
|
"DatabaseConnection": "host=localhost user=gronkhde dbname=gronkhde sslmode=disable",
|
||||||
"GronkhUrl": "http://5.62.67.8",
|
"GronkhUrl": "http://5.62.67.8",
|
||||||
|
|
|
@ -57,6 +57,7 @@ func ParseLPPage(gslug string, LP *database.LetsPlay) {
|
||||||
}
|
}
|
||||||
|
|
||||||
LP.Name.String = doc.Find("h1 > a > strong").First().Text()
|
LP.Name.String = doc.Find("h1 > a > strong").First().Text()
|
||||||
|
LP.Name.String = lpRenameRegex.ReplaceAllString(LP.Name.String, "")
|
||||||
|
|
||||||
pos, _ := doc.Find(".lightbox").Attr("href")
|
pos, _ := doc.Find(".lightbox").Attr("href")
|
||||||
LP.PosterS.String, LP.PosterB.String, err = image.ResizeCover(pos)
|
LP.PosterS.String, LP.PosterB.String, err = image.ResizeCover(pos)
|
||||||
|
|
|
@ -13,6 +13,7 @@ import (
|
||||||
var conf config.Config
|
var conf config.Config
|
||||||
var episodeRegex *regexp.Regexp
|
var episodeRegex *regexp.Regexp
|
||||||
var removeRegex *regexp.Regexp
|
var removeRegex *regexp.Regexp
|
||||||
|
var lpRenameRegex *regexp.Regexp
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -30,6 +31,7 @@ func main() {
|
||||||
}
|
}
|
||||||
episodeRegex = regexp.MustCompile(config.C.EpisodeRegex)
|
episodeRegex = regexp.MustCompile(config.C.EpisodeRegex)
|
||||||
removeRegex = regexp.MustCompile(config.C.RemoveRegex)
|
removeRegex = regexp.MustCompile(config.C.RemoveRegex)
|
||||||
|
lpRenameRegex = regexp.MustCompile(config.C.LPRenameRegex)
|
||||||
|
|
||||||
if err = os.MkdirAll(config.C.ImageDirectory, 0775); err != nil {
|
if err = os.MkdirAll(config.C.ImageDirectory, 0775); err != nil {
|
||||||
log.Fatalf("FAT Could not create ImageDirectory, error: %+v", err)
|
log.Fatalf("FAT Could not create ImageDirectory, error: %+v", err)
|
||||||
|
|
Loading…
Reference in a new issue