lstrip '-' to avoid creating filenames that must be --'ed or quoted

This commit is contained in:
Ivan Kozik 2015-12-17 16:54:55 +00:00
parent 495beca32a
commit 2acc826d56
2 changed files with 2 additions and 2 deletions

View File

@ -1 +1 @@
__version__ = '0.9.8'
__version__ = '0.9.9'

View File

@ -156,7 +156,7 @@ id, dir, finished_warc_dir):
id = binascii.hexlify(os.urandom(16)).decode('utf-8')
ymd = datetime.datetime.utcnow().isoformat()[:10]
no_proto_no_trailing = claim_start_url.split('://', 1)[1].rstrip('/')[:100]
warc_name = "{}-{}-{}".format(re.sub('[^-_a-zA-Z0-9%\.,;@+=]', '-', no_proto_no_trailing), ymd, id[:8])
warc_name = "{}-{}-{}".format(re.sub('[^-_a-zA-Z0-9%\.,;@+=]', '-', no_proto_no_trailing).lstrip('-'), ymd, id[:8])
# make absolute because wpull will start in temp/
if not dir: