zuqiu.py 29 KB

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