Skip to content

Commit

Permalink
scraper: changed URL for ThePornDB (#1686)
Browse files Browse the repository at this point in the history
Co-authored-by: crwxaj <crwxaj>
  • Loading branch information
crwxaj authored Apr 2, 2024
1 parent dfc27a4 commit 2aef8bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/scrape/tpdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ func ScrapeTPDB(knownScenes []string, out *[]models.ScrapedScene, apiToken strin
sc.SceneType = "VR"

// We accept 2 scene URL syntaxes:
// https://metadataapi.net/scenes/scene-title-1
// https://theporndb.net/scenes/scene-title-1
// or
// https://api.metadataapi.net/scenes/scene-title-1
re := regexp.MustCompile("metadataapi.net/scenes/(.+)")
// https://api.theporndb.net/scenes/scene-title-1
re := regexp.MustCompile("theporndb.net/scenes/(.+)")
subMatches := re.FindStringSubmatch(sceneUrl)
if subMatches == nil || len(subMatches) != 2 {
return errors.New("TPDB Url is malformed")
}

r, _ := resty.New().R().
SetAuthToken(apiToken).
Get(fmt.Sprintf("https://api.metadataapi.net/scenes/%v", subMatches[1]))
Get(fmt.Sprintf("https://api.theporndb.net/scenes/%v", subMatches[1]))

tpdbMetadata := r.String()

Expand Down

0 comments on commit 2aef8bb

Please sign in to comment.