readabilite: fix bug when nothing above threshold
continuous-integration/drone/push Build is failing Details

master
pictuga 2021-11-23 20:53:00 +01:00
parent 37e08f8b4c
commit d8cc07223e
1 changed files with 4 additions and 0 deletions

View File

@ -352,6 +352,10 @@ def get_article(data, url=None, encoding_in=None, encoding_out='unicode', debug=
else: else:
best = get_best_node(html, threshold) best = get_best_node(html, threshold)
if best is None:
# if threshold not met
return None
# clean up # clean up
if not debug: if not debug:
keep_threshold = get_score(best) * 3/4 keep_threshold = get_score(best) * 3/4