zuqiu.py 29 KB

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