diff --git a/bin/ZMQ_Sub_Urls.py b/bin/ZMQ_Sub_Urls.py index 963a75b3..3a940d7e 100755 --- a/bin/ZMQ_Sub_Urls.py +++ b/bin/ZMQ_Sub_Urls.py @@ -97,16 +97,15 @@ if __name__ == "__main__": print hostl, asn, cc, \ pycountry.countries.get(alpha2=cc).name if cc == cc_critical: - # FIXME: That's going to fail. publisher.warning( - 'Url;{};{};{};Detected {} {} {}'.format( + 'Url;{};{};{};Detected {} {}'.format( PST.p_source, PST.p_date, PST.p_name, - A_values[0], hostl, cc)) + hostl, cc)) else: print hostl, asn, cc + A_values = lib_refine.checking_A_record(r_serv2, domains_list) - if A_values[0] >= 1: PST.__setattr__(channel, A_values) PST.save_attribute_redis(r_serv1, channel, diff --git a/bin/packages/Paste.py b/bin/packages/Paste.py index f8c6dffa..fddae0f9 100755 --- a/bin/packages/Paste.py +++ b/bin/packages/Paste.py @@ -117,6 +117,7 @@ class Paste(object): if self.p_nb_lines is None or self.p_max_length_line is None: max_length_line = 0 f = self.get_p_content_as_file() + line_id = 0 for line_id, line in enumerate(f): length = len(line) if length >= max_length_line: @@ -133,10 +134,7 @@ class Paste(object): :Example: PST._set_p_encoding() """ - try: - return magic.Magic(mime_encoding=True).from_buffer(self.get_p_content()) - except magic.MagicException: - pass + return self.p_mime def _set_p_hash_kind(self, hashkind): """