mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-10 08:38:28 +00:00
fix: [module] fix module obj type: language + mail
This commit is contained in:
parent
623ba455ff
commit
6978764b02
2 changed files with 10 additions and 8 deletions
|
@ -25,11 +25,13 @@ class Languages(AbstractModule):
|
||||||
self.logger.info(f'Module {self.module_name} initialized')
|
self.logger.info(f'Module {self.module_name} initialized')
|
||||||
|
|
||||||
def compute(self, message):
|
def compute(self, message):
|
||||||
item = self.get_obj()
|
obj = self.get_obj()
|
||||||
if item.is_crawled():
|
|
||||||
domain = Domain(item.get_domain())
|
if obj.type == 'item':
|
||||||
for lang in item.get_languages(min_probability=0.8):
|
if item.is_crawled():
|
||||||
domain.add_language(lang.language)
|
domain = Domain(item.get_domain())
|
||||||
|
for lang in item.get_languages(min_probability=0.8):
|
||||||
|
domain.add_language(lang.language)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -139,7 +139,7 @@ class Mail(AbstractModule):
|
||||||
item = self.get_obj()
|
item = self.get_obj()
|
||||||
item_date = item.get_date()
|
item_date = item.get_date()
|
||||||
|
|
||||||
mails = self.regex_findall(self.email_regex, item_id, item.get_content())
|
mails = self.regex_findall(self.email_regex, item.id, item.get_content())
|
||||||
mxdomains_email = {}
|
mxdomains_email = {}
|
||||||
for mail in mails:
|
for mail in mails:
|
||||||
mxdomain = mail.rsplit('@', 1)[1].lower()
|
mxdomain = mail.rsplit('@', 1)[1].lower()
|
||||||
|
@ -172,9 +172,9 @@ class Mail(AbstractModule):
|
||||||
# for tld in mx_tlds:
|
# for tld in mx_tlds:
|
||||||
# Statistics.add_module_tld_stats_by_date('mail', item_date, tld, mx_tlds[tld])
|
# Statistics.add_module_tld_stats_by_date('mail', item_date, tld, mx_tlds[tld])
|
||||||
|
|
||||||
msg = f'Mails;{item.get_source()};{item_date};{item.get_basename()};Checked {num_valid_email} e-mail(s);{item_id}'
|
msg = f'Mails;{item.get_source()};{item_date};{item.get_basename()};Checked {num_valid_email} e-mail(s);{item.id}'
|
||||||
if num_valid_email > self.mail_threshold:
|
if num_valid_email > self.mail_threshold:
|
||||||
print(f'{item_id} Checked {num_valid_email} e-mail(s)')
|
print(f'{item.id} Checked {num_valid_email} e-mail(s)')
|
||||||
self.redis_logger.warning(msg)
|
self.redis_logger.warning(msg)
|
||||||
# Tags
|
# Tags
|
||||||
tag = 'infoleak:automatic-detection="mail"'
|
tag = 'infoleak:automatic-detection="mail"'
|
||||||
|
|
Loading…
Reference in a new issue