Pārlūkot izejas kodu

更新篮球, 父级玩法错误

Your Name 6 gadi atpakaļ
vecāks
revīzija
59df101fa8

+ 2 - 2
hg3535/main.py

@@ -5,7 +5,7 @@ from scrapy.cmdline import execute
 # print(os.path.dirname(os.path.abspath(__file__)))
 sys.path.append(os.path.dirname(os.path.abspath(__file__)))
 # execute(["scrapy", "crawl", "liansai"])
-execute(["scrapy", "crawl", "zuqiu"])
+# execute(["scrapy", "crawl", "zuqiu"])
 # execute(["scrapy", "crawl", "lanqiu"])
 # execute(["scrapy", "crawl", "guanjun"])
 # execute(["scrapy", "crawl", "wangqiu"])
@@ -18,6 +18,6 @@ execute(["scrapy", "crawl", "zuqiu"])
 # execute(["scrapy", "crawl", "ball_status"]) #滚球id本地存
 # execute(["scrapy", "crawl", "ball_status_update"]) #滚球id结束时间更新状态
 # execute(["scrapy", "crawl", "saiguo"]) #滚球id结束时间更新状态
-# execute(["scrapy", "crawl", "jieshu"]) #滚球id结束时间更新状态
+execute(["scrapy", "crawl", "jieshu"]) #滚球id结束时间更新状态
 # execute(["scrapy", "crawl", "wq_jieshu"]) #滚球id结束时间更新状态
 # execute(["scrapy", "crawl", "bq_jieshu"]) #滚球id结束时间更新状态

+ 4 - 2
hg3535/pipeline/roll_bangqiu.py

@@ -46,7 +46,9 @@ class Roll_Banqiupipeline(object):
         ctime = "2019" + "-" + month + "-" + day + "" + time_game + ":00".strip()
         # 现在时间,时间戳
         utime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
-        match_date = datetime.datetime.now().strftime("%Y-%m-%d")
+        cdate = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
+        match_date = cdate.split(' ')[0]
+        match_time = cdate.split(' ')[1]
         # 队1分数
         score_home = item['score_home']
         # 队2分数
@@ -102,7 +104,7 @@ class Roll_Banqiupipeline(object):
             match_key = ["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_value = [team_home, team_guest, league_id, 1, match_id, match_date, '00:00', tag_number,
+            match_value = [team_home, team_guest, league_id, 1, match_id, match_date, match_time, tag_number,
                            "hg3535", 1, 0, 0, utime, uuid, 0, 0, 0]
             match_data = dict(zip(match_key, match_value))
             match_list.append(match_data)

+ 4 - 2
hg3535/pipeline/roll_lanqiu.py

@@ -57,7 +57,9 @@ class Roll_Lanqiupipeline(object):
         time_game = str(item['time_game'])
         # 现在时间,时间戳
         utime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
-        match_date = datetime.datetime.now().strftime("%Y-%m-%d")
+        cdate = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
+        match_date = cdate.split(' ')[0]
+        match_time = cdate.split(' ')[1]
         # 队1分数
         score_home = item['score_home']
         # 队2分数
@@ -111,7 +113,7 @@ class Roll_Lanqiupipeline(object):
             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_value = [team_home, team_guest, league_id, 1, match_id, match_date, "00:00", number,
+            match_value = [team_home, team_guest, league_id, 1, match_id, match_date, match_time, number,
                            "hg3535", 1, 0, 0, utime, uuid, 0, 0, 0]
             match_data = dict(zip(match_kay, match_value))
             match_list.append(match_data)

+ 4 - 2
hg3535/pipeline/roll_wangqiu.py

@@ -61,7 +61,9 @@ class Roll_Wangqiupipeline(object):
         # r_ctime = "2019" + "-" + month + "-" + day
         # 现在时间,时间戳
         utime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
-        match_date = datetime.datetime.now().strftime("%Y-%m-%d")
+        cdate = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
+        match_date = cdate.split(' ')[0]
+        match_time = cdate.split(' ')[1]
         # 队1分数
         score_home = item['score_home']
         # 队2分数
@@ -125,7 +127,7 @@ class Roll_Wangqiupipeline(object):
             match_key = ["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", 'rule', "is_horn"]
-            match_value = [team_home, team_guest, league_id, 1, match_id, match_date, '00:00', tag_number,
+            match_value = [team_home, team_guest, league_id, 1, match_id, match_date, match_time, tag_number,
                            "hg3535", 1, 0, 0, utime, uuid, 0, 0, rule, 0]
             match_data = dict(zip(match_key, match_value))
             match_list.append(match_data)

+ 5 - 3
hg3535/pipeline/roll_zuqiu.py

@@ -47,7 +47,9 @@ class Roll_Zuqiupipeline(object):
         time_game = str(item['time_game'])
         # 现在时间,时间戳
         utime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
-        match_date = datetime.datetime.now().strftime("%Y-%m-%d")
+        cdate = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
+        match_date = cdate.split(' ')[0]
+        match_time = cdate.split(' ')[1]
         # 比赛id
         match_id = item['game_id']
         # 联赛id
@@ -99,7 +101,7 @@ class Roll_Zuqiupipeline(object):
             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_value = [team_home, team_guest, league_id, 1, match_id, match_date, '00:00', number,
+            match_value = [team_home, team_guest, league_id, 1, match_id, match_date, match_time, number,
                            "hg3535", 1, 0, 0, utime, uuid, 0, 0, 0]
             match_data = dict(zip(match_kay, match_value))
             match_list.append(match_data)
@@ -628,7 +630,7 @@ class Roll_Zuqiupipeline(object):
                 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_value = [team_home, team_guest, league_id, 1, horn_id, match_date, '00:00', number,
+                match_value = [team_home, team_guest, league_id, 1, horn_id, match_date, match_time, number,
                                "hg3535", 1, 0, 0, utime, uuid, 0, 0, 1]
                 match_data = dict(zip(match_kay, match_value))
                 match_list.append(match_data)