aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/export.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/export.py b/source/export.py
index 10f4cd80..c29c9f22 100644
--- a/source/export.py
+++ b/source/export.py
@@ -112,14 +112,14 @@ def export_txt(mongo_db):
for feed in feeds:
# creates folder for each stream
folder = conf.path + "/var/export/txt/" + \
- utils.normalize_filename(feed["feed_title"].strip().replace(':', '').lower().encode('utf-8'))
+ utils.normalize_filename(feed["feed_title"].strip().replace(':', '').lower())
try:
os.makedirs(folder)
except OSError:
# directories already exists (not a problem)
pass
- for article in mongo_db.get_articles_from_collection(feed["feed_id"]):
+ for article in mongo_db.get_articles(feed_id=feed["feed_id"]):
name = article["article_date"].ctime().strip().replace(' ', '_')
name = os.path.normpath(folder + "/" + name + ".txt")
@@ -127,7 +127,7 @@ def export_txt(mongo_db):
content += utils.clear_string(article["article_content"])
with open(name, "w") as f:
- f.write(content.encode('utf-8'))
+ f.write(content)
def export_epub(mongo_db):
"""
bgstack15