@@ -27,7 +27,7 @@ class SearchModifiers(Enum):
27
27
class HTMLRequests :
28
28
BASE_URL = 'https://howlongtobeat.com/'
29
29
REFERER_HEADER = BASE_URL
30
- SEARCH_URL = BASE_URL + "api/find "
30
+ SEARCH_URL = BASE_URL + "api/lookup "
31
31
GAME_URL = BASE_URL + "game"
32
32
33
33
@staticmethod
@@ -116,7 +116,7 @@ def send_web_request(game_name: str, search_modifiers: SearchModifiers = SearchM
116
116
if api_key_result is None :
117
117
api_key_result = HTMLRequests .send_website_request_getcode (True )
118
118
# Make the request
119
- # The main method currently is the call to api/find /key
119
+ # The main method currently is the call to api/lookup /key
120
120
search_url_with_key = HTMLRequests .SEARCH_URL + "/" + api_key_result
121
121
payload = HTMLRequests .get_search_request_data (game_name , search_modifiers , page , None )
122
122
resp = requests .post (search_url_with_key , headers = headers , data = payload , timeout = 60 )
@@ -145,7 +145,7 @@ async def send_async_web_request(game_name: str, search_modifiers: SearchModifie
145
145
if api_key_result is None :
146
146
api_key_result = await HTMLRequests .async_send_website_request_getcode (True )
147
147
# Make the request
148
- # The main method currently is the call to api/find /key
148
+ # The main method currently is the call to api/lookup /key
149
149
search_url_with_key = HTMLRequests .SEARCH_URL + "/" + api_key_result
150
150
payload = HTMLRequests .get_search_request_data (game_name , search_modifiers , page , None )
151
151
async with aiohttp .ClientSession () as session :
@@ -253,8 +253,8 @@ def extract_api_from_script(script_content: str):
253
253
if matches :
254
254
key = '' .join (matches )
255
255
return key
256
- # Test 2 - The API Key is in format fetch("/api/find /".concat("X").concat("Y")...
257
- concat_api_key_pattern = r'\/api\/find \/"(?:\.concat\("[^"]*"\))*'
256
+ # Test 2 - The API Key is in format fetch("/api/lookup /".concat("X").concat("Y")...
257
+ concat_api_key_pattern = r'\/api\/lookup \/"(?:\.concat\("[^"]*"\))*'
258
258
matches = re .findall (concat_api_key_pattern , script_content )
259
259
if matches :
260
260
matches = str (matches ).split ('.concat' )
@@ -267,7 +267,7 @@ def extract_api_from_script(script_content: str):
267
267
@staticmethod
268
268
def send_website_request_getcode (parse_all_scripts : bool ):
269
269
"""
270
- Function that send a request to howlongtobeat to scrape the /api/find key
270
+ Function that send a request to howlongtobeat to scrape the /api/lookup key
271
271
@return: The string key to use
272
272
"""
273
273
# Make the post request and return the result if is valid
@@ -294,7 +294,7 @@ def send_website_request_getcode(parse_all_scripts: bool):
294
294
@staticmethod
295
295
async def async_send_website_request_getcode (parse_all_scripts : bool ):
296
296
"""
297
- Function that send a request to howlongtobeat to scrape the /api/find key
297
+ Function that send a request to howlongtobeat to scrape the /api/lookup key
298
298
@return: The string key to use
299
299
"""
300
300
# Make the post request and return the result if is valid
0 commit comments