Skip to content

Commit

Permalink
Updated BadoinkVR scraper (#555)
Browse files Browse the repository at this point in the history
fixes to filename mainpulation (the slingionaire)
  • Loading branch information
theRealKLH authored Aug 16, 2021
1 parent d7c857f commit 263fc5a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/scrape/badoink.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,16 @@ func BadoinkSite(wg *sync.WaitGroup, updateSite bool, knownScenes []string, out

e.ForEach(`dl8-video source`, func(id int, e *colly.HTMLElement) {
if id == 0 {
origURL := e.Attr("src")

//This now needs to be made case insensitive (_trailer is now _Trailer)
origURLtmp := e.Attr("src")
origURL := strings.ToLower(origURLtmp)

// Some scenes had different trailer name "templates". Some videos didn't have trailers and one VRCosplayX (Death Note) was was missing "_" in the name
fpName3m := strings.Split(strings.Split(strings.Split(strings.Split(origURL, "_trailer")[0], "_3M")[0], "_3m")[0], "3M")[0]
fpName2m := strings.Split(strings.Split(strings.Split(fpName3m, "_trailer")[0], "_2M")[0], "_2m")[0]
fpName := strings.Split(strings.Split(strings.Split(fpName2m, "_trailer")[0], "_1M")[0], "_1m")[0]

fpName3m := strings.Split(strings.Split(strings.Split(origURL, "_trailer")[0], "_3m")[0], "3m")[0]
fpName2m := strings.Split(strings.Split(fpName3m, "_trailer")[0], "_2m")[0]
fpName := strings.Split(strings.Split(fpName2m, "_trailer")[0], "_1m")[0]

fragmentName := strings.Split(fpName, "/")
baseName := fragmentName[len(fragmentName)-1]
Expand Down

0 comments on commit 263fc5a

Please sign in to comment.