howlongtobeatpy/howlongtobeatpy/HTMLRequests.py
async def send_async_web_request(game_name: str, search_modifiers: SearchModifiers = SearchModifiers.NONE):
        """
        Function that search the game using an async request
        @param game_name: The original game name received as input
        @param search_modifiers: The "Modifiers" list in "Search Options", allow to show/isolate/hide DLCs
        @return: The HTML code of the research if the request returned 200(OK), None otherwise
        """
        ua = UserAgent()
        headers = {
            'content-type': 'application/x-www-form-urlencoded',
            'accept': '*/*',
            'User-Agent': ua.random
        }
        payload = {
            'queryString': game_name,
            't': 'games',
            'sorthead': 'popular',
            'sortd': 'Normal Order',
            'plat': '',
            'length_type': 'main',
            'length_min': '',
            'length_max': '',
            'detail': search_modifiers.value
        }
        # Make the post request and return the result if is valid
        async with aiohttp.ClientSession() as session:
            async with session.post(HTMLRequests.SEARCH_URL, data=payload, headers=headers) as resp:
                if resp is not None and str(resp.status) == "200":
                    return await resp.text()
                else:
                    return None

        Function that search the game using an async request
        @param game_name: The original game name received as input
        @param search_modifiers: The "Modifiers" list in "Search Options", allow to show/isolate/hide DLCs
        @return: The HTML code of the research if the request returned 200(OK), None otherwise
        
Function that search the game using an async request
Function that search the game using an async request
async def send_async_web_request(game_name: str, search_modifiers: SearchModifiers = SearchModifiers.NONE):
        ua = UserAgent()
        headers = {
            'content-type': 'application/x-www-form-urlencoded',
            'accept': '*/*',
            'User-Agent': ua.random
        }
        payload = {
            'queryString': game_name,
            't': 'games',
            'sorthead': 'popular',
            'sortd': 'Normal Order',
            'plat': '',
            'length_type': 'main',
            'length_min': '',
            'length_max': '',
            'detail': search_modifiers.value
        }
        async with aiohttp.ClientSession() as session:
            async with session.post(HTMLRequests.SEARCH_URL, data=payload, headers=headers) as resp:
                if resp is not None and str(resp.status) == "200":
                    return await resp.text()
                else:
                    return None
async def send_async_web_request ( game_name : str , search_modifiers : SearchModifiers = SearchModifiers . NONE ) : ua = UserAgent ( ) headers = { 'content-type' : 'application/x-www-form-urlencoded' , 'accept' : '*/*' , 'User-Agent' : ua . random } payload = { 'queryString' : game_name , 't' : 'games' , 'sorthead' : 'popular' , 'sortd' : 'Normal Order' , 'plat' : '' , 'length_type' : 'main' , 'length_min' : '' , 'length_max' : '' , 'detail' : search_modifiers . value } async with aiohttp . ClientSession ( ) as session : async with session . post ( HTMLRequests . SEARCH_URL , data = payload , headers = headers ) as resp : if resp is not None and str ( resp . status ) == "200" : return await resp . text ( ) else : return None
Function that search the game using an async request
Function that search the game using an async request
"""
        Function that search the game using an async request
        @param game_name: The original game name received as input
        @param search_modifiers: The "Modifiers" list in "Search Options", allow to show/isolate/hide DLCs
        @return: The HTML code of the research if the request returned 200(OK), None otherwise
        """ # Make the post request and return the result if is valid
The HTML code of the research if the request returned 200(OK), None otherwise
The HTML code of the research if the request returned 200 ( OK ) None otherwise
game_name
str
The original game name received as input
The original game name received as input
search_modifiers
SearchModifiers
The "Modifiers" list in "Search Options", allow to show/isolate/hide DLCs
The " Modifiers " list in " Search Options " allow to show / isolate / hide DLCs