RSS logging, extra title information processing
This commit is contained in:
parent
59a7231224
commit
7b32722607
22
main.go
22
main.go
@ -156,12 +156,23 @@ func GetRSS(rssURL string) ([]Anime, error) {
|
|||||||
return animes, e.If(err).Then(func() {
|
return animes, e.If(err).Then(func() {
|
||||||
for _, item := range feed.Items {
|
for _, item := range feed.Items {
|
||||||
title := strings.Split(item.Title, "[Magnet] ")[1]
|
title := strings.Split(item.Title, "[Magnet] ")[1]
|
||||||
title = strings.Split(title, " [1080p]")[0]
|
if strings.Contains(title, "(HEVC)") {
|
||||||
if title[len(title)-6:] != "(HEVC)" {
|
title = strings.Split(title, " (HEVC)")[0]
|
||||||
|
} else {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
title = title[:len(title)-7]
|
|
||||||
|
var newVersion bool
|
||||||
|
if strings.Contains(title, "(AAC 2.0)") {
|
||||||
|
title = strings.Split(title, " (AAC 2.0)")[0]
|
||||||
|
} else if strings.Contains(title, "(Repack)") {
|
||||||
|
newVersion = true
|
||||||
|
title = strings.Split(title, " (Repack)")[0]
|
||||||
|
}
|
||||||
anime := NewAnime(item.Link)
|
anime := NewAnime(item.Link)
|
||||||
|
if newVersion {
|
||||||
|
anime.Version += 1
|
||||||
|
}
|
||||||
e.LogIf(anime.InfoFromTitle(title))
|
e.LogIf(anime.InfoFromTitle(title))
|
||||||
animes = append(animes, anime)
|
animes = append(animes, anime)
|
||||||
}
|
}
|
||||||
@ -204,6 +215,8 @@ func GetAllAvailable(name string) ([]Anime, error) {
|
|||||||
title = strings.Split(title, "[Erai-raws] ")[1]
|
title = strings.Split(title, "[Erai-raws] ")[1]
|
||||||
if strings.Contains(title, "(AAC 2.0)") {
|
if strings.Contains(title, "(AAC 2.0)") {
|
||||||
title = strings.Split(title, " (AAC 2.0)")[0]
|
title = strings.Split(title, " (AAC 2.0)")[0]
|
||||||
|
} else if strings.Contains(title, "(Repack)") {
|
||||||
|
title = strings.Split(title, " (Repack)")[0]
|
||||||
} else {
|
} else {
|
||||||
title = strings.Split(title, " [1080p]")[0]
|
title = strings.Split(title, " [1080p]")[0]
|
||||||
}
|
}
|
||||||
@ -298,10 +311,11 @@ func NewDaemon(server string, polling int, download string, socket net.Listener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (d *Daemon) Serve() {
|
func (d *Daemon) Serve() {
|
||||||
//d.CheckRSS()
|
d.CheckRSS()
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-time.After(d.PollingRate * time.Minute):
|
case <-time.After(d.PollingRate * time.Minute):
|
||||||
|
e.Log("Checking RSS", LogStd())
|
||||||
d.CheckRSS()
|
d.CheckRSS()
|
||||||
case <-time.After(10 * time.Second):
|
case <-time.After(10 * time.Second):
|
||||||
d.CheckTorrents()
|
d.CheckTorrents()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user