瀏覽代碼

添加联赛,赛事提交

Your Name 6 年之前
父節點
當前提交
ba01260657
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 1 1
      hgg070_spider/main.py
  2. 5 5
      hgg070_spider/pipelines/zuqiu.py

+ 1 - 1
hgg070_spider/main.py

@@ -6,7 +6,7 @@ from scrapy.cmdline import execute
 sys.path.append(os.path.dirname(os.path.abspath(__file__)))
 execute(["scrapy", "crawl", "zuqiu"])
 # execute(["scrapy", "crawl", "lanqiu"])
-execute(["scrapy", "crawl", "lq_sports"])
+# execute(["scrapy", "crawl", "lq_sports"])
 # execute(["scrapy", "crawl", "guanjun"])
 # execute(["scrapy", "crawl", "wangqiu"])
 # execute(["scrapy", "crawl", "wqbodan"])

+ 5 - 5
hgg070_spider/pipelines/zuqiu.py

@@ -35,11 +35,11 @@ class ZuqiuPipeline(object):
         league_list = []
         last_time = '{}-12-31 23:59:59'.format(datetime.datetime.now().year)
         match_date, match_time, time3 = Helper.change_time(us_time)
-        if self.db.zq_league35.find({'lg_id': league_id}).count() < 1:
+        if self.db.zq_league070.find({'lg_id': league_id}).count() < 1:
             # if self.db.zq_league35.find({'uuid': uuid}).count() < 1:
-            league_dict = {"game_code": "zq", "title": "league", "source": "hg3535"}
+            league_dict = {"game_code": "zq", "title": "league", "source": "hgg070"}
             league_key = ["name_chinese", "kind", "match_mode", "if_stop", "last_time", "lg_id", "source", "uuid"]
-            league_value = [league_name, "1", "1", "0", last_time, league_id, "hg3535", uuid]
+            league_value = [league_name, "1", "1", "0", last_time, league_id, "hgg070", uuid]
             league_data = dict(zip(league_key, league_value))
             league_list.append(league_data)
             league_dict['data'] = league_list
@@ -72,9 +72,9 @@ class ZuqiuPipeline(object):
 
         match_list = []
         match_identity = Helper.genearte_uuid(team_h + team_c + match_date)
-        if self.db.zq_competition35.find({'match_id': match_id, pt_status: 1}).count() < 1:
+        if self.db.zq_competition070.find({'match_id': match_id, pt_status: 1}).count() < 1:
             # if self.db.zq_competition35.find({'match_identity': match_identity, pt_status: 1}).count() < 1:
-            match_dict = {"game_code": "zq", "title": "match", "source": "hg3535"}
+            match_dict = {"game_code": "zq", "title": "match", "source": "hgg070"}
             match_kay = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time",
                          "tag", "source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
                          "half_match_id", "is_today", "is_horn", 'match_identity']