BGP-Ranking/bgpranking/parsers/abusech_feodo.py

14 lines
319 B
Python
Raw Normal View History

2018-12-12 17:44:06 +01:00
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from dateutil.parser import parse
import re
from io import BytesIO
from typing import List
def parse_raw_file(self, f: BytesIO) -> List[bytes]:
2018-12-12 17:52:06 +01:00
self.datetime = parse(re.findall(b'# Last updated: (.*)#', f.getvalue())[0])
2018-12-12 17:44:06 +01:00
return self.extract_ipv4(f.getvalue())