|
@@ -50,6 +50,7 @@ def parseSource(s):
|
|
|
def news_worker(source,kw):
|
|
def news_worker(source,kw):
|
|
|
source_id=source["_id"]
|
|
source_id=source["_id"]
|
|
|
source_name=source["name"]
|
|
source_name=source["name"]
|
|
|
|
|
+ source_category=source["category"]
|
|
|
paid=False
|
|
paid=False
|
|
|
if "paid" in source and source["paid"]:
|
|
if "paid" in source and source["paid"]:
|
|
|
paid=True
|
|
paid=True
|
|
@@ -74,7 +75,7 @@ def news_worker(source,kw):
|
|
|
p=PaidParser(item)
|
|
p=PaidParser(item)
|
|
|
html=p.html
|
|
html=p.html
|
|
|
|
|
|
|
|
- n=News(item,source_id,source_name,kw,html=html)
|
|
|
|
|
|
|
+ n=News(item,source_id,source_name,source_category,kw,html=html)
|
|
|
print("[Thread %s] Finished" % tname)
|
|
print("[Thread %s] Finished" % tname)
|
|
|
d.insert_article(n.get())
|
|
d.insert_article(n.get())
|
|
|
except Exception as e:
|
|
except Exception as e:
|