|
|
@@ -2,7 +2,8 @@ import logging
|
|
|
from twisted.internet import defer,reactor
|
|
|
from ..utils.helper import Helper
|
|
|
from ..settings import LEAGUE_URL,MATCH_URL
|
|
|
-class ZuqiuPipeline(object):
|
|
|
+import time
|
|
|
+class LqSportsPipeline(object):
|
|
|
@defer.inlineCallbacks
|
|
|
def process_item(self,item,spider):
|
|
|
logger=logging.getLogger(__name__)
|
|
|
@@ -26,10 +27,19 @@ class ZuqiuPipeline(object):
|
|
|
is_rollball=1
|
|
|
else:
|
|
|
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['id'], "hgg070", uuid,is_rollball,is_today,is_morningplate,is_stringscene]
|
|
|
+ #是否串场
|
|
|
+ if item['isP'] == 'P':
|
|
|
+ ris_stringscene = 1
|
|
|
+ else:
|
|
|
+ ris_stringscene = 0
|
|
|
+ # 现在时间,时间戳
|
|
|
+ utime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
|
|
+ odds_key = ["game_code", "title", "match_id", "lg_id","data", "source", "odds_only", "tag", "uuid",
|
|
|
+ "is_stringscene", "utime", "pt", 'match_identity']
|
|
|
+ odds_value = ["lq", "odds", item['match_id'], item['gidm'], item["content"],"hgg070", [], item['more_count'], uuid,
|
|
|
+ ris_stringscene, utime, item['isP'], item["match_identity"]]
|
|
|
#赛事
|
|
|
- childer = dict(zip(league_key, league_value))
|
|
|
+ childer = dict(zip(odds_key, odds_value))
|
|
|
#联赛
|
|
|
obj = {"game_code": "lq", "title": "league", "source": "hgg070","data":[childer]}
|
|
|
res=Helper.async_post(LEAGUE_URL,obj)
|