From b77476cb83742d479b2d63054a0d838e19a69fae Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Fri, 11 Jan 2019 19:53:47 -0500 Subject: [PATCH] fix user agent quoting --- archivebox/archive_methods.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/archivebox/archive_methods.py b/archivebox/archive_methods.py index 32fb0bfe..7beaeaca 100644 --- a/archivebox/archive_methods.py +++ b/archivebox/archive_methods.py @@ -212,7 +212,7 @@ def fetch_wget(link_dir, link, requisites=FETCH_WGET_REQUISITES, timeout=TIMEOUT # WGET CLI Docs: https://www.gnu.org/software/wget/manual/wget.html *'wget -N -E -np -x -H -k -K -S --restrict-file-names=unix'.split(' '), *(('-p',) if FETCH_WGET_REQUISITES else ()), - *(('--user-agent={}'.format(WGET_USER_AGENT),) if WGET_USER_AGENT else ()), + *(('--user-agent="{}"'.format(WGET_USER_AGENT),) if WGET_USER_AGENT else ()), *((() if CHECK_SSL_VALIDITY else ('--no-check-certificate',))), link['url'], ] @@ -547,7 +547,7 @@ def fetch_warc(link_dir, link, timeout=TIMEOUT): CMD = [ 'wget', '--warc-file={}'.format(int(datetime.now().timestamp())), - *(('--user-agent={}'.format(WGET_USER_AGENT),) if WGET_USER_AGENT else ()), + *(('--user-agent="{}"'.format(WGET_USER_AGENT),) if WGET_USER_AGENT else ()), *((() if CHECK_SSL_VALIDITY else ('--no-check-certificate',))), link['url'], ]