roll_zuqiu.py 28 KB

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