Skip to content

Commit fdafd73

Browse files
author
proxycrawl
committed
Adds custom timeout option
1 parent a38c9e6 commit fdafd73

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ print(response['headers']['pc_status'])
119119

120120
If you have questions or need help using the library, please open an issue or [contact us](https://proxycrawl.com/contact).
121121

122+
## Custom timeout
123+
124+
If you need to use a custom timeout, you can pass it to the class instance creation like the following:
125+
126+
```python
127+
api = ProxyCrawlAPI({ 'token': 'TOKEN', 'timeout': 120 })
128+
```
129+
130+
Timeout is in seconds.
131+
122132
---
123133

124134
Copyright 2020 ProxyCrawl

proxycrawl/proxycrawl_api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ class ProxyCrawlAPI:
3737
def __init__(self, options):
3838
if options['token'] is None or options['token'] == '':
3939
raise Exception('You need to specify the token')
40+
if 'timeout' in options:
41+
self.timeout = options['timeout']
4042
self.options = options
4143
self.endPointUrl = PROXYCRAWL_API_URL + '?token=' + options['token']
4244

0 commit comments

Comments
 (0)