mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Fix scraping error (#704)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package scraper
|
package scraper
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -65,7 +66,14 @@ func loadURL(url string, scraperConfig config, globalConfig GlobalConfig) (io.Re
|
|||||||
}
|
}
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
return charset.NewReader(resp.Body, resp.Header.Get("Content-Type"))
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
bodyReader := bytes.NewReader(body)
|
||||||
|
|
||||||
|
return charset.NewReader(bodyReader, resp.Header.Get("Content-Type"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// func urlFromCDP uses chrome cdp and DOM to load and process the url
|
// func urlFromCDP uses chrome cdp and DOM to load and process the url
|
||||||
|
|||||||
Reference in New Issue
Block a user