Skip to content

Commit

Permalink
fix(hltb): Update search URL to /s (#31)
Browse files Browse the repository at this point in the history
* fix(hltb): Update search URL to /lookup

* fix(hltb): Update search URL to /s

---------

Co-authored-by: Christian Munteanu <christian.munteanu@svs.at [credential http://proxy.svdgmbh.at:8062/]>
Co-authored-by: DareFox <47672780+DareFox@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 22, 2025
1 parent 59dfc53 commit c3bdee4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hltb-scraping/src/main/kotlin/HLTB.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ object HLTB {
var keyIsNotUpdated = true
lateinit var response: Response
while (true) {
val request = Request(POST, "https://howlongtobeat.com/api/find/${getSearchKey()}")
val request = Request(POST, "https://howlongtobeat.com/api/s/${getSearchKey()}")
.hltbJsonRequest(url, queryObj)
val call = httpClient(request)

Expand Down Expand Up @@ -151,7 +151,7 @@ object HLTB {
}

private fun findKeyInScripts(scripts: Sequence<String>): String {
val fetchLineRegex = "(?<=api/find/).*?,".toRegex()
val fetchLineRegex = "(?<=api/s/).*?,".toRegex()
val concatValuesRegex = "(?<=concat\\(\").*?(?=\")".toRegex()
for (script in scripts) {
val fetchLine = fetchLineRegex.find(script) ?: continue
Expand Down

0 comments on commit c3bdee4

Please sign in to comment.