# Buggy code
def __add_new_params__(self) -> str:
    query = {
        "aid": 1988,
        "app_name": "tiktok_web",
        "device_platform": "web",
        "referer": "",
        "user_agent": self.__format_new_params__(self.userAgent),
        "cookie_enabled": "true",
        "screen_width": self.width,
        "screen_height": self.height,
        "browser_language": self.browser_language,
        "browser_platform": self.browser_platform,
        "browser_name": self.browser_name,
        "browser_version": self.browser_version,
        "browser_online": "true",
        "ac": "4g",
        "timezone_name": self.timezone_name,
        "priority_region": "",
        "appId": 1233,
        "appType": "m",
        "isAndroid": False,
        "isMobile": False,
        "isIOS": False,
        "OS": "windows",
    }
    return urlencode(query)


# Traceback (json.decoder.JSONDecodeError)
api.byHashtag('love')

{'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.125 Safari/537.36', 'accept-encoding': 'gzip, deflate, br', 'accept': 'application/json, text/plain, */*', 'Connection': 'keep-alive', 'authority': 'm.tiktok.com', 'method': 'GET', 'path': '/share/item/list?aid=1988&amp;app_name=tiktok_web&amp;device_platform=web&amp;referer=&amp;user_agent=Mozilla%2F5.0+(Windows+NT+10.0%3B+Win64%3B+x64)+AppleWebKit%2F537.36+(KHTML,+like+Gecko)+Chrome%2F84.0.4147.125+Safari%2F537.36&amp;cookie_enabled=true&amp;screen_width=2560&amp;screen_height=1440&amp;browser_language=&amp;browser_platform=&amp;browser_name=&amp;browser_version=&amp;browser_online=true&amp;timezone_name=&amp;priority_region=&amp;appId=1233&amp;appType=m&amp;isAndroid=false&amp;isMobile=false&amp;isIOS=false&amp;OS=windows&amp;did=822148675&amp;region=US&amp;secUid=&amp;id=4231&amp;type=3&amp;count=30&amp;minCursor=0&amp;maxCursor=0&amp;shareUid=&amp;recType=&amp;lang=en&amp;verifyFp=AaN99VturDQ2&amp;_signature=_02B4Z6wo00f01SDv8tgAAIBB6rMaD8GoX..ZAABdw74', 'scheme': 'https', 'accept-language': 'en-US,en;q=0.9', 'referrer': 'https://www.tiktok.com/', 'sec-fetch-dest': 'empty', 'sec-fetch-mode': 'cors', 'sec-fetch-site': 'same-site'}
Converting response to JSON failed response is below (probably empty)
Traceback (most recent call last):
File "~/PycharmProjects/backup_scrapers/vevn/lib/python3.8/site-packages/TikTokApi/tiktok.py", line 85, in getData
return r.json()
File "~/PycharmProjects/backup_scrapers/vevn/lib/python3.8/site-packages/requests/models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "~/PycharmProjects/backup_scrapers/vevn/lib/python3.8/site-packages/TikTokApi/tiktok.py", line 357, in byHashtag
res = self.getData(api_url, b, proxy=proxy, language=language)
File "~/PycharmProjects/backup_scrapers/vevn/lib/python3.8/site-packages/TikTokApi/tiktok.py", line 91, in getData
raise Exception('Invalid Response')
Exception: Invalid Response

# Fixed code
def __add_new_params__(self) -> str:
    query = {
        "aid": 1988,
        "app_name": "tiktok_web",
        "device_platform": "web",
        "Referer": "",
        "user_agent": self.__format_new_params__(self.userAgent),
        "cookie_enabled": "true",
        "screen_width": self.width,
        "screen_height": self.height,
        "browser_language": self.browser_language,
        "browser_platform": self.browser_platform,
        "browser_name": self.browser_name,
        "browser_version": self.browser_version,
        "browser_online": "true",
        "ac": "4g",
        "timezone_name": self.timezone_name,
        "appId": 1233,
        "appType": "m",
        "isAndroid": False,
        "isMobile": False,
        "isIOS": False,
        "OS": "windows",
    }
    return urlencode(query)