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

Commite36e375

Browse files
authored
scraper: Fix for SLR Scraper ErrorFixes#1779 &#1815 (#1820)
* Fix for SLR Scraper ErrorThe Head request to check to ensure the image link was good didn't handle error. I have now added a switch that if it error out because of E.G DNS Resolution error it doesn't crash XBVR. Needs more testing has the conditions to cause the error are difficult to reproduce* Format* Delete slrstudios.go Woops* Format placed in the correct dir
1 parent4204175 commite36e375

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

‎pkg/scrape/slrstudios.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,25 @@ func SexLikeReal(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out
151151
if!isTransScene {
152152
appCover:=gjson.Get(JsonMetadataA,"thumbnailUrl").String()
153153
desktopCover:=strings.Replace(gjson.Get(JsonMetadataA,"thumbnailUrl").String(),"app","desktop",-1)
154-
desktopCresp,_:=http.Head(desktopCover)
155-
ifdesktopCresp.StatusCode==200 {
154+
desktopCresp,err:=http.Head(desktopCover)
155+
iferr!=nil {
156+
log.Errorf("Method Head Failed on desktopCover %s with error %s",desktopCover,err)
157+
}elseifdesktopCresp.StatusCode==200 {
156158
coverURL:=desktopCover
157159
sc.Covers=append(sc.Covers,coverURL)
158160
}else {
159-
appCresp,_:=http.Head(appCover)
160-
ifappCresp.StatusCode==200 {
161+
appCresp,err:=http.Head(appCover)
162+
iferr!=nil {
163+
log.Errorf("Method Head Failed on appCover %s with error %s",appCover,err)
164+
}elseifappCresp.StatusCode==200 {
161165
coverURL:=appCover
162166
sc.Covers=append(sc.Covers,coverURL)
163-
deferappCresp.Body.Close()
164167
}else {
165168
e.ForEach(`link[as="image"]`,func(idint,e*colly.HTMLElement) {
166169
sc.Covers=append(sc.Covers,e.Request.AbsoluteURL(e.Attr("href")))
167170
})
168171
}
172+
deferappCresp.Body.Close()
169173
}
170174
deferdesktopCresp.Body.Close()
171175
}else {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp