HLN: podcasts

This commit is contained in:
Peter Kleiweg
2026-05-22 12:45:39 +02:00
parent 4f9284c6d6
commit 6d1dee6f3a

View File

@@ -228,9 +228,13 @@ func doArticle(filename string, url string, timestamp time.Time, needUpdate bool
special.Remove()
}
other, err := article.Search(`//*[@data-content-type="PODCAST"]`)
p(err)
hasOther := len(other) > 0
ell, err = article.Search(`//*[@data-content-type="PARAGRAPH"]`)
p(err)
if len(ell) == 0 {
if len(ell) == 0 && !hasOther {
_ = w(fmt.Errorf("no paragraphs: %s", url))
fp, err := os.Create(filename + ".err")
@@ -257,7 +261,9 @@ func doArticle(filename string, url string, timestamp time.Time, needUpdate bool
}
}
if !found {
_ = w(fmt.Errorf("no text, skipping: %s", url))
if !hasOther {
_ = w(fmt.Errorf("no text, skipping: %s", url))
}
fp, err := os.Create(filename + ".skip")
p(fp.WriteString(url + "\n"))
p(err)