def __init__(self, spec=None):
args = spec.split('<STR_LIT:U+002C>', <NUM_LIT:1>) if spec else []<EOL>if not args:<EOL><INDENT>self.dir = os.curdir<EOL><DEDENT>else:<EOL><INDENT>self.dir = os.path.abspath(args[<NUM_LIT:0>])<EOL>if not os.path.isdir(self.dir):<EOL><INDENT>if os.path.exists(self.dir):<EOL><INDENT>raise ValueError("<STR_LIT>" % args[<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>LOG.info("<STR_LIT>" % self.dir)<EOL>os.makedirs(self.dir)<EOL><DEDENT><DEDENT><DEDENT>if len(args) > <NUM_LIT:1>:<EOL><INDENT>self.key = args[<NUM_LIT:1>]<EOL><DEDENT>else:<EOL><INDENT>self.key = '<STR_LIT:url>'<EOL><DEDENT>
Creates a http output. Spec is of the form "output_dir,url_key", where output_dir is where
files will be written, and url_key is the field name for each event that contains the URL to fetch.

If url_key is not provided, then "url" is the expected key.
If output_dir is not provided, then the current directory is used as output