Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update heydouga.go #113

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions provider/heydouga/heydouga.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (hey *HeyDouga) GetMovieInfoByURL(rawURL string) (info *model.MovieInfo, er

// Cover
c.OnXML(`//section[@class="movie-player"]//script`, func(e *colly.XMLElement) {
if ss := regexp.MustCompile(`(?i)player_poster\s*=\s*'(http.+?)';`).FindStringSubmatch(e.Text); len(ss) == 2 {
if ss := regexp.MustCompile(`(?i)player_poster\s*=\s*'(\/.+?)';`).FindStringSubmatch(e.Text); len(ss) == 2 {
info.CoverURL = e.Request.AbsoluteURL(ss[1])
info.ThumbURL = info.CoverURL
}
Expand All @@ -111,18 +111,18 @@ func (hey *HeyDouga) GetMovieInfoByURL(rawURL string) (info *model.MovieInfo, er
// Fields
c.OnXML(`//*[@id="movie-info"]/ul/li`, func(e *colly.XMLElement) {
switch e.ChildText(`.//span[1]`) {
case "配信日:":
case "Release Date:":
info.ReleaseDate = parser.ParseDate(e.ChildText(`.//span[2]`))
case "主演:":
case "Actor:":
// heydouga's actor info is sticky, but whatever...
info.Actors = strings.Fields(e.ChildText(`.//span[2]`))
case "提供元:":
case "Provider:":
if info.Maker = strings.TrimSpace(e.ChildText(`.//span[2]/a[1]`)); info.Maker == "" /* fallback */ {
info.Maker = strings.TrimSpace(e.ChildText(`.//span[2]`))
}
case "動画再生時間:":
case "Movie Duration:":
info.Runtime = parser.ParseRuntime(e.ChildText(`.//span[2]`))
case "ファイル容量:", "画面サイズ:":
// case "ファイル容量:", "画面サイズ:":
// skip, do nothing
}
})
Expand Down
Loading