Allow more characters on names.

This commit is contained in:
kenkeiras 2017-07-05 01:04:10 +02:00
parent 42869cf410
commit 5c12e76cf9

View File

@ -12,7 +12,7 @@ from bs4 import BeautifulSoup as bs4
USER_AGENT = 'miniarchiver bot' USER_AGENT = 'miniarchiver bot'
ARCHIVE_ROOT = 'archive' ARCHIVE_ROOT = 'archive'
DEFAULT_NAME = 'archived_web' DEFAULT_NAME = 'archived_web'
ALLOWED_NAMES_RE = re.compile(r'^[- .,a-zA-Z0-9]+$') ALLOWED_NAMES_RE = re.compile(r'^[- .,:@a-zA-Z0-9]+$')
OBJECT_TYPE_DESCRIPTORS = ( OBJECT_TYPE_DESCRIPTORS = (
@ -149,7 +149,7 @@ def main():
path = os.path.join(ARCHIVE_ROOT, args.name) path = os.path.join(ARCHIVE_ROOT, args.name)
if not ALLOWED_NAMES_RE.match(args.name): if not ALLOWED_NAMES_RE.match(args.name):
print(("Only characters 'a-zA-Z0-9', spaces, dots, commas and dashes" print(("Only characters 'a-zA-Z0-9', spaces, or '-.,:@'"
"are allowed as names.")) "are allowed as names."))
return return