Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Can't set space as delimeter parameter in 'feedname.conf' #78

Open
AlvaroSainzBarcena opened this issue Apr 3, 2020 · 1 comment
Open

Comments

@AlvaroSainzBarcena
Copy link

Request Type
Bug
Work Environment

Question Answer
OS version (server) CentOS 7
Hippocampe version / git hash Last
Package Type From source

Problem Description

I tried to add a new source (http://www.malwaredomainlist.com/hostslist/hosts.txt) whose fields are separated by two space characters.

I tried to set the 'delimeter' parameter of the feed config file as space character without success. I tried the following values (none worked):
delimiter : \t
delimiter : \s
delimiter :
delimiter : ' '

Does anyone know what value must be specified? Im trying to achieve it without having to modify python code.

Steps to Reproduce

  1. step 1 - Install Hippocampe
  2. step 2 - Add the new source: http://www.malwaredomainlist.com/hostslist/hosts.txt
  3. step 3 - Launch shadowbook

Thank you.

@AlvaroSainzBarcena AlvaroSainzBarcena changed the title Can't set space as delimeter parameter in 'feedname.conf' under ../feeds/ directory Can't set space as delimeter parameter in 'feedname.conf' Apr 3, 2020
@AlvaroSainzBarcena
Copy link
Author

AlvaroSainzBarcena commented Apr 7, 2020

Finally I modified code, now works the '\s' delimeter as space character:

    if delimiter == '\\s':
            parsedPage = csv.DictReader(parsedPage, fields, extraFields, delimiter = ' ')
    elif delimiter != '\\t':
            parsedPage = csv.DictReader(parsedPage, fields, extraFields, delimiter = delimiter)
    if delimiter == '\\t':
            parsedPage = csv.DictReader(parsedPage, fields, extraFields, dialect = 'excel-tab')
    return parsedPage

This is the end of 'csvParser' function in '.../hippocampe/core/services/modules/shadowbook/parser.py'.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant