The lostfilm
library is a golang client to get episode`s torrent files from lostfilm.tv website.
go get github.com/bass3t/lostfilm
Create a client for processing connection to website.
lf, err := lostfilm.NewClient()
Before sending requests to server need be autorize on server.
err := lf.Login(userLogin, userPassword, nil)
Sometimes server request enter the captcha. If you can process this case, you need use the callback function. Captcha callback function gets the byte slice with captcha image and must return numeric recognized string with code.
cb := func(c []byte) string {
text, _ := recognizeCapture(c)
return text
}
err := lf.Login(userLogin, userPassword, cb)
Getting all serials from server.
serials, err := lf.GetAllSerials()
Getting serials may be specified with filters.
f := filter.Create()
f.Genre.Add(genre.Family)
serials, err := lf.GetSerials(filter)
Getting serial with alias (name). Alias is may be get form url of main page for serial https://www.lostfilm.tv/series/The_Serial_Alias
.
serial, err := lf.GetSerialByAlias("The_Serial_Alias")
Getting all episodes description for serial.
seasons, err := lf.GetSerialSeasons(serial)
Getting links for episode.
links, err := lf.GetEpisodeLinks(&episode)