Skip to content

Commit

Permalink
crawl video sources
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cako committed May 17, 2023
1 parent 2ed325e commit bcc358c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crawl.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,12 @@ func Crawl(page string, outDir string, password string, skipExisting bool, skipA
}
})

c.OnHTML("source", func(e *colly.HTMLElement) {
if !Exists(e.Attr(("src"))) || !skipExisting {
e.Request.Visit(e.Attr(("src")))
}
})

c.OnHTML("audio", func(e *colly.HTMLElement) {
if !Exists(e.Attr(("src"))) || !skipExisting {
e.Request.Visit(e.Attr(("src")))
Expand Down

0 comments on commit bcc358c

Please sign in to comment.