Skip to content

Commit

Permalink
Ensure timestamps are digits-only
Browse files Browse the repository at this point in the history
  • Loading branch information
jsvine committed Jan 18, 2023
1 parent 5f82eba commit 1da86a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_bad_statuses.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Test(unittest.TestCase):
def test_503(self):
asset = waybackpack.Asset(
"https://www.amazon.com/Art-Gathering-How-Meet-Matters/dp/1594634920",
timestamp=20190506092829,
timestamp="20190506092829",
)

content = asset.fetch()
Expand Down
2 changes: 2 additions & 0 deletions waybackpack/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

class Asset(object):
def __init__(self, original_url, timestamp):
# Ensure timestamp is only numeric
assert re.match(r"^\d*$", timestamp) is not None
self.timestamp = timestamp
self.original_url = original_url

Expand Down

0 comments on commit 1da86a0

Please sign in to comment.