roll_zuqiu.py 28 KB

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