Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed default behaviour of warc handler when no agent is provided #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions archivenow/handlers/warc_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def __init__(self):
self.name = 'Generate WARC file'
self.api_required = False

def push(self, uri_org, p_args=[], session=requests.Session()):
def push(self, uri_org, p_args={}, session=requests.Session()):
msg = ''
if p_args['agent'] == 'squidwarc':
if 'agent' in p_args and p_args['agent'] == 'squidwarc':
# squidwarc
#if not distutils.spawn.find_executable("squidwarc"):
# return 'wget is not installed!'
Expand All @@ -22,7 +22,6 @@ def push(self, uri_org, p_args=[], session=requests.Session()):
return p_args['warc']+'.warc'
else:
return 'squidwarc failed to generate the WARC file'

else:
if not distutils.spawn.find_executable("wget"):
return 'wget is not installed!'
Expand Down