diff --git a/.gitignore b/.gitignore index 789ef31..8cbdbf5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ test.py *.db ## user file -token_cache.bin +custom_plugins/microsoft_todo/token_cache.bin ### plugin file custom_plugins/* diff --git a/util/requests_with_proxy.py b/util/requests_with_proxy.py index c8e7e45..0708d7e 100644 --- a/util/requests_with_proxy.py +++ b/util/requests_with_proxy.py @@ -32,12 +32,13 @@ class RequestWithProxy: if self.__no_proxy: os.environ['NO_PROXY'] = ','.join(self.__no_proxy) - def get(self, url, headers=None): + def get(self, url, **kwargs): try: - if url.replace("https://", "").replace("http://", "").splice('/')[0] in self.__no_proxy: - r = requests.get(url=url, headers=headers) + if url.replace("https://", "").replace("http://", "").split('/')[0] in self.__no_proxy: + r = requests.get(url=url, **kwargs) else: - r = requests.get(url=url, headers=headers, proxies=self.__proxies) + kwargs['proxies'] = self.__proxies + r = requests.get(url=url, **kwargs) return r except: return None