|
|
@@ -1,24 +1,14 @@
|
|
|
import logging
|
|
|
from twisted.internet import defer, reactor
|
|
|
from ..utils.helper import Helper
|
|
|
-<<<<<<< HEAD
|
|
|
from ..settings import LEAGUE_URL,MATCH_URL
|
|
|
import pymongo,time
|
|
|
from ..settings import M_HOST,M_USER,M_PASSWORD,M_POST,M_DB,ODDS_URL
|
|
|
class LanqiuPipeline(object):
|
|
|
-=======
|
|
|
-from ..settings import LEAGUE_URL, MATCH_URL
|
|
|
-import pymongo
|
|
|
-from ..settings import M_HOST, M_USER, M_PASSWORD, M_POST, M_DB
|
|
|
-
|
|
|
-
|
|
|
-class ZuqiuPipeline(object):
|
|
|
->>>>>>> d24c6bfe93390b44800468998733ecf116d4bdf0
|
|
|
def open_spider(self, spider):
|
|
|
self.mongo = pymongo.MongoClient(host=M_HOST, username=M_USER, password=M_PASSWORD, port=M_POST,
|
|
|
authSource=M_DB)
|
|
|
self.db = self.mongo[M_DB]
|
|
|
-
|
|
|
@defer.inlineCallbacks
|
|
|
def process_item(self, item, spider):
|
|
|
logger = logging.getLogger(__name__)
|
|
|
@@ -40,7 +30,6 @@ class ZuqiuPipeline(object):
|
|
|
elif type == "RB":
|
|
|
is_rollball = 1
|
|
|
else:
|
|
|
-<<<<<<< HEAD
|
|
|
is_stringscene=1
|
|
|
league_key = ["name_chinese", "kind", "match_mode", "if_stop", "last_time", "lg_id", "source", "uuid","is_rollball","is_today","is_morningplate","is_stringscene"]
|
|
|
league_value = [league_name, "1", "1", "0", item['datetime'], item['match_id'], "hgg070", uuid,is_rollball,is_today,is_morningplate,is_stringscene]
|
|
|
@@ -54,7 +43,6 @@ class ZuqiuPipeline(object):
|
|
|
logging.warning("联赛提交成功,{}1".format(res))
|
|
|
#提交赛事
|
|
|
lres=Helper.async_post(MATCH_URL,childer)
|
|
|
- print('333333333333333333333333333333333333333333',lres)
|
|
|
if lres.get('status')==1:
|
|
|
logging.warning("赛事提交成功,{}2".format(res))
|
|
|
#保存赔率
|
|
|
@@ -80,7 +68,7 @@ class ZuqiuPipeline(object):
|
|
|
logging.warning("赔率提交失败,{}4".format(res))
|
|
|
else:
|
|
|
logging.warning("赔率提交失败,{}5".format(res))
|
|
|
-=======
|
|
|
+
|
|
|
is_stringscene = 1
|
|
|
league_key = ["name_chinese", "kind", "match_mode", "if_stop", "last_time", "lg_id", "source", "uuid",
|
|
|
"is_rollball", "is_today", "is_morningplate", "is_stringscene"]
|
|
|
@@ -99,24 +87,13 @@ class ZuqiuPipeline(object):
|
|
|
lres = Helper.async_post(MATCH_URL, childer)
|
|
|
if lres.get('status') == 1:
|
|
|
logging.warning("联赛提交成功,{}".format(res))
|
|
|
->>>>>>> d24c6bfe93390b44800468998733ecf116d4bdf0
|
|
|
+
|
|
|
else:
|
|
|
- logging.warning("赛事提交失败,{}6".format(res))
|
|
|
+ logging.warning("赛事提交失败,{}".format(res))
|
|
|
|
|
|
else:
|
|
|
- logging.warning("联赛提交失败,{}7".format(res))
|
|
|
+ logging.warning("联赛提交失败,{}".format(res))
|
|
|
else:
|
|
|
-<<<<<<< HEAD
|
|
|
- logging.warning("联赛提交失败,{}8".format(res))
|
|
|
-
|
|
|
-
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-=======
|
|
|
logging.warning("联赛提交失败,{}".format(res))
|
|
|
->>>>>>> d24c6bfe93390b44800468998733ecf116d4bdf0
|
|
|
+
|