roll_zuqiu.py 27 KB

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