Update wrapper.py
This commit is contained in:
parent
f03a9e786e
commit
5f73504beb
@ -1,18 +1,19 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from urllib.request import Request, urlopen
|
from urllib.request import Request, urlopen
|
||||||
import urllib.error
|
import urllib.error
|
||||||
|
|
||||||
# YYYYMMDDhhmmss
|
|
||||||
|
|
||||||
class TooManyArchivingRequestsError(Exception):
|
class TooManyArchivingRequestsError(Exception):
|
||||||
"""An error when a single url is archived multiple times in a short timespam.
|
"""Error when a single url reqeusted for archiving too many times in a short timespam.
|
||||||
Wayback machine doesn't supports archivng any url too many times in a short period of time.
|
Wayback machine doesn't supports archivng any url too many times in a short period of time.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class ArchivingNotAllowed(Exception):
|
class ArchivingNotAllowed(Exception):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def save(url,UA="pywayback python module"):
|
def save(url,UA="pywayback python module"):
|
||||||
base_save_url = "https://web.archive.org/save/"
|
base_save_url = "https://web.archive.org/save/"
|
||||||
request_url = base_save_url + url
|
request_url = base_save_url + url
|
||||||
|
Loading…
Reference in New Issue
Block a user