No need to fetch archive_url and timestamp from availability API on init.

Not useful if all I want is to archive a page
This commit is contained in:
Akash Mahanty
2021-01-01 19:39:19 +05:30
committed by GitHub
parent 0b71433667
commit 8d29d1e516

View File

@@ -64,8 +64,6 @@ class Url:
self.url = url
self.user_agent = user_agent
self._url_check() # checks url validity on init.
self.archive_url = self._archive_url() # URL of archive
self.timestamp = self._archive_timestamp() # timestamp for last archive
self._alive_url_list = []
def __repr__(self):
@@ -97,7 +95,8 @@ class Url:
response = _get_response(endpoint, params=payload, headers=headers)
return response.json()
def _archive_url(self):
@property
def archive_url(self):
"""Get URL of archive."""
data = self.JSON
@@ -111,7 +110,8 @@ class Url:
return archive_url
def _archive_timestamp(self):
@property
def timestamp(self):
"""Get timestamp of last archive."""
data = self.JSON