Skip to content

Commit

Permalink
Added the ability to specify HTTP proxies in the Python API.
Browse files Browse the repository at this point in the history
  • Loading branch information
GrabzIt committed Jan 17, 2018
1 parent bb6c6b3 commit 16eaa71
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion python/GrabzIt/GrabzItBaseOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def __init__(self):
self.encryptionKey = ""
self.delay = 0
self.post = ""
self.proxy = ""

def _appendParameter(self, qs, name, value):
val = ""
Expand All @@ -40,4 +41,4 @@ def _appendParameter(self, qs, name, value):
return qs

def _createParameters(self, applicationKey, sig, callBackURL, dataName, dataValue):
return {"key":str(applicationKey), "country": str(self.country), "export": str(self.exportURL), "encryption": str(self.encryptionKey), "customid": str(self.customId), "callback": str(callBackURL), "sig": str(sig), str(dataName):str(dataValue)}
return {"key":str(applicationKey), "country": str(self.country), "export": str(self.exportURL), "encryption": str(self.encryptionKey), "proxy": str(self.proxy), "customid": str(self.customId), "callback": str(callBackURL), "sig": str(sig), str(dataName):str(dataValue)}
2 changes: 1 addition & 1 deletion python/GrabzIt/GrabzItDOCXOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ def _getSignatureString(self, applicationSecret, callBackURL, url = ''):
"|"+str(int(self.marginLeft))+"|"+str(int(self.marginBottom))+"|"+str(int(self.marginRight))+"|"+str(int(self.delay))+"|"+str(int(self.requestAs))+ \
"|"+str(self.country)+"|"+str(int(self.quality))+"|"+str(self.hideElement)+"|"+str(self.exportURL)+"|"+str(self.waitForElement)+\
"|"+str(self.encryptionKey)+"|"+str(int(self.noAds))+"|"+str(self.post)+"|"+str(self.targetElement)+"|"+str(self.templateId)+"|"+\
str(self.templateVariables)+"|"+str(int(self.pageHeight))+"|"+str(int(self.pageWidth))+"|"+str(int(self.browserWidth))
str(self.templateVariables)+"|"+str(int(self.pageHeight))+"|"+str(int(self.pageWidth))+"|"+str(int(self.browserWidth))+"|"+str(self.proxy)
1 change: 1 addition & 0 deletions python/GrabzIt/GrabzItException.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class GrabzItException(Exception):
PARAMETER_INVALID_TRANSPARENT_VALUE = 170
PARAMETER_INVALID_ENCRYPTION_KEY = 171
PARAMETER_INVALID_NO_ADS = 172
PARAMETER_INVALID_PROXY = 173
NETWORK_SERVER_OFFLINE = 200
NETWORK_GENERAL_ERROR = 201
NETWORK_DDOS_ATTACK = 202
Expand Down
2 changes: 1 addition & 1 deletion python/GrabzIt/GrabzItImageOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ def _getSignatureString(self, applicationSecret, callBackURL, url = ''):

return applicationSecret +"|"+ urlParam + callBackURLParam + \
"|"+str(self.format)+"|"+str(int(self.height))+"|"+str(int(self.width))+"|"+str(int(self.browserHeight))+"|"+str(int(self.browserWidth))+"|"+str(self.customId)+ \
"|"+str(int(self.delay))+"|"+str(self.targetElement)+"|"+str(self.customWaterMarkId)+"|"+str(int(self.requestAs))+"|"+str(self.country)+"|"+str(int(self.quality))+"|"+str(self.hideElement)+"|"+str(self.exportURL)+"|"+str(self.waitForElement)+"|"+str(int(self.transparent))+"|"+str(self.encryptionKey)+"|"+str(int(self.noAds))+"|"+str(self.post)
"|"+str(int(self.delay))+"|"+str(self.targetElement)+"|"+str(self.customWaterMarkId)+"|"+str(int(self.requestAs))+"|"+str(self.country)+"|"+str(int(self.quality))+"|"+str(self.hideElement)+"|"+str(self.exportURL)+"|"+str(self.waitForElement)+"|"+str(int(self.transparent))+"|"+str(self.encryptionKey)+"|"+str(int(self.noAds))+"|"+str(self.post)+"|"+str(self.proxy)

2 changes: 1 addition & 1 deletion python/GrabzIt/GrabzItPDFOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ def _getSignatureString(self, applicationSecret, callBackURL, url = ''):
"|"+str(int(self.marginLeft))+"|"+str(int(self.marginBottom))+"|"+str(int(self.marginRight))+"|"+str(int(self.delay))+"|"+str(int(self.requestAs))+ \
"|"+str(self.country)+"|"+str(int(self.quality))+"|"+str(self.templateId)+"|"+str(self.hideElement)+"|"+str(self.targetElement)+"|"+str(self.exportURL)+\
"|"+str(self.waitForElement)+"|"+str(self.encryptionKey)+"|"+str(int(self.noAds))+"|"+str(self.post)+"|"+str(int(self.browserWidth))+"|"+str(int(self.pageHeight))+\
"|"+str(int(self.pageWidth))+"|"+str(self.templateVariables)
"|"+str(int(self.pageWidth))+"|"+str(self.templateVariables)+"|"+str(self.proxy)
2 changes: 1 addition & 1 deletion python/GrabzIt/GrabzItTableOptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ def _getSignatureString(self, applicationSecret, callBackURL, url = ''):

return applicationSecret +"|"+ urlParam + callBackURLParam + \
"|"+str(self.customId)+"|"+str(int(self.tableNumberToInclude))+"|"+str(int(self.includeAllTables))+"|"+str(int(self.includeHeaderNames))+"|"+str(self.targetElement)+ \
"|"+str(self.format)+"|"+str(int(self.requestAs))+"|"+str(self.country)+"|"+str(self.exportURL)+"|"+str(self.encryptionKey)+"|"+str(self.post)
"|"+str(self.format)+"|"+str(int(self.requestAs))+"|"+str(self.country)+"|"+str(self.exportURL)+"|"+str(self.encryptionKey)+"|"+str(self.post)+"|"+str(self.proxy)

2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from distutils.core import setup

setup(name='GrabzIt',
version='3.2.6',
version='3.2.8',
author='GrabzIt',
author_email='[email protected]',
url='https://grabz.it/api/python/',
Expand Down

0 comments on commit 16eaa71

Please sign in to comment.