summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/tracking.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/tracking.py b/modules/tracking.py
index 2b0ddd7..957bf62 100755
--- a/modules/tracking.py
+++ b/modules/tracking.py
@@ -182,7 +182,8 @@ class FedexModule(TrackingModule):
data = {'TrackPackagesRequest': {'appType': 'wtrk', 'uniqueKey': '', 'processingParameters': {'anonymousTransaction': True, 'clientId': 'WTRK', 'returnDetailedErrors': True, 'returnLocalizedDateTime': False}, 'trackingInfoList': [{'trackNumberInfo': {'trackingNumber': code, 'trackingQualifier': '', 'trackingCarrier': ''}}]}}
url = 'https://www.fedex.com/trackingCal/track?' + urllib.urlencode({'data': json.dumps(data), 'action': 'trackpackages', 'locale': 'en_US', 'format': 'json', 'version': 99})
try:
- u = urllib2.urlopen(url)
+ request = urllib2.Request(url, headers = {'User-Agent': 'fot'})
+ u = urllib2.urlopen(request)
except urllib2.HTTPError as e:
raise PackageError(str(e))
data = u.read()