Commit 3eecf959 authored by Ad Schellevis's avatar Ad Schellevis

(ids) refactor source url processing

parent 1e4725b2
...@@ -61,6 +61,12 @@ class Metadata(object): ...@@ -61,6 +61,12 @@ class Metadata(object):
metadata_record = dict() metadata_record = dict()
metadata_record['source'] = src_location.attrib metadata_record['source'] = src_location.attrib
metadata_record['filename'] = rule_filename.text.strip() metadata_record['filename'] = rule_filename.text.strip()
if 'url' in rule_filename.attrib:
metadata_record['url'] = (rule_filename.attrib['url'])
else:
metadata_record['url'] = ('%s/%s' % (metadata_record['source']['url'],
metadata_record['filename']))
if 'prefix' in src_location.attrib: if 'prefix' in src_location.attrib:
description_prefix = "%s/" % src_location.attrib['prefix'] description_prefix = "%s/" % src_location.attrib['prefix']
else: else:
......
...@@ -78,5 +78,4 @@ if __name__ == '__main__': ...@@ -78,5 +78,4 @@ if __name__ == '__main__':
pass pass
else: else:
input_filter = enabled_rulefiles[rule['filename']]['filter'] input_filter = enabled_rulefiles[rule['filename']]['filter']
url = ('%s/%s' % (rule['source']['url'], rule['filename'])) dl.download(proto=download_proto, url=rule['url'], input_filter=input_filter)
dl.download(proto=download_proto, url=url, input_filter=input_filter)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment