mirror of
https://codeberg.org/scip/kleingebaeck.git
synced 2026-11-23 06:59:00 +01:00
Fix scraping multiple ads (#126)
Upstream has changed their content generation system. When using the same http client, the first page looks as we expect it, but subsequent pages look totally different. I can't find out why that is, but it's not an issue of this tool. So, the "fix" is to abandon client reuse and re-initialize a new client for every http request. However, the image fetcher keeps resusing the client. Co-authored-by: Thomas von Dein <tom@vondein.org> Reviewed-on: https://codeberg.org/scip/kleingebaeck/pulls/126
This commit is contained in:
@@ -34,7 +34,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
VERSION string = "0.3.24"
|
||||
VERSION string = "0.3.25"
|
||||
Baseuri string = "https://www.kleinanzeigen.de"
|
||||
Listuri string = "/s-bestandsliste.html"
|
||||
Defaultdir string = "."
|
||||
@@ -140,7 +140,7 @@ func InitConfig(output io.Writer) (*Config, error) {
|
||||
}
|
||||
|
||||
// Load default values using the confmap provider.
|
||||
if err := kloader.Load(confmap.Provider(map[string]interface{}{
|
||||
if err := kloader.Load(confmap.Provider(map[string]any{
|
||||
"template": template,
|
||||
"outdir": DefaultOutdirTemplate,
|
||||
"loglevel": "notice",
|
||||
@@ -200,7 +200,6 @@ func InitConfig(output io.Writer) (*Config, error) {
|
||||
// Load the config file[s]
|
||||
for _, cfgfile := range configfiles {
|
||||
path, err := os.Stat(cfgfile)
|
||||
|
||||
if err != nil {
|
||||
// ignore non-existent files, but bail out on any other errors
|
||||
if !os.IsNotExist(err) {
|
||||
|
||||
Reference in New Issue
Block a user