zuqiu.py 30 KB

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