mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Fixing small text importer bug with missing encodings.
This commit is contained in:
parent
78b3ffe7db
commit
1fc3e05b89
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ class TextImporter:
|
|||
def fetch(self, skip_save=False):
|
||||
html = requests.get(self.story.story_permalink, headers=self.headers, verify=False)
|
||||
text = html.text
|
||||
if html.encoding != 'utf-8':
|
||||
if html.encoding and html.encoding != 'utf-8':
|
||||
text = text.encode(html.encoding)
|
||||
original_text_doc = readability.Document(text, url=html.url, debug=settings.DEBUG)
|
||||
content = original_text_doc.summary(html_partial=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue