mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-23 06:37:15 +00:00
fix: [PgpDump] catch bs4 error
This commit is contained in:
parent
3ec72b0430
commit
0ec56cf1ed
1 changed files with 12 additions and 9 deletions
|
@ -41,6 +41,7 @@ def save_in_file(message, pgp_content):
|
||||||
r_serv_db.sadd('pgpdumb:uuid', '{};{}'.format(UUID, message))
|
r_serv_db.sadd('pgpdumb:uuid', '{};{}'.format(UUID, message))
|
||||||
|
|
||||||
def remove_html(item_content):
|
def remove_html(item_content):
|
||||||
|
try:
|
||||||
if bool(BeautifulSoup(item_content, "html.parser").find()):
|
if bool(BeautifulSoup(item_content, "html.parser").find()):
|
||||||
soup = BeautifulSoup(item_content, 'html.parser')
|
soup = BeautifulSoup(item_content, 'html.parser')
|
||||||
# kill all script and style elements
|
# kill all script and style elements
|
||||||
|
@ -52,6 +53,8 @@ def remove_html(item_content):
|
||||||
return text
|
return text
|
||||||
else:
|
else:
|
||||||
return item_content
|
return item_content
|
||||||
|
except TypeError:
|
||||||
|
return item_content
|
||||||
|
|
||||||
def extract_all_id(message, item_content, regex=None, is_file=False):
|
def extract_all_id(message, item_content, regex=None, is_file=False):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue