Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit631a3e3

Browse files
authored
scraper: Changed VRSpy Scene Id logic. (#1839)
1 parent32b9776 commit631a3e3

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

‎pkg/scrape/vrspy.go

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,26 @@ func VRSpy(wg *models.ScrapeWG, updateSite bool, knownScenes []string, out chan<
3737
sc.Site=siteID
3838
sc.HomepageURL=e.Request.URL.String()
3939

40-
ogimage:=e.ChildAttr(`meta[property="og:image"][content*="cover.jpg"]`,"content")
41-
ifogimage!="" {
42-
ogimageURL,err:=url.Parse(ogimage)
43-
iferr==nil {
44-
parts:=strings.Split(ogimageURL.Path,"/")
45-
iflen(parts)>2 {
46-
sc.SiteID=parts[2]
40+
e.ForEach(`meta[property="og:image"][content*="vrspy.com/videos"]`,func(idint,e*colly.HTMLElement) {
41+
ifsc.SiteID=="" {
42+
ogimage:=e.Attr("content")
43+
ifogimage!="" {
44+
ogimageURL,err:=url.Parse(ogimage)
45+
iferr==nil {
46+
parts:=strings.Split(ogimageURL.Path,"/")
47+
iflen(parts)>2 {
48+
_,err:=strconv.Atoi(parts[2])
49+
iferr==nil {
50+
sc.SiteID=parts[2]
51+
}
52+
}
53+
}
4754
}
4855
}
49-
}
56+
})
5057

5158
ifsc.SiteID=="" {
59+
log.Infof("Unable to determine a Scene Id for %s",e.Request.URL)
5260
return
5361
}
5462

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp