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

Commit17958d0

Browse files
authored
scraper: Fix VirtualTaboo scraper (#1781)
1 parente81cfbc commit17958d0

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

‎pkg/scrape/virtualtaboo.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ func VirtualTaboo(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out
3434
sc.HomepageURL=strings.Split(e.Request.URL.String(),"?")[0]
3535

3636
// Scene ID - get from URL
37-
e.ForEach(`#player`,func(idint,e*colly.HTMLElement) {
38-
sc.SiteID=strings.Split(e.Attr("data-poster-index"),":")[0]
39-
sc.SceneID=slugify.Slugify(sc.Site)+"-"+sc.SiteID
37+
e.ForEach(`script`,func(idint,e*colly.HTMLElement) {
38+
ifstrings.Contains(e.Text,"var video =") {
39+
r:=regexp.MustCompile(`id: (\d+),`)
40+
m:=r.FindStringSubmatch(e.Text)
41+
iflen(m)>0 {
42+
sc.SiteID=m[1]
43+
sc.SceneID=slugify.Slugify(sc.Site)+"-"+sc.SiteID
44+
}
45+
}
4046
})
4147

4248
// Title
@@ -107,7 +113,9 @@ func VirtualTaboo(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out
107113
sc.Duration=tmpDuration
108114
})
109115

110-
out<-sc
116+
ifsc.SiteID!="" {
117+
out<-sc
118+
}
111119
})
112120

113121
siteCollector.OnHTML(`ul.pagination a`,func(e*colly.HTMLElement) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp