zuqiu.py 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. # -*- coding: utf-8 -*-
  2. import copy
  3. import json
  4. # import redis
  5. import scrapy
  6. from scrapy.http import Request
  7. from ..items import Zuqiu
  8. import datetime
  9. class ZuqiuSpider(scrapy.Spider):
  10. name = 'zuqiu'
  11. to_day = datetime.datetime.now()
  12. # print(to_day.year, to_day)
  13. allowed_domains = ['hg3535z.com']
  14. custom_settings = {
  15. "ITEM_PIPELINES": {
  16. 'hg3535.pipeline.zuqiu.Zuqiupipeline': 300,
  17. },
  18. # 'LOG_LEVEL': 'DEBUG',
  19. # 'LOG_FILE': "../hg3535/log/zuqiu_{}_{}_{}.log".format(to_day.year, to_day.month, to_day.day),
  20. # 'RETRY_ENABLED': False,
  21. # 'COOKIES_ENABLED': False,
  22. # 'DOWNLOAD_TIMEOUT': 1,
  23. # 'SCHEDULER_PERSIST': False,
  24. # 'SCHEDULER_FLUSH_ON_START': False,
  25. }
  26. def start_requests(self):
  27. for y in range(1, 4):
  28. for i in range(10):
  29. y = str(y)
  30. i = str(i)
  31. # yield y
  32. url = "https://odata.jiushan6688.com/odds6i/d/getodds/zh-cn/sid/1/pt/" + y + "/ubt/am/pn/" + i + "/sb/2/dc/null/pid/0"
  33. yield scrapy.Request(url=url, callback=self.parse, dont_filter=True, meta={'pt': y})
  34. def parse(self, response):
  35. if response.status == 200:
  36. # cls = redis.Redis(host='192.168.0.110', port=6379, db=0)
  37. if response.text:
  38. try:
  39. datas = json.loads(response.text).get('n-ot', "").get('egs', "")
  40. except:
  41. # datas = ''
  42. print("为获取到数据")
  43. return
  44. pt = copy.copy(response.meta['pt'])
  45. for result in datas:
  46. new_results = result['es']
  47. for new_result in new_results:
  48. game_id = str(new_result['i'][16])
  49. # cls.sadd('hg3535.zq.ids', game_id)
  50. # cls.expire('hg3535.zq.ids', 300)
  51. if pt == "3":
  52. url = "https://odata.jiushan6688.com/odds6i/d/getamodds/zh-cn/eid/" + str(game_id) + "/iip/false/ubt/am/isp/true"
  53. yield Request(url=url, callback=self.parse_each, dont_filter=True, meta={'pt': pt})
  54. if pt == "2":
  55. url = "https://odata.jiushan6688.com/odds6i/d/getamodds/zh-cn/eid/" + str(game_id) + "/iip/false/ubt/am/isp/false"
  56. yield Request(url=url, callback=self.parse_each, dont_filter=True, meta={'pt': pt})
  57. if pt == "1":
  58. url = "https://odata.jiushan6688.com/odds6i/d/getamodds/zh-cn/eid/" + str(game_id) + "/iip/false/ubt/am/isp/false"
  59. yield Request(url=url, callback=self.parse_each, dont_filter=True, meta={'pt': pt})
  60. #
  61. def parse_each(self, response):
  62. if response.status == 200:
  63. # 球队进球数 大小
  64. try:
  65. datas = json.loads(response.text)['eg']['es']
  66. league_id = json.loads(response.text)['eg']['c']['k']
  67. # 联赛名
  68. league_name = json.loads(response.text)['eg']['c']['n']
  69. # zuqiu = json.loads(response.text)['i'][31]
  70. except:
  71. datas = ""
  72. league_id = ""
  73. # 联赛名
  74. league_name = ""
  75. # zuqiu = ""
  76. try:
  77. pt = response.meta['pt']
  78. except:
  79. pt = 0
  80. if datas:
  81. item = Zuqiu()
  82. full_dict = {}
  83. half_dict = {}
  84. full_dict_rule = {}
  85. half_dict_rule = {}
  86. for data in datas:
  87. try:
  88. new_data = data['pci']['ctid']
  89. except:
  90. new_data = ""
  91. if new_data == 0:
  92. # 比赛id
  93. game_id = str(data['k'])
  94. # 球队1
  95. team_home = data['i'][0]
  96. # 球队2
  97. team_guest = data['i'][1]
  98. # 数量(97>)
  99. number = data['i'][2]
  100. # 下半场
  101. half_way = data['i'][12]
  102. # 角球或者其他
  103. try:
  104. corner_ball = data['pci']['ctn']
  105. except:
  106. corner_ball = 0
  107. # 日期
  108. data_game = data['i'][4]
  109. # 开赛时间
  110. time_game = data['i'][5]
  111. # 让球------------------------------------------------------------------------------------------------------------------
  112. try:
  113. concedes = data['o']['ah']['v']
  114. new_concedes = [concedes[i] for i in range(len(concedes)) if i % 2 is 1]
  115. concede_homes = [new_concedes[i] for i in range(len(new_concedes)) if i % 2 is 0]
  116. concede_home_rule = [concede_homes[i] for i in range(len(concede_homes)) if i % 2 is 0]
  117. # concede_home
  118. concede_guests = [new_concedes[i] for i in range(len(new_concedes)) if i % 2 is 1]
  119. # concede_guest_rule
  120. concede_guest_rule = [concede_guests[i] for i in range(len(concede_guests)) if
  121. i % 2 == 0]
  122. if pt is 3:
  123. concede_guest = [round(float(concede_guests[i]) - 1, 2) for i in range(len(concede_guests)) if i % 2 is 1]
  124. concede_home = [round(float(concede_homes[i]) - 1, 2) for i in range(len(concede_homes)) if i % 2 is 1]
  125. else:
  126. concede_guest = [concede_guests[i] for i in range(len(concede_guests)) if i % 2 is 1]
  127. concede_home = [concede_homes[i] for i in range(len(concede_homes)) if i % 2 is 1]
  128. except:
  129. concede_guest = ""
  130. concede_guest_rule = ""
  131. concede_home = ""
  132. concede_home_rule = ""
  133. # 上半场让球half_concede-------------------------------------------------------------------------------------------------
  134. try:
  135. half_concedes = data['o']['ah1st']['v']
  136. new_half_concedes = [half_concedes[i] for i in range(len(half_concedes)) if i % 2 is 1]
  137. new_half_concede_homes = [new_half_concedes[i] for i in range(len(new_half_concedes)) if i % 2 == 0]
  138. # half_concede_home_rule
  139. half_concede_home_rule = [new_half_concede_homes[i] for i in
  140. range(len(new_half_concede_homes)) if i % 2 == 0]
  141. # concede_home
  142. half_concede_guests = [new_half_concedes[i] for i in range(len(new_half_concedes)) if i % 2 is 1]
  143. # concede_guest_rule
  144. half_concede_guest_rule = [half_concede_guests[i] for i in
  145. range(len(half_concede_guests)) if i % 2 == 0]
  146. if pt is 3:
  147. half_concede_home = [round(float(new_half_concede_homes[i]) - 1, 2) for i in range(len(new_half_concede_homes)) if
  148. i % 2 is 1]
  149. half_concede_guest = [round(float(half_concede_guests[i]) - 1, 2) for i in range(len(half_concede_guests)) if
  150. i % 2 is 1]
  151. else:
  152. half_concede_home = [new_half_concede_homes[i] for i in range(len(new_half_concede_homes)) if i % 2 is 1]
  153. half_concede_guest = [half_concede_guests[i] for i in range(len(half_concede_guests)) if i % 2 is 1]
  154. except:
  155. half_concede_home_rule = ""
  156. half_concede_home = ""
  157. half_concede_guest_rule = ""
  158. half_concede_guest = ""
  159. # 全场大小size 进球大小---------------------------------------------------------------------------------------------------
  160. try:
  161. sizes = data['o']['ou']['v']
  162. new_sizes = [sizes[i] for i in range(len(sizes)) if i % 2 is 1]
  163. size_homes = [new_sizes[i] for i in range(len(new_sizes)) if i % 2 is 0]
  164. # size_home_rule
  165. size_home_rule = [size_homes[i] for i in range(len(size_homes)) if i % 2 is 0]
  166. # size_home
  167. size_guests = [new_sizes[i] for i in range(len(new_sizes)) if i % 2 is 1]
  168. # size_guest_rule
  169. size_guest_rule = [size_guests[i] for i in range(len(size_guests)) if i % 2 is 0]
  170. # csize_guest
  171. if pt is 3:
  172. size_guest = [round(float(size_guests[i]) - 1, 2) for i in range(len(size_guests)) if i % 2 is 1]
  173. size_home = [round(float(size_homes[i]) - 1, 2) for i in range(len(size_homes)) if i % 2 is 1]
  174. else:
  175. size_guest = [size_guests[i] for i in range(len(size_guests)) if i % 2 is 1]
  176. size_home = [size_homes[i] for i in range(len(size_homes)) if i % 2 is 1]
  177. except:
  178. size_guest = ""
  179. size_guest_rule = ""
  180. size_home = ""
  181. size_home_rule = ""
  182. # 上半场大小 进球大小 half_size-------------------------------------------------------------------------------------------
  183. try:
  184. half_sizes = data['o']['ou1st']['v']
  185. new_half_sizes = [half_sizes[i] for i in range(len(half_sizes)) if i % 2 is 1]
  186. half_size_homes = [new_half_sizes[i] for i in range(len(new_half_sizes)) if i % 2 is 0]
  187. # size_home_rule
  188. half_size_home_rule = [half_size_homes[i] for i in range(len(half_size_homes)) if
  189. i % 2 is 0]
  190. half_size_guests = [new_half_sizes[i] for i in range(len(new_half_sizes)) if i % 2 is 1]
  191. # half_size_guest_rule 客队
  192. half_size_guest_rule = [half_size_guests[i] for i in range(len(half_size_guests)) if
  193. i % 2 is 0]
  194. # half_size_guest
  195. if pt is 3:
  196. half_size_guest = [round(float(half_size_guests[i]) - 1, 2) for i in range(len(half_size_guests)) if
  197. i % 2 is 1]
  198. half_size_home = [round(float(half_size_homes[i]) - 1, 2) for i in range(len(half_size_homes)) if
  199. i % 2 is 1]
  200. else:
  201. half_size_guest = [half_size_guests[i] for i in range(len(half_size_guests)) if
  202. i % 2 is 1]
  203. half_size_home = [half_size_homes[i] for i in range(len(half_size_homes)) if i % 2 is 1]
  204. except:
  205. half_size_guest = ""
  206. half_size_guest_rule = ""
  207. half_size_home = ""
  208. half_size_home_rule = ""
  209. # 全场总进球 total_goal--------------------------------------------------------------------------------------------------
  210. total_goal = {}
  211. try:
  212. total_goals = data['o']['tg']['v']
  213. new_total_goals = [total_goals[i] for i in range(len(total_goals)) if i % 2 is 1]
  214. total_goal["tg0"] = round(float(new_total_goals[0]) - 1, 2)
  215. total_goal["tg1"] = round(float(new_total_goals[1]) - 1, 2)
  216. total_goal["tg2"] = round(float(new_total_goals[2]) - 1, 2)
  217. total_goal["tg3"] = round(float(new_total_goals[3]) - 1, 2)
  218. except:
  219. total_goal["tg0"] = ""
  220. total_goal["tg1"] = ""
  221. total_goal["tg2"] = ""
  222. total_goal["tg3"] = ""
  223. # 总进球上半场 half_total_goal-------------------------------------------------------------------------------------------
  224. try:
  225. half_total_goals = data['o']['tg1st']['v']
  226. new_half_total_goals = [half_total_goals[i] for i in range(len(half_total_goals)) if i % 2 is 1]
  227. total_goal["tg0_h"] = round(float(new_half_total_goals[0]) - 1, 2)
  228. total_goal["tg1_h"] = round(float(new_half_total_goals[1]) - 1, 2)
  229. total_goal["tg2_h"] = round(float(new_half_total_goals[2]) - 1, 2)
  230. total_goal["tg3_h"] = round(float(new_half_total_goals[3]) - 1, 2)
  231. except:
  232. total_goal["tg0_h"] = ""
  233. total_goal["tg1_h"] = ""
  234. total_goal["tg2_h"] = ""
  235. total_goal["tg3_h"] = ""
  236. # 早盘 半场/全场---------------------------------------------------------------------------------------------------------
  237. half_full = {}
  238. new_lists = ["hfhh", "hfhd", "hfhg", "hfdh", "hfdd", "hfdg", "hfgh", "hfgd", "hfgg"]
  239. # 早盘 半场/全场
  240. try:
  241. half_fulls = data['o']['hf']['v']
  242. new_half_fulls = [half_fulls[i] for i in range(len(half_fulls)) if i % 2 is 1]
  243. for index, value in enumerate(new_lists):
  244. half_full[value] = round(float(new_half_fulls[index]) - 1, 2)
  245. except:
  246. for index, value in enumerate(new_lists):
  247. half_full[value] = ""
  248. # 早盘 最先/最后进球 最先进球 ---------------------------------------------------------------------------------------------
  249. first_last_ball = {}
  250. try:
  251. first_balls = data['o']['ttslast']['v']
  252. first_ball = [first_balls[i] for i in range(len(first_balls)) if i % 2 is 1]
  253. first_last_ball['flbfh'] = round(float(first_ball[0]) - 1, 2)
  254. first_last_ball['flbfg'] = round(float(first_ball[1]) - 1, 2)
  255. except:
  256. pass
  257. # 早盘 最先/最后进球 最后进球
  258. try:
  259. last_balls = data['o']['tts1st']['v']
  260. last_ball = [last_balls[i] for i in range(len(last_balls)) if i % 2 is 1]
  261. first_last_ball['flblh'] = round(float(last_ball[0]) - 1, 2)
  262. first_last_ball['flblg'] = round(float(last_ball[1]) - 1, 2)
  263. first_last_ball['flbn'] = round(float(last_ball[2]) - 1, 2)
  264. except:
  265. pass
  266. # 全场独赢capot ---------------------------------------------------------------------------------------------------------
  267. try:
  268. capots = data['o']['1x2']['v']
  269. new_capots = [capots[i] for i in range(len(capots)) if i % 2 is 1]
  270. capot_home = round(float(new_capots[0]) - 1, 2)
  271. capot_guest = round(float(new_capots[1]) - 1, 2)
  272. capot_dogfall = round(float(new_capots[2]) - 1, 2)
  273. except:
  274. capot_home = ""
  275. capot_guest = ""
  276. capot_dogfall = ""
  277. # 上半场独赢capot
  278. try:
  279. half_capots = data['o']['1x21st']['v']
  280. new_half_capots = [half_capots[i] for i in range(len(half_capots)) if i % 2 is 1]
  281. half_capot_home = round(float(new_half_capots[0]) - 1, 2)
  282. half_capot_guest = round(float(new_half_capots[1]) - 1, 2)
  283. half_capot_dogfall = round(float(new_half_capots[2]) - 1, 2)
  284. except:
  285. half_capot_home = ""
  286. half_capot_guest = ""
  287. half_capot_dogfall = ""
  288. # 全场入球:单/双 odd_even------------------------------------------------------------------------------------------------
  289. try:
  290. odd_evens = data['o']['oe']['v']
  291. new_odd_evens = [odd_evens[i] for i in range(len(odd_evens)) if i % 2 is 1]
  292. if pt is 3:
  293. odd_even_odd = round(float(new_odd_evens[0]) - 1, 2)
  294. odd_even_even = round(float(new_odd_evens[1]) - 1, 2)
  295. else:
  296. odd_even_odd = round(float(new_odd_evens[0]), 2)
  297. odd_even_even = round(float(new_odd_evens[1]), 2)
  298. except:
  299. odd_even_odd = ""
  300. odd_even_even = ""
  301. # 半场入球:单/双 half_odd_even
  302. try:
  303. half_odd_evens = data['o']['oe1st']['v']
  304. new_half_odd_evens = [half_odd_evens[i] for i in range(len(half_odd_evens)) if i % 2 is 1]
  305. if pt is 3:
  306. half_odd_even_odd = round(float(new_half_odd_evens[0]) - 1, 2)
  307. half_odd_even_even = round(float(new_half_odd_evens[1]) - 1, 2)
  308. else:
  309. half_odd_even_odd = new_half_odd_evens[0]
  310. half_odd_even_even = new_half_odd_evens[1]
  311. except:
  312. half_odd_even_odd = ""
  313. half_odd_even_even = ""
  314. bodan_data = {}
  315. # 波胆------------------------------------------------------------------------------------------------------------------
  316. try:
  317. bodans = data['o']['cs']['v']
  318. one_list = ["b10", "b20", "b21", "b30", "b31", "b32", "b40", "b41", "b42", "b43"]
  319. two_list = ["b01", "b02", "b12", "b03", "b13", "b23", "b04", "b14", "b24", "b34"]
  320. three_list = ["b00", "b11", "b22", "b33", "b44"]
  321. new_bodans = [bodans[i] for i in range(len(bodans)) if i % 2 is 1]
  322. new_bodan = new_bodans[0:20]
  323. # 主队bodan_home
  324. bodan_home = [new_bodan[i] for i in range(len(new_bodan)) if i % 2 is 0]
  325. for index, t in enumerate(one_list):
  326. bodan_data[t] = round(float(bodan_home[index]) - 1, 2)
  327. # 客队bodan_guest
  328. bodan_guest = [new_bodan[i] for i in range(len(new_bodan)) if i % 2 is 1]
  329. for y, z in enumerate(two_list):
  330. bodan_data[z] = round(float(bodan_guest[y]) - 1, 2)
  331. bodan_dogfall = new_bodans[-6:-1]
  332. for a, b in enumerate(three_list):
  333. bodan_data[b] = round(float(bodan_dogfall[a]) - 1, 2)
  334. # 其他bodan_other
  335. bodan_data['bo'] = round(float(new_bodans[-1]) - 1, 2)
  336. except:
  337. pass
  338. try:
  339. half_bodans = data['o']['cs1st']['v']
  340. new_half_bodans = [half_bodans[i] for i in range(len(half_bodans)) if i % 2 is 1]
  341. new_one = ["b10_h", "b20_h", "b21_h", "b30_h", "b31_h", "b32_h"]
  342. new_two = ["b01_h", "b02_h", "b12_h", "b03_h", "b13_h", "b23_h"]
  343. new_three = ["b00_h", "b11_h", "b22_h", "b33_h"]
  344. halfbodan = new_half_bodans[0:12]
  345. half_bodan_home = [halfbodan[i] for i in range(len(halfbodan)) if i % 2 is 0]
  346. # 队1
  347. for index, t in enumerate(new_one):
  348. bodan_data[t] = round(float(half_bodan_home[index]) - 1, 2)
  349. # 队2
  350. half_bodan_guest = [halfbodan[i] for i in range(len(halfbodan)) if i % 2 is 1]
  351. for y, z in enumerate(new_two):
  352. bodan_data[z] = round(float(half_bodan_guest[y]) - 1, 2)
  353. # 和/平
  354. half_bodan_dogfall = new_half_bodans[-6:-2]
  355. for a, b in enumerate(new_three):
  356. bodan_data[b] = round(float(half_bodan_dogfall[a]) - 1, 2)
  357. # 其他
  358. bodan_data['bo_h'] = round(float(new_half_bodans[-1]) - 1, 2)
  359. except:
  360. pass
  361. if new_data is 12:
  362. try:
  363. home_data = data['o']['ou']['v']
  364. # 球队进球 大条件
  365. full_dict_rule['tbhb'] = home_data[1]
  366. # 球队进球小条件
  367. full_dict_rule['tbhs'] = home_data[3]
  368. if pt is 3:
  369. # 球队进球大赔率
  370. full_dict['tbhb'] = round(float(home_data[5]) - 1, 2)
  371. # 球队进球小赔率
  372. full_dict['tbhs'] = round(float(home_data[7]) - 1, 2)
  373. else:
  374. # 球队进球大赔率
  375. full_dict['tbhb'] = home_data[5]
  376. # 球队进球小赔率
  377. full_dict['tbhs'] = home_data[7]
  378. except:
  379. full_dict['tbhs'] = ""
  380. full_dict_rule['tbhs'] = ""
  381. full_dict['tbhb'] = ""
  382. full_dict_rule['tbhb'] = ""
  383. try:
  384. half_home_data = data['o']['ou1st']['v']
  385. half_dict_rule['tbhb_h'] = half_home_data[1]
  386. half_dict_rule['tbhs_h'] = half_home_data[3]
  387. if pt is 3:
  388. half_dict['tbhb_h'] = round(float(half_home_data[5]) - 1, 2)
  389. half_dict['tbhs_h'] = round(float(half_home_data[7]) - 1, 2)
  390. else:
  391. half_dict['tbhb_h'] = half_home_data[5]
  392. half_dict['tbhs_h'] = half_home_data[7]
  393. except:
  394. half_dict_rule['tbhb_h'] = ""
  395. half_dict['tbhb_h'] = ""
  396. half_dict_rule['tbhs_h'] = ""
  397. half_dict['tbhs_h'] = ""
  398. if new_data is 13:
  399. try:
  400. guest_data = data['o']['ou']['v']
  401. full_dict_rule['tbgb'] = guest_data[1]
  402. full_dict_rule['tbgs'] = guest_data[3]
  403. if pt is 3:
  404. full_dict['tbgb'] = round(float(guest_data[5]) - 1, 2)
  405. full_dict['tbgs'] = round(float(guest_data[7]) - 1, 2)
  406. else:
  407. full_dict['tbgb'] = guest_data[5]
  408. full_dict['tbgs'] = guest_data[7]
  409. except:
  410. full_dict_rule['tbgb'] = ""
  411. full_dict['tbgb'] = ""
  412. full_dict_rule['tbgs'] = ""
  413. full_dict['tbgs'] = ''
  414. try:
  415. half_guest_data = data['o']['ou1st']['v']
  416. half_dict_rule['tbgb_h'] = half_guest_data[1]
  417. half_dict_rule['tbgs_h'] = half_guest_data[3]
  418. if pt is 3:
  419. half_dict['tbgb_h'] = round(float(half_guest_data[5]) - 1, 2)
  420. half_dict['tbgs_h'] = round(float(half_guest_data[7]) - 1, 2)
  421. else:
  422. half_dict['tbgb_h'] = half_guest_data[5]
  423. half_dict['tbgs_h'] = half_guest_data[7]
  424. except:
  425. half_dict_rule['tbgb_h'] = ""
  426. half_dict['tbgb_h'] = ""
  427. half_dict_rule['tbgs_h'] = ""
  428. half_dict['tbgs_h'] = ""
  429. item['league_id'] = league_id
  430. item['league_name'] = league_name
  431. item['pt'] = pt
  432. item['game_id'] = game_id
  433. item['team_home'] = team_home
  434. item['team_guest'] = team_guest
  435. item['number'] = number
  436. item['data_game'] = data_game
  437. item['time_game'] = time_game
  438. item['corner_ball'] = corner_ball
  439. # 波胆
  440. item['bodan_data'] = bodan_data
  441. # 早盘入球数单双
  442. item["odd_even_odd"] = odd_even_odd
  443. item["odd_even_even"] = odd_even_even
  444. item["half_odd_even_odd"] = half_odd_even_odd
  445. item["half_odd_even_even"] = half_odd_even_even
  446. item['total_goal'] = total_goal
  447. item["half_capot_home"] = half_capot_home
  448. item["half_capot_guest"] = half_capot_guest
  449. item["half_capot_dogfall"] = half_capot_dogfall
  450. item["capot_home"] = capot_home
  451. item["capot_guest"] = capot_guest
  452. item["capot_dogfall"] = capot_dogfall
  453. item["first_last_ball"] = first_last_ball
  454. item["half_full"] = half_full
  455. item["half_size_guest"] = half_size_guest
  456. item["half_size_guest_rule"] = half_size_guest_rule
  457. item["half_size_home"] = half_size_home
  458. item["half_size_home_rule"] = half_size_home_rule
  459. # 全场大小
  460. item["size_guest"] = size_guest
  461. item["size_guest_rule"] = size_guest_rule
  462. item["size_home"] = size_home
  463. item["size_home_rule"] = size_home_rule
  464. # 上半场让球
  465. item["half_concede_home_rule"] = half_concede_home_rule
  466. item["half_concede_home"] = half_concede_home
  467. item["half_concede_guest_rule"] = half_concede_guest_rule
  468. item["half_concede_guest"] = half_concede_guest
  469. # 全场让球
  470. item["concede_guest"] = concede_guest
  471. item["concede_guest_rule"] = concede_guest_rule
  472. item["concede_home"] = concede_home
  473. item["concede_home_rule"] = concede_home_rule
  474. item['full_data'] = full_dict
  475. item['half_data'] = half_dict
  476. item['full_data_rule'] = full_dict_rule
  477. item['half_data_rule'] = half_dict_rule
  478. # item['zuqiu'] = zuqiu
  479. yield item