zuqiu.py 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. # -*- coding: utf-8 -*-
  2. import copy
  3. import json
  4. import scrapy
  5. from scrapy.http import Request
  6. from .. items import Zuqiu
  7. # from scrapy.spidermiddlewares.httperror import HttpError
  8. # from twisted.internet.error import DNSLookupError
  9. # from twisted.internet.error import TimeoutError
  10. class ZuqiuSpider(scrapy.Spider):
  11. name = 'zuqiu'
  12. allowed_domains = ['hg3535z.com']
  13. custom_settings = {
  14. "ITEM_PIPELINES":{
  15. 'hg3535.pipelines.Zuqiupipeline': 300,
  16. }
  17. }
  18. def start_requests(self):
  19. for y in range(1, 4):
  20. for i in range(10):
  21. url = 'https://hg3535z.com/odds2/d/getodds?sid=1&pt=' + str(y) + '&ubt=' + 'am' + '&pn=' + str(
  22. i) + '&sb=2&dc=null&pid=0'
  23. yield scrapy.Request(url=url, callback=self.parse, meta={'pt': y})
  24. def parse(self, response):
  25. if response.text:
  26. try:
  27. datas = json.loads(response.text).get('n-ot', "").get('egs', "")
  28. except:
  29. datas = ""
  30. pt = copy.copy(response.meta['pt'])
  31. if datas:
  32. for result in datas:
  33. new_results = result['es']
  34. for new_result in new_results:
  35. game_id = str(new_result['i'][16])
  36. if pt is 3:
  37. url = "https://hg3535z.com/odds2/d/getamodds?eid="+game_id+"&iip=false&ubt=am&isp=true"
  38. yield Request(url=url, callback=self.parse_each, meta={'pt': pt})
  39. if pt is 2:
  40. url = "https://hg3535z.com/odds2/d/getamodds?eid="+game_id+"&iip=false&ubt=am&isp=false"
  41. yield Request(url=url, callback=self.parse_each, meta={'pt': pt})
  42. if pt is 1:
  43. url = "https://hg3535z.com/odds2/d/getamodds?eid="+game_id+"&iip=false&ubt=am&isp=false"
  44. yield Request(url=url, callback=self.parse_each, meta={'pt': pt})
  45. def parse_each(self, response):
  46. # 球队进球数 大小
  47. try:
  48. datas = json.loads(response.text)['eg']['es']
  49. league_id = json.loads(response.text)['eg']['c']['k']
  50. # 联赛名
  51. league_name = json.loads(response.text)['eg']['c']['n']
  52. except:
  53. datas = ""
  54. league_id = ""
  55. # 联赛名
  56. league_name = ""
  57. try:
  58. pt = response.meta['pt']
  59. except:
  60. pt = 0
  61. if datas:
  62. item = Zuqiu()
  63. full_dict = {}
  64. half_dict = {}
  65. full_dict_rule = {}
  66. half_dict_rule = {}
  67. for data in datas:
  68. try:
  69. new_data = data['pci']['ctid']
  70. except:
  71. new_data = ""
  72. if new_data == 0:
  73. # 比赛id
  74. game_id = str(data['k'])
  75. # 球队1
  76. team_home = data['i'][0]
  77. # 球队2
  78. team_guest = data['i'][1]
  79. # 数量(97>)
  80. number = data['i'][2]
  81. # 下半场
  82. half_way = data['i'][12]
  83. # 角球或者其他
  84. corner_ball = data['pci'].get('ctn', "")
  85. # 日期
  86. data_game = data['i'][4]
  87. # 开赛时间
  88. time_game = data['i'][5]
  89. # 让球------------------------------------------------------------------------------------------------------------------
  90. try:
  91. concedes = data['o']['ah']['v']
  92. new_concedes = [concedes[i] for i in range(len(concedes)) if i % 2 is 1]
  93. concede_homes = [new_concedes[i] for i in range(len(new_concedes)) if i % 2 is 0]
  94. concede_home_rule = [concede_homes[i] for i in range(len(concede_homes)) if i % 2 is 0]
  95. # concede_home
  96. concede_guests = [new_concedes[i] for i in range(len(new_concedes)) if i % 2 is 1]
  97. # concede_guest_rule
  98. concede_guest_rule = [concede_guests[i] for i in range(len(concede_guests)) if
  99. i % 2 == 0]
  100. if pt is 3:
  101. concede_guest = [round(float(concede_guests[i]) -1, 2) for i in range(len(concede_guests)) if i % 2 is 1]
  102. concede_home = [round(float(concede_homes[i]) - 1, 2) for i in range(len(concede_homes)) if i % 2 is 1]
  103. else:
  104. concede_guest = [concede_guests[i] for i in range(len(concede_guests)) if i % 2 is 1]
  105. concede_home = [concede_homes[i] for i in range(len(concede_homes)) if i % 2 is 1]
  106. except:
  107. concede_guest = ""
  108. concede_guest_rule = ""
  109. concede_home = ""
  110. concede_home_rule = ""
  111. # 上半场让球half_concede-------------------------------------------------------------------------------------------------
  112. try:
  113. half_concedes = data['o']['ah1st']['v']
  114. new_half_concedes = [half_concedes[i] for i in range(len(half_concedes)) if i % 2 is 1]
  115. new_half_concede_homes = [new_half_concedes[i] for i in range(len(new_half_concedes)) if i % 2 == 0]
  116. # half_concede_home_rule
  117. half_concede_home_rule = [new_half_concede_homes[i] for i in
  118. range(len(new_half_concede_homes)) if i % 2 == 0]
  119. # concede_home
  120. half_concede_guests = [new_half_concedes[i] for i in range(len(new_half_concedes)) if i % 2 is 1]
  121. # concede_guest_rule
  122. half_concede_guest_rule = [half_concede_guests[i] for i in
  123. range(len(half_concede_guests)) if i % 2 == 0]
  124. if pt is 3:
  125. half_concede_home = [round(float(new_half_concede_homes[i]) - 1, 2) for i in range(len(new_half_concede_homes)) if i % 2 is 1]
  126. half_concede_guest = [round(float(half_concede_guests[i]) - 1, 2) for i in range(len(half_concede_guests)) if i % 2 is 1]
  127. else:
  128. half_concede_home = [new_half_concede_homes[i] for i in range(len(new_half_concede_homes)) if i % 2 is 1]
  129. half_concede_guest = [half_concede_guests[i] for i in range(len(half_concede_guests)) if i % 2 is 1]
  130. except:
  131. half_concede_home_rule = ""
  132. half_concede_home = ""
  133. half_concede_guest_rule = ""
  134. half_concede_guest = ""
  135. # 全场大小size 进球大小---------------------------------------------------------------------------------------------------
  136. try:
  137. sizes = data['o']['ou']['v']
  138. new_sizes = [sizes[i] for i in range(len(sizes)) if i % 2 is 1]
  139. size_homes = [new_sizes[i] for i in range(len(new_sizes)) if i % 2 is 0]
  140. # size_home_rule
  141. size_home_rule = [size_homes[i] for i in range(len(size_homes)) if i % 2 is 0]
  142. # size_home
  143. size_guests = [new_sizes[i] for i in range(len(new_sizes)) if i % 2 is 1]
  144. # size_guest_rule
  145. size_guest_rule = [size_guests[i] for i in range(len(size_guests)) if i % 2 is 0]
  146. # csize_guest
  147. if pt is 3:
  148. size_guest = [round(float(size_guests[i]) - 1, 2) for i in range(len(size_guests)) if i % 2 is 1]
  149. size_home = [round(float(size_homes[i]) - 1, 2) for i in range(len(size_homes)) if i % 2 is 1]
  150. else:
  151. size_guest = [size_guests[i] for i in range(len(size_guests)) if i % 2 is 1]
  152. size_home = [size_homes[i] for i in range(len(size_homes)) if i % 2 is 1]
  153. except:
  154. size_guest = ""
  155. size_guest_rule = ""
  156. size_home = ""
  157. size_home_rule = ""
  158. # 上半场大小 进球大小 half_size-------------------------------------------------------------------------------------------
  159. try:
  160. half_sizes = data['o']['ou1st']['v']
  161. new_half_sizes = [half_sizes[i] for i in range(len(half_sizes)) if i % 2 is 1]
  162. half_size_homes = [new_half_sizes[i] for i in range(len(new_half_sizes)) if i % 2 is 0]
  163. # size_home_rule
  164. half_size_home_rule = [half_size_homes[i] for i in range(len(half_size_homes)) if
  165. i % 2 is 0]
  166. half_size_guests = [new_half_sizes[i] for i in range(len(new_half_sizes)) if i % 2 is 1]
  167. # half_size_guest_rule 客队
  168. half_size_guest_rule = [half_size_guests[i] for i in range(len(half_size_guests)) if
  169. i % 2 is 0]
  170. # half_size_guest
  171. if pt is 3:
  172. half_size_guest = [round(float(half_size_guests[i]) - 1, 2) for i in range(len(half_size_guests)) if
  173. i % 2 is 1]
  174. half_size_home = [round(float(half_size_homes[i]) - 1, 2) for i in range(len(half_size_homes)) if
  175. i % 2 is 1]
  176. else:
  177. half_size_guest = [half_size_guests[i] for i in range(len(half_size_guests)) if
  178. i % 2 is 1]
  179. half_size_home = [half_size_homes[i] for i in range(len(half_size_homes)) if i % 2 is 1]
  180. except:
  181. half_size_guest = ""
  182. half_size_guest_rule = ""
  183. half_size_home = ""
  184. half_size_home_rule = ""
  185. # 全场总进球 total_goal--------------------------------------------------------------------------------------------------
  186. total_goal = {}
  187. try:
  188. total_goals = data['o']['tg']['v']
  189. new_total_goals = [total_goals[i] for i in range(len(total_goals)) if i % 2 is 1]
  190. total_goal["total_goal_zero"] = round(float(new_total_goals[0]) - 1, 2)
  191. total_goal["total_goal_two"] = round(float(new_total_goals[1]) - 1, 2)
  192. total_goal["total_goal_four"] = round(float(new_total_goals[2]) - 1, 2)
  193. total_goal["total_goal_seven"] = round(float(new_total_goals[3]) - 1, 2)
  194. except:
  195. total_goal["total_goal_zero"] = ""
  196. total_goal["total_goal_two"] = ""
  197. total_goal["total_goal_four"] = ""
  198. total_goal["total_goal_seven"] = ""
  199. # 总进球上半场 half_total_goal-------------------------------------------------------------------------------------------
  200. try:
  201. half_total_goals = data['o']['tg1st']['v']
  202. new_half_total_goals = [half_total_goals[i] for i in range(len(half_total_goals)) if i % 2 is 1]
  203. total_goal["half_total_goal_zero"] = round(float(new_half_total_goals[0]) - 1, 2)
  204. total_goal["half_total_goal_one"] = round(float(new_half_total_goals[1]) - 1, 2)
  205. total_goal["half_total_goal_two"] = round(float(new_half_total_goals[2]) - 1, 2)
  206. total_goal["half_total_goal_three"] = round(float(new_half_total_goals[3]) - 1, 2)
  207. except:
  208. total_goal["half_total_goal_zero"] = ""
  209. total_goal["half_total_goal_one"] = ""
  210. total_goal["half_total_goal_two"] = ""
  211. total_goal["half_total_goal_three"] = ""
  212. # 早盘 半场/全场---------------------------------------------------------------------------------------------------------
  213. half_full = {}
  214. new_lists = ["half_full_home_home", "half_full_home_dogfall", "half_full_home_guest",
  215. "half_full_dogfall_home", "half_full_dogfall_dogfall", "half_full_dogfall_guest",
  216. "half_full_guest_home", "half_full_guest_dogfall", "half_full_guest_guest"]
  217. # 早盘 半场/全场
  218. try:
  219. half_fulls = data['o']['hf']['v']
  220. new_half_fulls = [half_fulls[i] for i in range(len(half_fulls)) if i % 2 is 1]
  221. for index, value in enumerate(new_lists):
  222. half_full[value] = round(float(new_half_fulls[index]) - 1, 2)
  223. except:
  224. for index, value in enumerate(new_lists):
  225. half_full[value] = ""
  226. # 早盘 最先/最后进球 最先进球 ---------------------------------------------------------------------------------------------
  227. first_last_ball = {}
  228. try:
  229. first_balls = data['o']['ttslast']['v']
  230. first_ball = [first_balls[i] for i in range(len(first_balls)) if i % 2 is 1]
  231. first_last_ball['first_ball_home'] = round(float(first_ball[0]) - 1, 2)
  232. first_last_ball['first_ball_guest'] = round(float(first_ball[1]) - 1, 2)
  233. except:
  234. pass
  235. # 早盘 最先/最后进球 最后进球
  236. try:
  237. last_balls = data['o']['tts1st']['v']
  238. last_ball = [last_balls[i] for i in range(len(last_balls)) if i % 2 is 1]
  239. first_last_ball['last_ball_home'] = round(float(last_ball[0]) - 1, 2)
  240. first_last_ball['last_ball_guest'] = round(float(last_ball[1]) - 1, 2)
  241. first_last_ball['not_ball'] = round(float(last_ball[2]) - 1, 2)
  242. except:
  243. pass
  244. # 全场独赢capot ---------------------------------------------------------------------------------------------------------
  245. try:
  246. capots = data['o']['1x2']['v']
  247. new_capots = [capots[i] for i in range(len(capots)) if i % 2 is 1]
  248. capot_home = round(float(new_capots[0]) - 1, 2)
  249. capot_guest = round(float(new_capots[1]) - 1, 2)
  250. capot_dogfall = round(float(new_capots[2]) - 1, 2)
  251. except:
  252. capot_home = ""
  253. capot_guest = ""
  254. capot_dogfall = ""
  255. # 上半场独赢capot
  256. try:
  257. half_capots = data['o']['1x21st']['v']
  258. new_half_capots = [half_capots[i] for i in range(len(half_capots)) if i % 2 is 1]
  259. half_capot_home = round(float(new_half_capots[0]) - 1, 2)
  260. half_capot_guest = round(float(new_half_capots[1]) - 1, 2)
  261. half_capot_dogfall = round(float(new_half_capots[2]) - 1, 2)
  262. except:
  263. half_capot_home = ""
  264. half_capot_guest = ""
  265. half_capot_dogfall = ""
  266. # 全场入球:单/双 odd_even------------------------------------------------------------------------------------------------
  267. try:
  268. odd_evens = data['o']['oe']['v']
  269. new_odd_evens = [odd_evens[i] for i in range(len(odd_evens)) if i % 2 is 1]
  270. if pt is 3:
  271. odd_even_odd = round(float(new_odd_evens[0]) - 1, 2)
  272. odd_even_even = round(float(new_odd_evens[1]) - 1, 2)
  273. else:
  274. odd_even_odd = round(float(new_odd_evens[0]), 2)
  275. odd_even_even = round(float(new_odd_evens[1]), 2)
  276. except:
  277. odd_even_odd = ""
  278. odd_even_even = ""
  279. # 半场入球:单/双 half_odd_even
  280. try:
  281. half_odd_evens = data['o']['oe1st']['v']
  282. new_half_odd_evens = [half_odd_evens[i] for i in range(len(half_odd_evens)) if i % 2 is 1]
  283. if pt is 3:
  284. half_odd_even_odd = round(float(new_half_odd_evens[0]) - 1, 2)
  285. half_odd_even_even = round(float(new_half_odd_evens[1]) - 1, 2)
  286. else:
  287. half_odd_even_odd = new_half_odd_evens[0]
  288. half_odd_even_even = new_half_odd_evens[1]
  289. except:
  290. half_odd_even_odd = ""
  291. half_odd_even_even = ""
  292. bodan_data = {}
  293. # 波胆------------------------------------------------------------------------------------------------------------------
  294. try:
  295. bodans = data['o']['cs']['v']
  296. one_list = ["bodanhome_one_zero", "bodanhome_two_zero", "bodanhome_two_one",
  297. "bodanhome_three_zero", "bodanhome_three_one", "bodanhome_three_two",
  298. "bodanhome_four_zero", "bodanhome_four_one", "bodanhome_four_two",
  299. "bodanhome_four_three"]
  300. two_list = ["bodanguest_one_zero", "bodanguest_two_zero", "bodanguest_two_one",
  301. "bodanguest_three_zero", "bodanguest_three_one", "bodanguest_three_two",
  302. "bodanguest_four_zero", "bodanguest_four_one", "bodanguest_four_two",
  303. "bodanguest_four_three"]
  304. three_list = ["bodandogfall_zero_zero", "bodandogfall_one_one", "bodandogfall_two_two",
  305. "bodandogfall_three_three", "bodandogfall_four_four"]
  306. new_bodans = [bodans[i] for i in range(len(bodans)) if i % 2 is 1]
  307. new_bodan = new_bodans[0:20]
  308. # 主队bodan_home
  309. bodan_home = [new_bodan[i] for i in range(len(new_bodan)) if i % 2 is 0]
  310. for index, t in enumerate(one_list):
  311. bodan_data[t] = round(float(bodan_home[index]) - 1, 2)
  312. # 客队bodan_guest
  313. bodan_guest = [new_bodan[i] for i in range(len(new_bodan)) if i % 2 is 1]
  314. for y, z in enumerate(two_list):
  315. bodan_data[z] = round(float(bodan_guest[y]) - 1, 2)
  316. bodan_dogfall = new_bodans[-7:-2]
  317. for a, b in enumerate(three_list):
  318. bodan_data[b] = round(float(bodan_dogfall[a]) - 1, 2)
  319. # 其他bodan_other
  320. bodan_data['bodanother'] = round(float(new_bodans[-1]) - 1, 2)
  321. except:
  322. pass
  323. try:
  324. half_bodans = data['o']['cs1st']['v']
  325. new_half_bodans = [half_bodans[i] for i in range(len(half_bodans)) if i % 2 is 1]
  326. new_one = ["halfbodanhome_one_zero", "halfbodanhome_two_zero", "halfbodanhome_two_one",
  327. "halfbodanhome_three_zero", "halfbodanhome_three_one", "halfbodanhome_three_two"]
  328. new_two = ["halfbodanguest_one_zero", "halfbodanguest_two_zero", "halfbodanguest_two_one",
  329. "halfbodanguest_three_zero", "halfbodanguest_three_one", "halfbodanguest_three_two"]
  330. new_three = ["halfbodandogfall_zero_zero", "halfbodandogfall_one_one",
  331. "halfbodandogfall_two_two",
  332. "halfbodandogfall_three_three"]
  333. halfbodan = new_half_bodans[0:12]
  334. half_bodan_home = [halfbodan[i] for i in range(len(halfbodan)) if i % 2 is 0]
  335. # 队1
  336. for index, t in enumerate(new_one):
  337. bodan_data[t] = round(float(half_bodan_home[index]) - 1, 2)
  338. # 队2
  339. half_bodan_guest = [halfbodan[i] for i in range(len(halfbodan)) if i % 2 is 1]
  340. for y, z in enumerate(new_two):
  341. bodan_data[z] = round(float(half_bodan_guest[y]) - 1, 2)
  342. # 和/平
  343. half_bodan_dogfall = new_half_bodans[-6:-2]
  344. for a, b in enumerate(new_three):
  345. bodan_data[b] = round(float(half_bodan_dogfall[a]) - 1, 2)
  346. # 其他
  347. bodan_data['halfbodanother'] = round(float(new_half_bodans[-1]) - 1, 2)
  348. except:
  349. pass
  350. if new_data is 12:
  351. try:
  352. home_data = data['o']['ou']['v']
  353. # 球队进球 大条件
  354. full_dict_rule['home_size_big'] = home_data[1]
  355. # 球队进球小条件
  356. full_dict_rule['home_size_small'] = home_data[3]
  357. if pt is 3:
  358. # 球队进球大赔率
  359. full_dict['home_size_big'] = round(float(home_data[5]) - 1, 2)
  360. # 球队进球小赔率
  361. full_dict['home_size_small'] = round(float(home_data[7]) - 1, 2)
  362. else:
  363. # 球队进球大赔率
  364. full_dict['home_size_big'] = home_data[5]
  365. # 球队进球小赔率
  366. full_dict['home_size_small'] = home_data[7]
  367. except:
  368. full_dict['home_size_small'] = ""
  369. full_dict_rule['home_size_small'] = ""
  370. full_dict['home_size_big'] = ""
  371. full_dict_rule['home_size_big'] = ""
  372. try:
  373. half_home_data = data['o']['ou1st']['v']
  374. half_dict_rule['half_home_size_big'] = half_home_data[1]
  375. half_dict_rule['half_home_size_small'] = half_home_data[3]
  376. if pt is 3:
  377. half_dict['half_home_size_big'] = round(float(half_home_data[5]) - 1, 2)
  378. half_dict['half_home_size_small'] = round(float(half_home_data[7]) - 1, 2)
  379. else:
  380. half_home_size_big = half_home_data[5]
  381. half_dict['half_home_size_big'] = half_home_size_big
  382. half_home_size_small = half_home_data[7]
  383. half_dict['half_home_size_small'] = half_home_size_small
  384. except:
  385. half_dict_rule['half_home_size_big'] = ""
  386. half_dict['half_home_size_big'] = ""
  387. half_dict_rule['half_home_size_small'] = ""
  388. half_dict['half_home_size_small'] = ""
  389. if new_data is 13:
  390. try:
  391. guest_data = data['o']['ou']['v']
  392. full_dict_rule['guest_size_big'] = guest_data[1]
  393. full_dict_rule['guest_size_small'] = guest_data[3]
  394. if pt is 3:
  395. full_dict['guest_size_big'] = round(float(guest_data[5]) - 1, 2)
  396. full_dict['guest_size_small'] = round(float(guest_data[7]) - 1, 2)
  397. else:
  398. full_dict['guest_size_big'] = guest_data[5]
  399. full_dict['guest_size_small'] = guest_data[7]
  400. except:
  401. full_dict_rule['guest_size_big'] = ""
  402. full_dict['guest_size_big'] = ""
  403. full_dict_rule['guest_size_small'] = ""
  404. full_dict['guest_size_small'] = ''
  405. try:
  406. half_guest_data = data['o']['ou1st']['v']
  407. half_dict_rule['half_guest_size_big'] = half_guest_data[1]
  408. half_dict_rule['half_guest_size_small'] = half_guest_data[3]
  409. if pt is 3:
  410. half_dict['half_guest_size_big'] = round(float(half_guest_data[5]) - 1, 2)
  411. half_dict['half_guest_size_small'] = round(float(half_guest_data[7]) - 1, 2)
  412. else:
  413. half_dict['half_guest_size_big'] = half_guest_data[5]
  414. half_dict['half_guest_size_small'] = half_guest_data[7]
  415. except:
  416. half_dict_rule['half_guest_size_big'] = ""
  417. half_dict['half_guest_size_big'] = ""
  418. half_dict_rule['half_guest_size_small'] = ""
  419. half_dict['half_guest_size_small'] = ""
  420. item['league_id'] = league_id
  421. item['league_name'] = league_name
  422. item['pt'] = pt
  423. item['game_id'] = game_id
  424. item['team_home'] = team_home
  425. item['team_guest'] = team_guest
  426. item['number'] = number
  427. item['data_game'] = data_game
  428. item['time_game'] = time_game
  429. item['corner_ball'] = corner_ball
  430. # 波胆
  431. item['bodan_data'] = bodan_data
  432. # 早盘入球数单双
  433. item["odd_even_odd"] = odd_even_odd
  434. item["odd_even_even"] = odd_even_even
  435. item["half_odd_even_odd"] = half_odd_even_odd
  436. item["half_odd_even_even"] = half_odd_even_even
  437. item['total_goal'] = total_goal
  438. item["half_capot_home"] = half_capot_home
  439. item["half_capot_guest"] = half_capot_guest
  440. item["half_capot_dogfall"] = half_capot_dogfall
  441. item["capot_home"] = capot_home
  442. item["capot_guest"] = capot_guest
  443. item["capot_dogfall"] = capot_dogfall
  444. item["first_last_ball"] = first_last_ball
  445. item["half_full"] = half_full
  446. item["half_size_guest"] = half_size_guest
  447. item["half_size_guest_rule"] = half_size_guest_rule
  448. item["half_size_home"] = half_size_home
  449. item["half_size_home_rule"] = half_size_home_rule
  450. # 全场大小
  451. item["size_guest"] = size_guest
  452. item["size_guest_rule"] = size_guest_rule
  453. item["size_home"] = size_home
  454. item["size_home_rule"] = size_home_rule
  455. # 上半场让球
  456. item["half_concede_home_rule"] = half_concede_home_rule
  457. item["half_concede_home"] = half_concede_home
  458. item["half_concede_guest_rule"] = half_concede_guest_rule
  459. item["half_concede_guest"] = half_concede_guest
  460. # 全场让球
  461. item["concede_guest"] = concede_guest
  462. item["concede_guest_rule"] = concede_guest_rule
  463. item["concede_home"] = concede_home
  464. item["concede_home_rule"] = concede_home_rule
  465. item['full_data'] = full_dict
  466. item['half_data'] = half_dict
  467. item['full_data_rule'] = full_dict_rule
  468. item['half_data_rule'] = half_dict_rule
  469. yield item