fixed bug with len() of url()

This commit is contained in:
Daniel Valenzuela
2020-10-15 17:21:09 -04:00
parent 7cee69eea6
commit a44fbc75c8
2 changed files with 117 additions and 3 deletions

View File

@@ -80,9 +80,12 @@ class Url:
return "%s" % self.archive_url
def __len__(self):
diff = datetime.utcnow() - self.timestamp
return diff.days
if self.timestamp != None:
diff = datetime.utcnow() - self.timestamp
return diff.days
else
return None
def _url_check(self):
"""Check for common URL problems."""
if "." not in self.url: