From 233b6c71e3dbeb16ca15bf3a26d10f4954e5b3e8 Mon Sep 17 00:00:00 2001 From: davidteather Date: Wed, 19 Aug 2020 14:42:34 -0500 Subject: [PATCH] Fix #216 --- TikTokApi/tiktok.py | 28 +++++++++++++++++++++------- setup.py | 2 +- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/TikTokApi/tiktok.py b/TikTokApi/tiktok.py index d32a6665..c1ab96cf 100644 --- a/TikTokApi/tiktok.py +++ b/TikTokApi/tiktok.py @@ -21,13 +21,27 @@ def __init__(self, debug=False, request_delay=None): # Get Browser Params b = browser('newParam', newParams=True) - self.timezone_name = self.__format_new_params__(b.timezone_name) - self.browser_language = self.__format_new_params__(b.browser_language) - self.browser_platform = self.__format_new_params__(b.browser_platform) - self.browser_name = self.__format_new_params__(b.browser_name) - self.browser_version = self.__format_new_params__(b.browser_version) - self.width = b.width - self.height = b.height + try: + self.timezone_name = self.__format_new_params__(b.timezone_name) + self.browser_language = self.__format_new_params__(b.browser_language) + self.browser_platform = self.__format_new_params__(b.browser_platform) + self.browser_name = self.__format_new_params__(b.browser_name) + self.browser_version = self.__format_new_params__(b.browser_version) + self.width = b.width + self.height = b.height + except Exception as e: + if debug: + print("The following error occurred, but it was ignored.") + print(e) + + self.timezone_name = "" + self.browser_language = "" + self.browser_platform = "" + self.browser_name = "" + self.browser_version = "" + self.width = "1920" + self.height = "1080" + self.request_delay = request_delay diff --git a/setup.py b/setup.py index c7f24592..45d5ce97 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name = 'TikTokApi', packages = ['TikTokApi'], - version = '3.4.2', + version = '3.4.3', license='MIT', description = 'The Unofficial TikTok API Wrapper in Python 3.', author = 'David Teather',