aboutsummaryrefslogtreecommitdiffstats
path: root/dtube/dtube.py
diff options
context:
space:
mode:
Diffstat (limited to 'dtube/dtube.py')
-rwxr-xr-xdtube/dtube.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/dtube/dtube.py b/dtube/dtube.py
index 7261ef5..7cc7a5f 100755
--- a/dtube/dtube.py
+++ b/dtube/dtube.py
@@ -104,14 +104,14 @@ class He:
self.html = requests.get(url, headers=He.url_headers)
if self.verbose: print self.html.status_code
if not self.html.ok:
- if self.html.status_code == 404:
- raise Exception("Target not found")
self.html.raise_for_status()
self.tree = etree.HTML(self.html.content)
if not getattr(self.html, 'from_cache', False):
time.sleep(random.random() * 3) # Forced to be kind
if self.verbose and self.html.from_cache:
print "Response from cache"
+ if re.search(r'ERROR: .* Not Found', self.tree.xpath('//title')[0].text):
+ raise Exception("Target not found")
class HeAS(He):
url_prefix = '/AS'