Your Name 6 lat temu
rodzic
commit
adde541563

+ 341 - 151
.idea/workspace.xml

@@ -3,6 +3,31 @@
   <component name="ChangeListManager">
     <list default="true" id="e65dd61d-6e54-407f-b262-e81360eb9ca1" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/items.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/items.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/main.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/pipeline/bangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/pipeline/bangqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/pipeline/lanqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/pipeline/lanqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/pipeline/roll_lanqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/pipeline/roll_lanqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/pipeline/roll_wangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/pipeline/roll_wangqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/pipeline/roll_zuqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/pipeline/roll_zuqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/pipeline/wangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/pipeline/wangqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/pipeline/zuqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/pipeline/zuqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/settings.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/settings.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/spiders/bangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/spiders/bangqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/spiders/bq_jieshu.py" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/spiders/lanqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/spiders/lanqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/spiders/lq_jieshu.py" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/spiders/roll_bangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/spiders/roll_bangqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/spiders/roll_lanqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/spiders/roll_lanqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/spiders/roll_wangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/spiders/roll_wangqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/spiders/roll_zuqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/spiders/roll_zuqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/spiders/wangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/spiders/wangqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/spiders/wq_jieshu.py" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/spiders/wqbodan.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/spiders/wqbodan.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/spiders/zq_jieshu.py" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/spiders/zuqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/spiders/zuqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/hg3535/utils/helper.py" beforeDir="false" afterPath="$PROJECT_DIR$/hg3535/utils/helper.py" afterDir="false" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="SHOW_DIALOG" value="false" />
@@ -11,46 +36,73 @@
     <option name="LAST_RESOLUTION" value="IGNORE" />
   </component>
   <component name="CoverageDataManager">
-    <SUITE FILE_PATH="coverage/sports_scrapy$main.coverage" NAME="main Coverage Results" MODIFIED="1560222827580" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/hg3535" />
+    <SUITE FILE_PATH="coverage/sports_scrapy$main.coverage" NAME="main Coverage Results" MODIFIED="1566808695726" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/hg3535" />
   </component>
   <component name="FileEditorManager">
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
       <file pinned="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/hg3535/main.py">
+        <entry file="file://$PROJECT_DIR$/hg3535/spiders/lanqiu.py">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="409">
+              <caret line="582" column="61" selection-start-line="582" selection-start-column="61" selection-end-line="582" selection-end-column="61" />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/hg3535/spiders/zuqiu.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="304">
-              <caret line="16" column="51" lean-forward="true" selection-start-line="16" selection-start-column="51" selection-end-line="16" selection-end-column="51" />
+            <state relative-caret-position="2088">
+              <caret line="137" lean-forward="true" selection-start-line="137" selection-end-line="137" />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/hg3535/pipeline/wangqiu.py">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="828">
+              <caret line="46" column="52" selection-start-line="46" selection-start-column="52" selection-end-line="46" selection-end-column="52" />
               <folding>
-                <element signature="e#0#10#0" expanded="true" />
+                <element signature="e#0#15#0" expanded="true" />
               </folding>
             </state>
           </provider>
         </entry>
       </file>
       <file pinned="false" current-in-tab="true">
-        <entry file="file://$PROJECT_DIR$/hg3535/pipeline/roll_wangqiu.py">
+        <entry file="file://$PROJECT_DIR$/hg3535/main.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="-218">
-              <caret line="254" column="21" lean-forward="true" selection-start-line="254" selection-start-column="21" selection-end-line="254" selection-end-column="21" />
+            <state relative-caret-position="126">
+              <caret line="7" column="37" selection-start-line="7" selection-start-column="37" selection-end-line="7" selection-end-column="37" />
               <folding>
-                <element signature="e#3107#3142#0" />
-                <element signature="e#3873#3951#0" />
+                <element signature="e#0#10#0" expanded="true" />
               </folding>
             </state>
           </provider>
         </entry>
       </file>
       <file pinned="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/hg3535/spiders/roll_wangqiu.py">
+        <entry file="file://$PROJECT_DIR$/hg3535/pipeline/zuqiu.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="-536">
-              <caret line="287" column="32" lean-forward="true" selection-start-line="287" selection-start-column="32" selection-end-line="287" selection-end-column="32" />
+            <state relative-caret-position="18">
+              <caret line="14" column="109" selection-start-line="14" selection-start-column="41" selection-end-line="14" selection-end-column="111" />
+              <folding>
+                <element signature="e#0#15#0" expanded="true" />
+              </folding>
             </state>
           </provider>
         </entry>
       </file>
     </leaf>
   </component>
+  <component name="FileTemplateManagerImpl">
+    <option name="RECENT_TEMPLATES">
+      <list>
+        <option value="Python Script" />
+      </list>
+    </option>
+  </component>
   <component name="FindInProjectRecents">
     <findStrings>
       <find>zqone_intodb</find>
@@ -60,46 +112,74 @@
       <find>concedes_dict</find>
       <find>all_goal</find>
       <find>team_score_home_dict</find>
+      <find>wq</find>
+      <find>bq</find>
+      <find>z</find>
+      <find>sb</find>
+      <find>copt</find>
+      <find>copy</find>
     </findStrings>
   </component>
   <component name="Git.Settings">
+    <option name="UPDATE_TYPE" value="MERGE" />
     <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+    <favorite-branches>
+      <branch-storage>
+        <map>
+          <entry type="REMOTE">
+            <value>
+              <list>
+                <branch-info repo="$PROJECT_DIR$" source="origin/two" />
+              </list>
+            </value>
+          </entry>
+        </map>
+      </branch-storage>
+    </favorite-branches>
   </component>
   <component name="IdeDocumentHistory">
     <option name="CHANGED_PATHS">
       <list>
         <option value="$PROJECT_DIR$/hg3535/spiders/liansai.py" />
-        <option value="$PROJECT_DIR$/hg3535/spiders/zuqiu.py" />
         <option value="$PROJECT_DIR$/hg3535/spiders/zq_jieshu.py" />
         <option value="$PROJECT_DIR$/hg3535/spiders/roll_zuqiu.py" />
         <option value="$PROJECT_DIR$/hg3535/pipelines.py" />
         <option value="$PROJECT_DIR$/hg3535/ball_func.py" />
+        <option value="$PROJECT_DIR$/hg3535/pipeline/roll_zuqiu.py" />
+        <option value="$PROJECT_DIR$/hg3535/spiders/guanjun.py" />
+        <option value="$PROJECT_DIR$/hg3535/spiders/wqbodan.py" />
+        <option value="$PROJECT_DIR$/hg3535/pipeline/zuqiu.py" />
         <option value="$PROJECT_DIR$/hg3535/settings.py" />
-        <option value="$PROJECT_DIR$/hg3535/spiders/bangqiu.py" />
-        <option value="$PROJECT_DIR$/hg3535/spiders/lanqiu.py" />
+        <option value="$PROJECT_DIR$/hg3535/items.py" />
         <option value="$PROJECT_DIR$/hg3535/spiders/wangqiu.py" />
+        <option value="$PROJECT_DIR$/hg3535/spiders/lanqiu.py" />
+        <option value="$PROJECT_DIR$/hg3535/pipeline/lanqiu.py" />
+        <option value="$PROJECT_DIR$/hg3535/pipeline/wangqiu.py" />
         <option value="$PROJECT_DIR$/hg3535/spiders/roll_bangqiu.py" />
+        <option value="$PROJECT_DIR$/hg3535/spiders/roll_lanqiu.py" />
+        <option value="$PROJECT_DIR$/hg3535/pipeline/roll_bangqiu.py" />
+        <option value="$PROJECT_DIR$/hg3535/spiders/zuqiu.py" />
+        <option value="$PROJECT_DIR$/hg3535/pipeline/roll_lanqiu.py" />
+        <option value="$PROJECT_DIR$/hg3535/pipeline/roll_wangqiu.py" />
         <option value="$PROJECT_DIR$/hg3535/spiders/roll_wangqiu.py" />
-        <option value="$PROJECT_DIR$/hg3535/items.py" />
-        <option value="$PROJECT_DIR$/hg3535/pipeline/zuqiu.py" />
-        <option value="$PROJECT_DIR$/hg3535/pipeline/wangqiu.py" />
+        <option value="$PROJECT_DIR$/hg3535/spiders/bangqiu.py" />
         <option value="$PROJECT_DIR$/hg3535/pipeline/bangqiu.py" />
         <option value="$PROJECT_DIR$/hg3535/main.py" />
-        <option value="$PROJECT_DIR$/hg3535/pipeline/roll_wangqiu.py" />
       </list>
     </option>
   </component>
   <component name="ProjectFrameBounds" extendedState="6">
-    <option name="x" value="-9" />
-    <option name="y" value="-9" />
-    <option name="width" value="1938" />
-    <option name="height" value="1048" />
+    <option name="x" value="-8" />
+    <option name="y" value="-8" />
+    <option name="width" value="1936" />
+    <option name="height" value="1066" />
   </component>
   <component name="ProjectView">
     <navigator proportions="" version="1">
       <foldersAlwaysOnTop value="true" />
     </navigator>
     <panes>
+      <pane id="Scope" />
       <pane id="ProjectPane">
         <subPane>
           <expand>
@@ -124,17 +204,23 @@
               <item name="hg3535" type="462c0819:PsiDirectoryNode" />
               <item name="spiders" type="462c0819:PsiDirectoryNode" />
             </path>
+            <path>
+              <item name="sports_scrapy" type="b2602c69:ProjectViewProjectNode" />
+              <item name="sports_scrapy" type="462c0819:PsiDirectoryNode" />
+              <item name="hg3535" type="462c0819:PsiDirectoryNode" />
+              <item name="utils" type="462c0819:PsiDirectoryNode" />
+            </path>
           </expand>
           <select />
         </subPane>
       </pane>
-      <pane id="Scope" />
     </panes>
   </component>
   <component name="PropertiesComponent">
     <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
     <property name="WebServerToolWindowFactoryState" value="false" />
-    <property name="last_opened_file_path" value="$USER_HOME$/Desktop/sports_scrapy/sports_scrapy" />
+    <property name="ignore_missing_gitignore" value="true" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
     <property name="node.js.detected.package.eslint" value="true" />
     <property name="node.js.detected.package.tslint" value="true" />
     <property name="node.js.path.for.package.eslint" value="project" />
@@ -161,7 +247,7 @@
       </list>
     </option>
   </component>
-  <component name="RunManager">
+  <component name="RunManager" selected="Python.main">
     <configuration name="main" type="PythonConfigurationType" factoryName="Python" temporary="true">
       <module name="sports_scrapy" />
       <option name="INTERPRETER_OPTIONS" value="" />
@@ -184,9 +270,32 @@
       <option name="INPUT_FILE" value="" />
       <method v="2" />
     </configuration>
+    <configuration name="zq_jieshu" type="PythonConfigurationType" factoryName="Python" temporary="true">
+      <module name="sports_scrapy" />
+      <option name="INTERPRETER_OPTIONS" value="" />
+      <option name="PARENT_ENVS" value="true" />
+      <envs>
+        <env name="PYTHONUNBUFFERED" value="1" />
+      </envs>
+      <option name="SDK_HOME" value="" />
+      <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/hg3535/spiders" />
+      <option name="IS_MODULE_SDK" value="true" />
+      <option name="ADD_CONTENT_ROOTS" value="true" />
+      <option name="ADD_SOURCE_ROOTS" value="true" />
+      <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
+      <option name="SCRIPT_NAME" value="$PROJECT_DIR$/hg3535/spiders/zq_jieshu.py" />
+      <option name="PARAMETERS" value="" />
+      <option name="SHOW_COMMAND_LINE" value="false" />
+      <option name="EMULATE_TERMINAL" value="false" />
+      <option name="MODULE_MODE" value="false" />
+      <option name="REDIRECT_INPUT" value="false" />
+      <option name="INPUT_FILE" value="" />
+      <method v="2" />
+    </configuration>
     <recent_temporary>
       <list>
         <item itemvalue="Python.main" />
+        <item itemvalue="Python.zq_jieshu" />
       </list>
     </recent_temporary>
   </component>
@@ -210,7 +319,17 @@
       <workItem from="1560317954184" duration="1442000" />
       <workItem from="1560394945986" duration="586000" />
       <workItem from="1564469861451" duration="29000" />
-      <workItem from="1564555324993" duration="6794000" />
+      <workItem from="1564555324993" duration="23098000" />
+      <workItem from="1564621478028" duration="26298000" />
+      <workItem from="1564707856196" duration="22190000" />
+      <workItem from="1564794672870" duration="5612000" />
+      <workItem from="1564967102728" duration="10541000" />
+      <workItem from="1565053460072" duration="19520000" />
+      <workItem from="1565139522171" duration="24225000" />
+      <workItem from="1565226542176" duration="931000" />
+      <workItem from="1565834412510" duration="2427000" />
+      <workItem from="1566802759745" duration="74000" />
+      <workItem from="1566807535416" duration="1886000" />
     </task>
     <task id="LOCAL-00001" summary="更新">
       <created>1559729951030</created>
@@ -219,32 +338,49 @@
       <option name="project" value="LOCAL" />
       <updated>1559729951030</updated>
     </task>
-    <option name="localTasksCounter" value="2" />
+    <task id="LOCAL-00002" summary="更新">
+      <created>1564562316754</created>
+      <option name="number" value="00002" />
+      <option name="presentableId" value="LOCAL-00002" />
+      <option name="project" value="LOCAL" />
+      <updated>1564562316754</updated>
+    </task>
+    <option name="localTasksCounter" value="3" />
     <servers />
   </component>
   <component name="TimeTrackingManager">
-    <option name="totallyTimeSpent" value="17379000" />
+    <option name="totallyTimeSpent" value="147387000" />
+  </component>
+  <component name="TodoView">
+    <todo-panel id="selected-file">
+      <is-autoscroll-to-source value="true" />
+    </todo-panel>
+    <todo-panel id="all">
+      <are-packages-shown value="true" />
+      <is-autoscroll-to-source value="true" />
+    </todo-panel>
   </component>
   <component name="ToolWindowManager">
-    <frame x="-7" y="-7" width="1550" height="838" extended-state="6" />
+    <frame x="-8" y="-8" width="1936" height="1066" extended-state="6" />
     <editor active="true" />
     <layout>
-      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.13739946" />
+      <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.12526652" />
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
       <window_info id="Favorites" order="2" side_tool="true" />
       <window_info anchor="bottom" id="Message" order="0" />
       <window_info anchor="bottom" id="Find" order="1" />
-      <window_info anchor="bottom" id="Run" order="2" sideWeight="0.49946696" weight="0.7025496" />
-      <window_info anchor="bottom" id="Debug" order="3" weight="0.398017" />
+      <window_info anchor="bottom" id="Run" order="2" sideWeight="0.49865952" weight="0.40879828" />
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.4688841" />
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
-      <window_info anchor="bottom" id="TODO" order="6" />
+      <window_info anchor="bottom" id="TODO" order="6" weight="0.3286119" />
       <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
-      <window_info anchor="bottom" id="Version Control" order="8" />
+      <window_info anchor="bottom" id="Version Control" order="8" sideWeight="0.49932975" weight="0.3286119" />
       <window_info anchor="bottom" id="Database Changes" order="9" />
-      <window_info anchor="bottom" id="Event Log" order="10" sideWeight="0.50053304" side_tool="true" weight="0.4158628" />
+      <window_info anchor="bottom" id="Event Log" order="10" sideWeight="0.5013405" side_tool="true" weight="0.5410765" />
       <window_info anchor="bottom" id="Terminal" order="11" />
       <window_info anchor="bottom" id="Python Console" order="12" />
+      <window_info anchor="bottom" id="Concurrent Activities Diagram" order="13" weight="0.3286119" />
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@@ -254,22 +390,23 @@
       <window_info anchor="right" id="Database" order="6" />
     </layout>
     <layout-to-restore>
-      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.13739946" />
+      <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.1598579" />
       <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
       <window_info id="Favorites" order="2" side_tool="true" />
       <window_info anchor="bottom" id="Message" order="0" />
       <window_info anchor="bottom" id="Find" order="1" />
-      <window_info anchor="bottom" id="Run" order="2" sideWeight="0.49946696" weight="0.71529746" />
-      <window_info anchor="bottom" id="Debug" order="3" weight="0.398017" />
+      <window_info anchor="bottom" id="Run" order="2" sideWeight="0.49865952" weight="0.76628894" />
+      <window_info anchor="bottom" id="Debug" order="3" weight="0.5609065" />
       <window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
       <window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
-      <window_info anchor="bottom" id="TODO" order="6" />
+      <window_info anchor="bottom" id="TODO" order="6" weight="0.3286119" />
       <window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
-      <window_info anchor="bottom" id="Version Control" order="8" />
+      <window_info anchor="bottom" id="Version Control" order="8" sideWeight="0.49932975" weight="0.3286119" />
       <window_info anchor="bottom" id="Database Changes" order="9" />
-      <window_info anchor="bottom" id="Event Log" order="10" sideWeight="0.50053304" side_tool="true" weight="0.4158628" />
+      <window_info anchor="bottom" id="Event Log" order="10" sideWeight="0.5013405" side_tool="true" weight="0.5410765" />
       <window_info anchor="bottom" id="Terminal" order="11" />
       <window_info anchor="bottom" id="Python Console" order="12" />
+      <window_info anchor="bottom" id="Concurrent Activities Diagram" order="13" weight="0.3286119" />
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@@ -290,15 +427,21 @@
     <breakpoint-manager>
       <breakpoints>
         <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
-          <url>file://$PROJECT_DIR$/hg3535/spiders/bangqiu.py</url>
-          <line>79</line>
-          <option name="timeStamp" value="5" />
+          <url>file://$PROJECT_DIR$/hg3535/spiders/lanqiu.py</url>
+          <line>279</line>
+          <option name="timeStamp" value="19" />
+        </line-breakpoint>
+        <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
+          <url>file://$PROJECT_DIR$/hg3535/spiders/zuqiu.py</url>
+          <line>31</line>
+          <option name="timeStamp" value="21" />
         </line-breakpoint>
       </breakpoints>
     </breakpoint-manager>
   </component>
   <component name="com.intellij.coverage.CoverageDataManagerImpl">
-    <SUITE FILE_PATH="coverage/sports_scrapy$main.coverage" NAME="main Coverage Results" MODIFIED="1564561506347" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/hg3535" />
+    <SUITE FILE_PATH="coverage/sports_scrapy$zq_jieshu.coverage" NAME="zq_jieshu Coverage Results" MODIFIED="1564575535619" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/hg3535/spiders" />
+    <SUITE FILE_PATH="coverage/sports_scrapy$main.coverage" NAME="main Coverage Results" MODIFIED="1565141616889" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/hg3535" />
   </component>
   <component name="editorHistoryManager">
     <entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python36/Lib/site-packages/twisted/internet/defer.py" />
@@ -310,219 +453,266 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/liansai.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/bq_jieshu.py" />
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/lq_jieshu.py" />
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/wq_jieshu.py" />
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/zq_jieshu.py" />
+    <entry file="file://$PROJECT_DIR$/hg3535/main_time.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="216">
-          <caret line="20" selection-start-line="20" selection-end-line="21" selection-end-column="102" />
+        <state>
+          <folding>
+            <element signature="e#0#11#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/guanjun.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/pipelines.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-108" />
+        <state relative-caret-position="3459">
+          <caret line="1521" column="124" selection-start-line="1521" selection-start-column="116" selection-end-line="1521" selection-end-column="124" />
+          <folding>
+            <element signature="e#0#11#0" expanded="true" />
+            <element signature="e#669#21268#0" />
+            <element signature="e#21421#30104#0" />
+            <element signature="e#30258#39023#0" />
+            <element signature="e#39179#44257#0" />
+            <element signature="e#44411#52656#0" />
+            <element signature="e#52807#59116#0" />
+            <element signature="e#59267#67129#0" />
+            <element signature="e#99113#114232#0" />
+            <element signature="e#114285#128669#0" />
+            <element signature="e#128824#130221#0" />
+            <element signature="e#130377#131775#0" />
+            <element signature="e#131932#133367#0" />
+            <element signature="e#133524#134959#0" />
+          </folding>
+        </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/bq_jieshu.py">
-      <provider selected="true" editor-type-id="text-editor" />
-    </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/zuqiu.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/ball_func.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="198">
-          <caret line="21" selection-start-line="21" selection-end-line="22" selection-end-column="101" />
+        <state relative-caret-position="8189">
+          <caret line="433" column="35" selection-start-line="433" selection-start-column="35" selection-end-line="433" selection-end-column="35" />
+          <folding>
+            <element signature="e#0#15#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/lq_jieshu.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/.gitignore">
       <provider selected="true" editor-type-id="text-editor" />
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/roll_zuqiu.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/guanjun.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="72">
-          <caret line="20" selection-start-line="20" selection-end-line="21" selection-end-column="104" />
-          <folding>
-            <element signature="e#24#35#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="24">
+          <caret line="35" column="45" lean-forward="true" selection-start-line="35" selection-start-column="45" selection-end-line="35" selection-end-column="45" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/wq_jieshu.py">
-      <provider selected="true" editor-type-id="text-editor" />
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/liansai.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="273">
+          <caret line="23" lean-forward="true" selection-start-line="23" selection-end-line="23" />
+        </state>
+      </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/wqbodan.py">
+    <entry file="file://$PROJECT_DIR$/../../sports_scrapy/sports_scrapy/hg3535/pipelines.py" />
+    <entry file="file://C:/新建文件夹/sports_scrapy/sports_scrapy/hg3535/pipeline/zuqiu.py" />
+    <entry file="file://C:/常用软件/sports_scrapy/sports_scrapy/hg3535/pipeline/zuqiu.py" />
+    <entry file="file://$PROJECT_DIR$/../../tn_sportslst.py" />
+    <entry file="file://$PROJECT_DIR$/hg3535/settings.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="252">
-          <caret line="22" column="5" lean-forward="true" selection-start-line="22" selection-start-column="5" selection-end-line="22" selection-end-column="5" />
+        <state relative-caret-position="-4">
+          <caret line="37" column="25" lean-forward="true" selection-start-line="37" selection-start-column="25" selection-end-line="37" selection-end-column="25" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/zq_jieshu.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/wqbodan.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="234">
-          <caret line="18" selection-start-line="18" selection-end-line="19" selection-end-column="104" />
+        <state relative-caret-position="200">
+          <caret line="19" column="10" lean-forward="true" selection-start-line="19" selection-start-column="10" selection-end-line="19" selection-end-column="10" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/main_time.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/items.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state>
+        <state relative-caret-position="471">
+          <caret line="450" column="36" lean-forward="true" selection-start-line="450" selection-start-column="36" selection-end-line="450" selection-end-column="36" />
           <folding>
-            <element signature="e#0#11#0" expanded="true" />
+            <element signature="e#320#1258#0" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/roll_lanqiu.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/pipeline/roll_zuqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-3085">
-          <caret selection-end-line="1" />
+        <state relative-caret-position="3663">
+          <caret line="577" column="13" selection-start-line="577" selection-start-column="13" selection-end-line="577" selection-end-column="13" />
+          <folding>
+            <element signature="e#18#32#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/pipelines.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/roll_zuqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="3459">
-          <caret line="1521" column="124" selection-start-line="1521" selection-start-column="116" selection-end-line="1521" selection-end-column="124" />
+        <state relative-caret-position="228">
+          <caret line="12" column="33" lean-forward="true" selection-start-line="12" selection-start-column="33" selection-end-line="12" selection-end-column="33" />
           <folding>
-            <element signature="e#0#11#0" expanded="true" />
-            <element signature="e#669#21268#0" />
-            <element signature="e#21421#30104#0" />
-            <element signature="e#30258#39023#0" />
-            <element signature="e#39179#44257#0" />
-            <element signature="e#44411#52656#0" />
-            <element signature="e#52807#59116#0" />
-            <element signature="e#59267#67129#0" />
-            <element signature="e#99113#114232#0" />
-            <element signature="e#114285#128669#0" />
-            <element signature="e#128824#130221#0" />
-            <element signature="e#130377#131775#0" />
-            <element signature="e#131932#133367#0" />
-            <element signature="e#133524#134959#0" />
+            <element signature="e#24#35#0" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/settings.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/wangqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="2850">
-          <caret line="150" selection-start-line="150" selection-end-line="154" selection-end-column="26" />
+        <state relative-caret-position="285">
+          <caret line="22" column="5" selection-start-line="22" selection-start-column="5" selection-end-line="22" selection-end-column="5" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/ball_func.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/utils/helper.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="8189">
-          <caret line="433" column="35" selection-start-line="433" selection-start-column="35" selection-end-line="433" selection-end-column="35" />
-          <folding>
-            <element signature="e#0#15#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="95">
+          <caret line="8" column="8" selection-start-line="8" selection-start-column="8" selection-end-line="8" selection-end-column="8" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/.gitignore">
-      <provider selected="true" editor-type-id="text-editor" />
-    </entry>
     <entry file="file://$PROJECT_DIR$/hg3535/pipeline/guanjun.py">
-      <provider selected="true" editor-type-id="text-editor" />
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="404">
+          <caret line="98" column="48" selection-start-line="98" selection-start-column="48" selection-end-line="98" selection-end-column="48" />
+        </state>
+      </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/lanqiu.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/pipeline/lanqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="16302">
-          <caret line="864" selection-start-line="864" selection-end-line="864" />
+        <state relative-caret-position="-1159">
+          <caret line="286" column="34" selection-start-line="286" selection-start-column="32" selection-end-line="286" selection-end-column="34" />
+          <folding>
+            <element signature="e#0#15#0" expanded="true" />
+            <element signature="e#3305#3340#0" />
+            <element signature="e#4133#4216#0" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/wangqiu.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/pipeline/roll_bangqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="342">
-          <caret line="25" column="82" lean-forward="true" selection-start-line="25" selection-start-column="82" selection-end-line="25" selection-end-column="82" />
+        <state relative-caret-position="-1102">
+          <caret line="181" column="46" selection-start-line="181" selection-start-column="46" selection-end-line="181" selection-end-column="46" />
+          <folding>
+            <element signature="e#0#15#0" expanded="true" />
+            <element signature="e#2811#2846#0" />
+            <element signature="e#3576#3654#0" />
+          </folding>
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/hg3535/spiders/roll_bangqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="342">
-          <caret line="53" column="12" lean-forward="true" selection-start-line="53" selection-start-column="12" selection-end-line="53" selection-end-column="12" />
+        <state relative-caret-position="-1767">
+          <caret line="172" column="51" lean-forward="true" selection-start-line="172" selection-start-column="51" selection-end-line="172" selection-end-column="51" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/pipeline/lanqiu.py">
-      <provider selected="true" editor-type-id="text-editor" />
+    <entry file="file://$PROJECT_DIR$/hg3535/pipeline/roll_lanqiu.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="1925">
+          <caret line="249" column="33" selection-start-line="249" selection-start-column="33" selection-end-line="249" selection-end-column="33" />
+          <folding>
+            <element signature="e#0#14#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/pipeline/zuqiu.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/roll_lanqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="38">
-          <caret line="2" column="11" selection-start-line="2" selection-start-column="11" selection-end-line="2" selection-end-column="11" />
+        <state>
+          <caret line="99" column="18" lean-forward="true" selection-start-line="99" selection-start-column="18" selection-end-line="99" selection-end-column="18" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/pipeline/wangqiu.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/pipeline/roll_wangqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="884">
-          <caret line="105" lean-forward="true" selection-start-line="105" selection-end-line="105" />
+        <state relative-caret-position="1349">
+          <caret line="254" column="21" selection-start-line="254" selection-start-column="21" selection-end-line="254" selection-end-column="21" />
           <folding>
             <element signature="e#0#15#0" expanded="true" />
+            <element signature="e#3107#3142#0" />
+            <element signature="e#3873#3951#0" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/items.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/roll_wangqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="167">
-          <caret line="254" column="24" selection-start-line="254" selection-start-column="4" selection-end-line="254" selection-end-column="24" />
+        <state relative-caret-position="1311">
+          <caret line="284" column="37" lean-forward="true" selection-start-line="284" selection-start-column="37" selection-end-line="284" selection-end-column="37" />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/bangqiu.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="352">
+          <caret line="245" column="39" lean-forward="true" selection-start-line="245" selection-start-column="39" selection-end-line="245" selection-end-column="39" />
           <folding>
-            <element signature="e#320#1258#0" />
+            <element signature="e#24#35#0" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
     <entry file="file://$PROJECT_DIR$/hg3535/pipeline/bangqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="314">
-          <caret line="114" lean-forward="true" selection-start-line="114" selection-end-line="114" />
+        <state relative-caret-position="-220">
+          <caret line="221" column="25" lean-forward="true" selection-start-line="221" selection-start-column="25" selection-end-line="221" selection-end-column="25" />
           <folding>
             <element signature="e#0#15#0" expanded="true" />
+            <element signature="e#12859#12871#0" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/bangqiu.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/pipeline/wangqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="583">
-          <caret line="266" lean-forward="true" selection-start-line="266" selection-end-line="266" />
+        <state relative-caret-position="828">
+          <caret line="46" column="52" selection-start-line="46" selection-start-column="52" selection-end-line="46" selection-end-column="52" />
+          <folding>
+            <element signature="e#0#15#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/spiders/roll_wangqiu.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/pipeline/zuqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-536">
-          <caret line="287" column="32" lean-forward="true" selection-start-line="287" selection-start-column="32" selection-end-line="287" selection-end-column="32" />
+        <state relative-caret-position="18">
+          <caret line="14" column="109" selection-start-line="14" selection-start-column="41" selection-end-line="14" selection-end-column="111" />
+          <folding>
+            <element signature="e#0#15#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$USER_HOME$/Desktop/tn_sportslst.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/zuqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="50">
-          <caret line="491" column="33" lean-forward="true" selection-start-line="491" selection-start-column="33" selection-end-line="491" selection-end-column="33" />
+        <state relative-caret-position="2088">
+          <caret line="137" lean-forward="true" selection-start-line="137" selection-end-line="137" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/main.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/spiders/lanqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="304">
-          <caret line="16" column="51" lean-forward="true" selection-start-line="16" selection-start-column="51" selection-end-line="16" selection-end-column="51" />
-          <folding>
-            <element signature="e#0#10#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="409">
+          <caret line="582" column="61" selection-start-line="582" selection-start-column="61" selection-end-line="582" selection-end-column="61" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/hg3535/pipeline/roll_wangqiu.py">
+    <entry file="file://$PROJECT_DIR$/hg3535/main.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-218">
-          <caret line="254" column="21" lean-forward="true" selection-start-line="254" selection-start-column="21" selection-end-line="254" selection-end-column="21" />
+        <state relative-caret-position="126">
+          <caret line="7" column="37" selection-start-line="7" selection-start-column="37" selection-end-line="7" selection-end-column="37" />
           <folding>
-            <element signature="e#3107#3142#0" />
-            <element signature="e#3873#3951#0" />
+            <element signature="e#0#10#0" expanded="true" />
           </folding>
         </state>
       </provider>

+ 259 - 193
hg3535/.idea/workspace.xml

@@ -2,15 +2,32 @@
 <project version="4">
   <component name="ChangeListManager">
     <list default="true" id="7fa42e97-ddea-4404-91db-5a9ccc162649" name="Default Changelist" comment="updata">
-      <change afterPath="$PROJECT_DIR$/pipeline/__init__.py" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/../.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/items.py" beforeDir="false" afterPath="$PROJECT_DIR$/items.py" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/pipeline/ball_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/pipeline/ball_func.py" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/pipeline/guanjun.py" beforeDir="false" afterPath="$PROJECT_DIR$/pipeline/guanjun.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/pipeline/bangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/pipeline/bangqiu.py" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/pipeline/lanqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/pipeline/lanqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/pipeline/roll_lanqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/pipeline/roll_lanqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/pipeline/roll_wangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/pipeline/roll_wangqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/pipeline/roll_zuqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/pipeline/roll_zuqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/pipeline/wangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/pipeline/wangqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/pipeline/zuqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/pipeline/zuqiu.py" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/settings.py" beforeDir="false" afterPath="$PROJECT_DIR$/settings.py" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/spiders/guanjun.py" beforeDir="false" afterPath="$PROJECT_DIR$/spiders/guanjun.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/spiders/bangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/spiders/bangqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/spiders/bq_jieshu.py" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/spiders/lanqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/spiders/lanqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/spiders/lq_jieshu.py" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/spiders/roll_bangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/spiders/roll_bangqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/spiders/roll_lanqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/spiders/roll_lanqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/spiders/roll_wangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/spiders/roll_wangqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/spiders/roll_zuqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/spiders/roll_zuqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/spiders/wangqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/spiders/wangqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/spiders/wq_jieshu.py" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/spiders/wqbodan.py" beforeDir="false" afterPath="$PROJECT_DIR$/spiders/wqbodan.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/spiders/zq_jieshu.py" beforeDir="false" />
+      <change beforePath="$PROJECT_DIR$/spiders/zuqiu.py" beforeDir="false" afterPath="$PROJECT_DIR$/spiders/zuqiu.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/utils/helper.py" beforeDir="false" afterPath="$PROJECT_DIR$/utils/helper.py" afterDir="false" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="SHOW_DIALOG" value="false" />
@@ -20,7 +37,7 @@
   </component>
   <component name="CoverageDataManager">
     <SUITE FILE_PATH="coverage/hg3535$items.coverage" NAME="items Coverage Results" MODIFIED="1554291398794" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
-    <SUITE FILE_PATH="coverage/hg3535$main.coverage" NAME="main Coverage Results" MODIFIED="1564480710470" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
+    <SUITE FILE_PATH="coverage/hg3535$main.coverage" NAME="main Coverage Results" MODIFIED="1566886233881" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
     <SUITE FILE_PATH="coverage/hg3535$hgjieshu.coverage" NAME="hgjieshu Coverage Results" MODIFIED="1558494720094" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/spiders" />
     <SUITE FILE_PATH="coverage/hg3535$halffull.coverage" NAME="halffull Coverage Results" MODIFIED="1554544334424" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/spiders" />
     <SUITE FILE_PATH="coverage/hg3535$pipelines.coverage" NAME="pipelines Coverage Results" MODIFIED="1554290866137" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
@@ -49,62 +66,71 @@
   <component name="FileEditorManager">
     <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
       <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/main.py">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="198">
+              <caret line="13" column="41" selection-start-line="13" selection-start-column="41" selection-end-line="13" selection-end-column="41" />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file pinned="false" current-in-tab="true">
         <entry file="file://$PROJECT_DIR$/settings.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="346">
-              <caret line="180" lean-forward="true" selection-start-line="180" selection-end-line="180" />
+            <state relative-caret-position="-2584">
+              <caret line="31" column="21" selection-start-line="31" selection-start-column="21" selection-end-line="31" selection-end-column="21" />
             </state>
           </provider>
         </entry>
       </file>
       <file pinned="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/spiders/guanjun.py">
+        <entry file="file://$PROJECT_DIR$/middlewares.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="180">
-              <caret line="10" lean-forward="true" selection-start-line="10" selection-end-line="10" />
-              <folding>
-                <element signature="e#38#53#0" expanded="true" />
-              </folding>
+            <state relative-caret-position="259">
+              <caret line="134" selection-start-line="134" selection-end-line="134" />
             </state>
           </provider>
         </entry>
       </file>
       <file pinned="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/pipeline/lanqiu.py">
+        <entry file="file://$PROJECT_DIR$/pipelines.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="156">
-              <caret line="150" selection-start-line="150" selection-end-line="218" selection-end-column="21" />
-              <folding>
-                <element signature="e#49#60#0" expanded="true" />
-              </folding>
+            <state relative-caret-position="691">
+              <caret line="1294" column="17" selection-start-line="1294" selection-start-column="17" selection-end-line="1294" selection-end-column="17" />
             </state>
           </provider>
         </entry>
       </file>
-      <file pinned="false" current-in-tab="true">
-        <entry file="file://$PROJECT_DIR$/pipeline/guanjun.py">
+      <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/spiders/zuqiu.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="576">
-              <caret line="32" column="57" selection-start-line="32" selection-start-column="57" selection-end-line="32" selection-end-column="57" />
-              <folding>
-                <element signature="e#18#32#0" expanded="true" />
-              </folding>
+            <state relative-caret-position="468">
+              <caret line="38" selection-start-line="38" selection-end-line="38" />
             </state>
           </provider>
         </entry>
       </file>
       <file pinned="false" current-in-tab="false">
-        <entry file="file://$PROJECT_DIR$/pipeline/ball_func.py">
+        <entry file="file://$PROJECT_DIR$/pipeline/zuqiu.py">
           <provider selected="true" editor-type-id="text-editor">
-            <state relative-caret-position="7">
-              <caret line="4" lean-forward="true" selection-start-line="4" selection-end-line="4" />
+            <state relative-caret-position="12024">
+              <caret line="683" column="137" selection-start-line="683" selection-start-column="137" selection-end-line="683" selection-end-column="137" />
               <folding>
-                <element signature="e#0#15#0" expanded="true" />
+                <element signature="e#0#14#0" expanded="true" />
               </folding>
             </state>
           </provider>
         </entry>
       </file>
+      <file pinned="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/utils/helper.py">
+          <provider selected="true" editor-type-id="text-editor">
+            <state relative-caret-position="144">
+              <caret line="11" column="97" selection-start-line="11" selection-start-column="84" selection-end-line="11" selection-end-column="113" />
+            </state>
+          </provider>
+        </entry>
+      </file>
     </leaf>
   </component>
   <component name="FileTemplateManagerImpl">
@@ -116,15 +142,11 @@
   </component>
   <component name="FindInProjectRecents">
     <findStrings>
-      <find>pid</find>
-      <find>corner_ball</find>
-      <find>print</find>
       <find>match_id</find>
       <find>half_concede_home</find>
       <find>conn</find>
       <find>result</find>
       <find>score_home</find>
-      <find>capots_dict</find>
       <find>half_size_home</find>
       <find>last_number</find>
       <find>total_goals</find>
@@ -146,7 +168,14 @@
       <find>get_pcode</find>
       <find>match_time</find>
       <find>three_total_sizes_big</find>
+      <find>None</find>
+      <find>lastnumber_dict</find>
+      <find>last_numbers_dict</find>
+      <find>capots_dict</find>
     </findStrings>
+    <replaceStrings>
+      <replace>&quot;&quot;</replace>
+    </replaceStrings>
   </component>
   <component name="Git.Settings">
     <option name="UPDATE_TYPE" value="MERGE" />
@@ -193,11 +222,6 @@
   <component name="IdeDocumentHistory">
     <option name="CHANGED_PATHS">
       <list>
-        <option value="$PROJECT_DIR$/spiders/lanqiuls.py" />
-        <option value="$PROJECT_DIR$/spiders/testone.py" />
-        <option value="$PROJECT_DIR$/spiders/wgbodan.py" />
-        <option value="$PROJECT_DIR$/jianting.py" />
-        <option value="$PROJECT_DIR$/requirements.txt" />
         <option value="$PROJECT_DIR$/log/zuqiu_log.log" />
         <option value="$PROJECT_DIR$/log/ball_status.log" />
         <option value="$PROJECT_DIR$/log/bangqiu.log" />
@@ -218,7 +242,6 @@
         <option value="$PROJECT_DIR$/text.py" />
         <option value="$PROJECT_DIR$/middlewares.py" />
         <option value="$PROJECT_DIR$/spiders/hg3535_zq_status_up.py" />
-        <option value="$PROJECT_DIR$/spiders/lanqiu.py" />
         <option value="$PROJECT_DIR$/spiders/hgjieshu.py" />
         <option value="$PROJECT_DIR$/spiders/hg3535_bangqiu.py" />
         <option value="$PROJECT_DIR$/items.py" />
@@ -232,25 +255,31 @@
         <option value="$PROJECT_DIR$/ball_func.py" />
         <option value="$PROJECT_DIR$/spiders/bangqiu.py" />
         <option value="$PROJECT_DIR$/spiders/roll_bangqiu.py" />
-        <option value="$PROJECT_DIR$/spiders/roll_zuqiu.py" />
         <option value="$PROJECT_DIR$/spiders/zq_jieshu.py" />
         <option value="$PROJECT_DIR$/pipelines.py" />
         <option value="$PROJECT_DIR$/spiders/roll_wangqiu.py" />
-        <option value="$PROJECT_DIR$/spiders/zuqiu.py" />
         <option value="$PROJECT_DIR$/.gitignore" />
-        <option value="$PROJECT_DIR$/main.py" />
-        <option value="$PROJECT_DIR$/settings.py" />
         <option value="$PROJECT_DIR$/spiders/guanjun.py" />
         <option value="$PROJECT_DIR$/pipeline/ball_func.py" />
-        <option value="$PROJECT_DIR$/pipeline/lanqiu.py" />
         <option value="$PROJECT_DIR$/pipeline/guanjun.py" />
+        <option value="$PROJECT_DIR$/spiders/zuqiu.py" />
+        <option value="$PROJECT_DIR$/spiders/roll_zuqiu.py" />
+        <option value="$PROJECT_DIR$/pipeline/roll_zuqiu.py" />
+        <option value="$PROJECT_DIR$/spiders/lanqiu.py" />
+        <option value="$PROJECT_DIR$/pipeline/lanqiu.py" />
+        <option value="$PROJECT_DIR$/pipeline/roll_wangqiu.py" />
+        <option value="$PROJECT_DIR$/pipeline/roll_bangqiu.py" />
+        <option value="$PROJECT_DIR$/utils/helper.py" />
+        <option value="$PROJECT_DIR$/main.py" />
+        <option value="$PROJECT_DIR$/pipeline/zuqiu.py" />
+        <option value="$PROJECT_DIR$/settings.py" />
       </list>
     </option>
   </component>
   <component name="ProjectFrameBounds" extendedState="6">
-    <option name="x" value="381" />
-    <option name="y" value="17" />
-    <option name="width" value="1238" />
+    <option name="x" value="-8" />
+    <option name="y" value="-8" />
+    <option name="width" value="1936" />
     <option name="height" value="1066" />
   </component>
   <component name="ProjectLevelVcsManager" settingsEditedManually="true" />
@@ -277,6 +306,11 @@
               <item name="hg3535" type="462c0819:PsiDirectoryNode" />
               <item name="spiders" type="462c0819:PsiDirectoryNode" />
             </path>
+            <path>
+              <item name="hg3535" type="b2602c69:ProjectViewProjectNode" />
+              <item name="hg3535" type="462c0819:PsiDirectoryNode" />
+              <item name="utils" type="462c0819:PsiDirectoryNode" />
+            </path>
             <path>
               <item name="hg3535" type="b2602c69:ProjectViewProjectNode" />
               <item name="External Libraries" type="cb654da1:ExternalLibrariesNode" />
@@ -290,7 +324,7 @@
   <component name="PropertiesComponent">
     <property name="WebServerToolWindowFactoryState" value="false" />
     <property name="add_unversioned_files" value="$PROJECT_DIR$/.gitignore" />
-    <property name="last_opened_file_path" value="$PROJECT_DIR$" />
+    <property name="last_opened_file_path" value="$PROJECT_DIR$/../../sports_collect" />
     <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
     <property name="nodejs_npm_path_reset_for_default_project" value="true" />
     <property name="settings.editor.selected.configurable" value="com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable" />
@@ -544,6 +578,13 @@
       <workItem from="1559820318166" duration="6091000" />
       <workItem from="1560128279184" duration="2486000" />
       <workItem from="1564469892436" duration="10885000" />
+      <workItem from="1565231417256" duration="1894000" />
+      <workItem from="1565242895579" duration="17130000" />
+      <workItem from="1565274288542" duration="629000" />
+      <workItem from="1565574821845" duration="1238000" />
+      <workItem from="1566802827516" duration="684000" />
+      <workItem from="1566871828920" duration="61000" />
+      <workItem from="1566872141146" duration="9146000" />
     </task>
     <task id="LOCAL-00001" summary="修改后,版本二">
       <created>1555727493584</created>
@@ -752,7 +793,7 @@
     <servers />
   </component>
   <component name="TimeTrackingManager">
-    <option name="totallyTimeSpent" value="1593544000" />
+    <option name="totallyTimeSpent" value="1624326000" />
   </component>
   <component name="TodoView">
     <todo-panel id="selected-file">
@@ -765,9 +806,8 @@
   </component>
   <component name="ToolWindowManager">
     <frame x="-8" y="-8" width="1936" height="1066" extended-state="6" />
-    <editor active="true" />
     <layout>
-      <window_info active="true" content_ui="combo" id="Project" order="0" sideWeight="0.71173847" visible="true" weight="0.15618336" />
+      <window_info content_ui="combo" id="Project" order="0" sideWeight="0.71173847" visible="true" weight="0.15191898" />
       <window_info id="Structure" order="1" sideWeight="0.2882615" side_tool="true" weight="0.1108742" />
       <window_info id="Favorites" order="2" sideWeight="0.5013405" side_tool="true" weight="0.108208954" />
       <window_info anchor="bottom" id="Message" order="0" />
@@ -782,7 +822,7 @@
       <window_info anchor="bottom" id="Event Log" order="9" sideWeight="0.50692964" side_tool="true" weight="0.3858521" />
       <window_info anchor="bottom" x="22" y="376" width="1876" height="298" id="Terminal" order="10" sideWeight="0.49307036" weight="0.444206" />
       <window_info anchor="bottom" id="Python Console" order="11" sideWeight="0.49946696" weight="0.4356223" />
-      <window_info anchor="bottom" id="Run" order="12" sideWeight="0.87473345" visible="true" weight="0.29613733" />
+      <window_info active="true" anchor="bottom" id="Run" order="12" sideWeight="0.87473345" visible="true" weight="0.6051502" />
       <window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
       <window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
       <window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
@@ -895,6 +935,16 @@
           <line>84</line>
           <option name="timeStamp" value="4" />
         </line-breakpoint>
+        <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
+          <url>file://$PROJECT_DIR$/spiders/zuqiu.py</url>
+          <line>38</line>
+          <option name="timeStamp" value="9" />
+        </line-breakpoint>
+        <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
+          <url>file://$PROJECT_DIR$/spiders/zuqiu.py</url>
+          <line>64</line>
+          <option name="timeStamp" value="10" />
+        </line-breakpoint>
       </breakpoints>
       <default-breakpoints>
         <breakpoint type="python-exception">
@@ -922,42 +972,9 @@
     </expressions>
   </component>
   <component name="editorHistoryManager">
-    <entry file="file://$PROJECT_DIR$/log/liansai_2019_5_24.log" />
-    <entry file="file://$PROJECT_DIR$/log/lanqiu_2019_5_24.log" />
-    <entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python36/Lib/site-packages/scrapy/spiderloader.py">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="154">
-          <caret line="70" selection-start-line="70" selection-end-line="70" />
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/spiders/wqbodan.py">
-      <provider selected="true" editor-type-id="text-editor" />
-    </entry>
-    <entry file="file://$PROJECT_DIR$/spiders/hg3535_zq_status_up.py" />
-    <entry file="file://$PROJECT_DIR$/spiders/hg3535_zq_status.py" />
-    <entry file="file://$PROJECT_DIR$/main_notroll.py" />
     <entry file="file://$PROJECT_DIR$/log/zq_jieshu_2019_5_27.log" />
-    <entry file="file://$PROJECT_DIR$/spiders/bq_jieshu.py">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="324">
-          <caret line="44" column="60" lean-forward="true" selection-start-line="44" selection-start-column="60" selection-end-line="44" selection-end-column="60" />
-          <folding>
-            <element signature="e#24#39#0" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
-    <entry file="file://$PROJECT_DIR$/spiders/lq_jieshu.py">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="277">
-          <caret line="47" column="23" lean-forward="true" selection-start-line="47" selection-start-column="23" selection-end-line="47" selection-end-column="23" />
-          <folding>
-            <element signature="e#24#39#0" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
+    <entry file="file://$PROJECT_DIR$/spiders/bq_jieshu.py" />
+    <entry file="file://$PROJECT_DIR$/spiders/lq_jieshu.py" />
     <entry file="file://$PROJECT_DIR$/spiders/liansai.py">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="209">
@@ -1013,16 +1030,6 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/spiders/roll_bangqiu.py">
-      <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="558">
-          <caret line="175" lean-forward="true" selection-start-line="175" selection-end-line="175" />
-          <folding>
-            <element signature="e#46#61#0" expanded="true" />
-          </folding>
-        </state>
-      </provider>
-    </entry>
     <entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python36/Lib/site-packages/twisted/internet/defer.py">
       <provider selected="true" editor-type-id="text-editor">
         <state relative-caret-position="11484">
@@ -1054,208 +1061,267 @@
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/spiders/roll_wangqiu.py">
+    <entry file="file://$PROJECT_DIR$/spiders/wq_jieshu.py" />
+    <entry file="file://$PROJECT_DIR$/spiders/__init__.py">
+      <provider selected="true" editor-type-id="text-editor" />
+    </entry>
+    <entry file="file://$PROJECT_DIR$/.gitignore">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="1008">
-          <caret line="64" selection-start-line="64" selection-end-line="64" />
-          <folding>
-            <element signature="e#24#39#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="198">
+          <caret line="11" column="1" selection-start-line="11" selection-start-column="1" selection-end-line="11" selection-end-column="1" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/pipelines.py">
+    <entry file="file://$PROJECT_DIR$/requirements.txt">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="31158">
-          <caret line="1742" column="34" selection-start-line="1742" selection-start-column="34" selection-end-line="1742" selection-end-column="34" />
+        <state relative-caret-position="-530" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/roll.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state>
           <folding>
             <element signature="e#0#11#0" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/spiders/wq_jieshu.py">
+    <entry file="file://$PROJECT_DIR$/__init__.py">
+      <provider selected="true" editor-type-id="text-editor" />
+    </entry>
+    <entry file="file://$PROJECT_DIR$/items.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="882">
-          <caret line="54" column="94" selection-start-line="54" selection-start-column="94" selection-end-line="54" selection-end-column="94" />
-          <folding>
-            <element signature="e#24#39#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="1426">
+          <caret line="472" selection-start-line="472" selection-end-line="472" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/spiders/roll_zuqiu.py">
+    <entry file="file://$PROJECT_DIR$/jianting.py">
+      <provider selected="true" editor-type-id="text-editor" />
+    </entry>
+    <entry file="file://$PROJECT_DIR$/main_time.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="7038">
-          <caret line="399" column="59" selection-start-line="399" selection-start-column="59" selection-end-line="399" selection-end-column="59" />
+        <state relative-caret-position="-86">
+          <caret line="11" selection-start-line="11" selection-end-line="11" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/spiders/wangqiu.py">
+    <entry file="file://$PROJECT_DIR$/ball_func.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="126">
-          <caret line="14" column="20" selection-start-line="14" selection-start-column="20" selection-end-line="14" selection-end-column="20" />
+        <state relative-caret-position="511">
+          <caret line="145" selection-start-line="145" selection-end-line="145" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/spiders/lanqiu.py">
+    <entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python36/Lib/site-packages/scrapy/utils/trackref.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="648">
-          <caret line="42" column="19" selection-start-line="42" selection-start-column="19" selection-end-line="42" selection-end-column="19" />
-          <folding>
-            <element signature="e#24#35#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="486">
+          <caret line="32" selection-start-line="32" selection-end-line="32" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/utils/helper.py">
-      <provider selected="true" editor-type-id="text-editor" />
+    <entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python36/Lib/site-packages/scrapy/http/request/__init__.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="202">
+          <caret line="78" selection-start-line="78" selection-end-line="78" />
+        </state>
+      </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/pipeline/zuqiu.py">
+    <entry file="file://$PROJECT_DIR$/spiders/zq_jieshu.py" />
+    <entry file="file://$PROJECT_DIR$/pipeline/__init__.py">
       <provider selected="true" editor-type-id="text-editor" />
     </entry>
-    <entry file="file://$PROJECT_DIR$/spiders/__init__.py">
-      <provider selected="true" editor-type-id="text-editor" />
+    <entry file="file://$PROJECT_DIR$/pipeline/guanjun.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="18">
+          <caret line="32" column="57" selection-start-line="32" selection-start-column="57" selection-end-line="32" selection-end-column="57" />
+          <folding>
+            <element signature="e#18#32#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/.gitignore">
+    <entry file="file://$PROJECT_DIR$/spiders/wqbodan.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="198">
-          <caret line="11" column="1" selection-start-line="11" selection-start-column="1" selection-end-line="11" selection-end-column="1" />
+        <state relative-caret-position="-1152" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/pipeline/roll_zuqiu.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="3708">
+          <caret line="211" column="57" selection-start-line="211" selection-start-column="57" selection-end-line="211" selection-end-column="57" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/main.py">
+    <entry file="file://$PROJECT_DIR$/spiders/roll_zuqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="144">
-          <caret line="10" column="39" lean-forward="true" selection-start-line="10" selection-start-column="39" selection-end-line="10" selection-end-column="39" />
+        <state relative-caret-position="4038">
+          <caret line="434" column="48" selection-start-line="434" selection-start-column="48" selection-end-line="434" selection-end-column="48" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/requirements.txt">
+    <entry file="file://$PROJECT_DIR$/pipeline/lanqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-530" />
+        <state relative-caret-position="162">
+          <caret line="356" column="17" selection-start-line="356" selection-start-column="11" selection-end-line="356" selection-end-column="22" />
+        </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/roll.py">
+    <entry file="file://$PROJECT_DIR$/spiders/lanqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state>
+        <state relative-caret-position="3">
+          <caret line="513" column="35" selection-start-line="513" selection-start-column="24" selection-end-line="513" selection-end-column="35" />
           <folding>
-            <element signature="e#0#11#0" expanded="true" />
+            <element signature="e#24#35#0" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/__init__.py">
-      <provider selected="true" editor-type-id="text-editor" />
-    </entry>
-    <entry file="file://$PROJECT_DIR$/items.py">
+    <entry file="file://$PROJECT_DIR$/pipeline/bangqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="1426">
-          <caret line="472" selection-start-line="472" selection-end-line="472" />
+        <state relative-caret-position="-5382">
+          <folding>
+            <element signature="e#0#15#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/jianting.py">
-      <provider selected="true" editor-type-id="text-editor" />
+    <entry file="file://$PROJECT_DIR$/spiders/roll_bangqiu.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="-1094">
+          <caret line="175" lean-forward="true" selection-start-line="175" selection-end-line="175" />
+          <folding>
+            <element signature="e#46#61#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/main_time.py">
+    <entry file="file://$PROJECT_DIR$/pipeline/ball_func.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="-86">
-          <caret line="11" selection-start-line="11" selection-end-line="11" />
+        <state relative-caret-position="342">
+          <caret line="30" column="9" lean-forward="true" selection-start-line="30" selection-start-column="9" selection-end-line="30" selection-end-column="9" />
+          <folding>
+            <element signature="e#0#15#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/ball_func.py">
+    <entry file="file://$PROJECT_DIR$/spiders/wangqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="511">
-          <caret line="145" selection-start-line="145" selection-end-line="145" />
+        <state relative-caret-position="-3024">
+          <caret line="14" column="20" selection-start-line="14" selection-start-column="20" selection-end-line="14" selection-end-column="20" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/spiders/zuqiu.py">
+    <entry file="file://$PROJECT_DIR$/pipeline/wangqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="270">
-          <caret line="21" selection-start-line="21" selection-end-line="22" selection-end-column="35" />
+        <state relative-caret-position="-4896">
+          <folding>
+            <element signature="e#0#15#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python36/Lib/site-packages/scrapy/utils/trackref.py">
+    <entry file="file://$PROJECT_DIR$/spiders/guanjun.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="486">
-          <caret line="32" selection-start-line="32" selection-end-line="32" />
+        <state relative-caret-position="-252">
+          <caret line="10" selection-start-line="10" selection-end-line="10" />
+          <folding>
+            <element signature="e#38#53#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$USER_HOME$/AppData/Local/Programs/Python/Python36/Lib/site-packages/scrapy/http/request/__init__.py">
+    <entry file="file://$PROJECT_DIR$/spiders/roll_wangqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="202">
-          <caret line="78" selection-start-line="78" selection-end-line="78" />
+        <state relative-caret-position="-3204">
+          <caret line="64" selection-start-line="64" selection-end-line="64" />
+          <folding>
+            <element signature="e#24#39#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/settings.py">
+    <entry file="file://$PROJECT_DIR$/pipeline/roll_bangqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="346">
-          <caret line="180" lean-forward="true" selection-start-line="180" selection-end-line="180" />
+        <state relative-caret-position="1206">
+          <caret line="76" column="39" selection-start-line="76" selection-start-column="39" selection-end-line="76" selection-end-column="39" />
+          <folding>
+            <element signature="e#0#15#0" expanded="true" />
+          </folding>
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/pipeline/ball_func.py">
+    <entry file="file://$PROJECT_DIR$/pipeline/roll_wangqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="7">
-          <caret line="4" lean-forward="true" selection-start-line="4" selection-end-line="4" />
+        <state relative-caret-position="1171">
+          <caret line="88" selection-start-line="88" selection-end-line="100" selection-end-column="56" />
           <folding>
             <element signature="e#0#15#0" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
+    <entry file="file://$PROJECT_DIR$/pipeline/roll_lanqiu.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state>
+          <folding>
+            <element signature="e#0#14#0" expanded="true" />
+          </folding>
+        </state>
+      </provider>
+    </entry>
     <entry file="file://$PROJECT_DIR$/middlewares.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="290">
+        <state relative-caret-position="259">
           <caret line="134" selection-start-line="134" selection-end-line="134" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/spiders/zq_jieshu.py">
+    <entry file="file://$PROJECT_DIR$/pipelines.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="180">
-          <caret line="21" column="14" selection-start-line="21" selection-start-column="4" selection-end-line="21" selection-end-column="14" />
+        <state relative-caret-position="691">
+          <caret line="1294" column="17" selection-start-line="1294" selection-start-column="17" selection-end-line="1294" selection-end-column="17" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/pipeline/__init__.py">
-      <provider selected="true" editor-type-id="text-editor" />
+    <entry file="file://$PROJECT_DIR$/spiders/zuqiu.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="468">
+          <caret line="38" selection-start-line="38" selection-end-line="38" />
+        </state>
+      </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/spiders/guanjun.py">
+    <entry file="file://$PROJECT_DIR$/utils/helper.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="180">
-          <caret line="10" lean-forward="true" selection-start-line="10" selection-end-line="10" />
-          <folding>
-            <element signature="e#38#53#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="144">
+          <caret line="11" column="97" selection-start-line="11" selection-start-column="84" selection-end-line="11" selection-end-column="113" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/pipeline/lanqiu.py">
+    <entry file="file://$PROJECT_DIR$/main.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="156">
-          <caret line="150" selection-start-line="150" selection-end-line="218" selection-end-column="21" />
-          <folding>
-            <element signature="e#49#60#0" expanded="true" />
-          </folding>
+        <state relative-caret-position="198">
+          <caret line="13" column="41" selection-start-line="13" selection-start-column="41" selection-end-line="13" selection-end-column="41" />
         </state>
       </provider>
     </entry>
-    <entry file="file://$PROJECT_DIR$/pipeline/guanjun.py">
+    <entry file="file://$PROJECT_DIR$/pipeline/zuqiu.py">
       <provider selected="true" editor-type-id="text-editor">
-        <state relative-caret-position="576">
-          <caret line="32" column="57" selection-start-line="32" selection-start-column="57" selection-end-line="32" selection-end-column="57" />
+        <state relative-caret-position="12024">
+          <caret line="683" column="137" selection-start-line="683" selection-start-column="137" selection-end-line="683" selection-end-column="137" />
           <folding>
-            <element signature="e#18#32#0" expanded="true" />
+            <element signature="e#0#14#0" expanded="true" />
           </folding>
         </state>
       </provider>
     </entry>
+    <entry file="file://$PROJECT_DIR$/settings.py">
+      <provider selected="true" editor-type-id="text-editor">
+        <state relative-caret-position="-2584">
+          <caret line="31" column="21" selection-start-line="31" selection-start-column="21" selection-end-line="31" selection-end-column="21" />
+        </state>
+      </provider>
+    </entry>
   </component>
 </project>

+ 1 - 0
hg3535/items.py

@@ -453,6 +453,7 @@ class Roll_Bangqiu(scrapy.Field):
     odd_evens_dict = scrapy.Field()
     odd_evens_dict_rule = scrapy.Field()
     match_score_dict = scrapy.Field()
+    team_source_dict = scrapy.Field()
 
 
 # -----------------------------------------------------------足球比赛结果------------------------------------------------

+ 4 - 4
hg3535/main.py

@@ -5,16 +5,16 @@ from scrapy.cmdline import execute
 # print(os.path.dirname(os.path.abspath(__file__)))
 sys.path.append(os.path.dirname(os.path.abspath(__file__)))
 # execute(["scrapy", "crawl", "liansai"])
-# execute(["scrapy", "crawl", "zuqiu"])
+execute(["scrapy", "crawl", "zuqiu"])
 # execute(["scrapy", "crawl", "lanqiu"])
 # execute(["scrapy", "crawl", "guanjun"])
 # execute(["scrapy", "crawl", "wangqiu"])
 # execute(["scrapy", "crawl", "wqbodan"])
 # execute(["scrapy", "crawl", "bangqiu"])
-# execute(["scrapy", "crawl", "roll_zuqiu"]) #滚球足球 回来要解开这个注释 其他全部解封
+# execute(["scrapy", "crawl", "roll_zuqiu"]) # 滚球足球 回来要解开这个注释 其他全部解封
 # execute(["scrapy", "crawl", "roll_lanqiu"]) #滚球篮球
-execute(["scrapy", "crawl", "roll_wangqiu"]) #滚球网球
-# execute(["scrapy", "crawl", "roll_bangqiu"]) #滚球棒球
+# execute(["scrapy", "crawl", "roll_wangqiu"]) #滚球网球
+# execute(["scrapy", "crawl", "roll_bangqiu"])  # 滚球棒球
 # execute(["scrapy", "crawl", "ball_status"]) #滚球id本地存
 # execute(["scrapy", "crawl", "ball_status_update"]) #滚球id结束时间更新状态
 # execute(["scrapy", "crawl", "zq_jieshu"]) #滚球id结束时间更新状态

+ 59 - 59
hg3535/pipeline/bangqiu.py

@@ -78,20 +78,20 @@ class Bangqiupipeline(object):
         # 总得分单双
         odd_evens_dict = item['odd_evens_dict']
         odd_evens_dict_rule = item['odd_evens_dict_rule']
-        # 球队得分 主队
-        try:
-            team_score_home_dict = item['team_score_home_dict']
-            team_score_home_rule_dict = item['team_score_home_rule_dict']
-        except:
-            team_score_home_dict = ""
-            team_score_home_rule_dict = ""
-        # 球队得分 客队
-        try:
-            team_score_guest_dict = item['team_score_guest_dict']
-            team_score_guest_rule_dict = item['team_score_guest_rule_dict']
-        except:
-            team_score_guest_dict = ""
-            team_score_guest_rule_dict = ""
+        # # 球队得分 主队
+        # try:
+        #     team_score_home_dict = item['team_score_home_dict']
+        #     team_score_home_rule_dict = item['team_score_home_rule_dict']
+        # except:
+        #     team_score_home_dict = ""
+        #     team_score_home_rule_dict = ""
+        # # 球队得分 客队
+        # try:
+        #     team_score_guest_dict = item['team_score_guest_dict']
+        #     team_score_guest_rule_dict = item['team_score_guest_rule_dict']
+        # except:
+        #     team_score_guest_dict = ""
+        #     team_score_guest_rule_dict = ""
         bangqiu = item['bangqiu']
         match_date, match_time, time3 = new_time(ctime)
         us_time = ctime
@@ -221,15 +221,15 @@ class Bangqiupipeline(object):
         # 让球
         if concedes_dict:
             for key, value in concedes_dict.items():
-                sole_str = 'concede' + str(key) + str(match_id) + 'hg3535'
+                sole_str = 'CO' + str(key) + str(match_id) + 'hg3535'
                 sole = Helper.genearte_MD5(sole_str)
-                odds_str = 'concede' + str(key) + str(match_id) + 'hg3535' + str(concedes_dict_rule[key]) + str(
+                odds_str = 'CO' + str(key) + str(match_id) + 'hg3535' + str(concedes_dict_rule[key]) + str(
                     value)
                 odds_only = Helper.genearte_MD5(odds_str)
                 condition = fuhao(str(concedes_dict_rule[key]))
                 concedes_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                      "odds_only", "sole", "source", "type", "team"]
-                concedes_dict_value = [match_id, league_id, key, '0', '0', 'concede', value, condition,
+                concedes_dict_value = [match_id, league_id, key, '0', 0, 'CO', value, condition,
                                        odds_only, sole, 'hg3535', '0', '']
                 concedes_dict_data = dict(zip(concedes_dict_key, concedes_dict_value))
                 odds_onlys.append(odds_only)
@@ -238,64 +238,64 @@ class Bangqiupipeline(object):
         # 总得分大/小
         if total_size_dict:
             for key, value in total_size_dict.items():
-                sole_str = 'total_size' + str(key) + str(match_id) + 'hg3535'
+                sole_str = 'TN' + str(key) + str(match_id) + 'hg3535'
                 sole = Helper.genearte_MD5(sole_str)
-                odds_str = 'total_size' + str(key) + str(match_id) + 'hg3535' + str(
+                odds_str = 'TN' + str(key) + str(match_id) + 'hg3535' + str(
                     total_size_dict_rule[key]) + str(value)
                 odds_only = Helper.genearte_MD5(odds_str)
                 condition = fuhao(str(total_size_dict_rule[key]))
                 total_size_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                        "condition", "odds_only", "sole", "source", "type", "team"]
-                total_size_dict_value = [match_id, league_id, key, '0', '0', 'total_size', value, condition,
+                total_size_dict_value = [match_id, league_id, key, '0', 0, 'TN', value, condition,
                                          odds_only, sole, 'hg3535', '0', '']
                 total_size_dict_data = dict(zip(total_size_dict_key, total_size_dict_value))
                 odds_onlys.append(odds_only)
                 if odds_only not in odds_only_list:
                     data_list.append(total_size_dict_data)
         # 球队得分大/小 主队
-        if team_score_home_dict:
-            for key, value in team_score_home_dict.items():
-                sole_str = 'team_score_home' + str(key) + str(match_id) + 'hg3535'
-                sole = Helper.genearte_MD5(sole_str)
-                odds_str = 'team_score_home' + str(key) + str(match_id) + 'hg3535' + str(
-                    team_score_home_rule_dict[key]) + str(value)
-                odds_only = Helper.genearte_MD5(odds_str)
-                condition = fuhao(str(team_score_home_rule_dict[key]))
-                team_score_home_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
-                                            "condition", "odds_only", "sole", "source", "type", "team"]
-                team_score_home_dict_value = [match_id, league_id, key, '0', '0', 'team_score_home', value, condition,
-                                              odds_only, sole, 'hg3535', '0', '']
-                team_score_home_dict_data = dict(zip(team_score_home_dict_key, team_score_home_dict_value))
-                odds_onlys.append(odds_only)
-                if odds_only not in odds_only_list:
-                    data_list.append(team_score_home_dict_data)
-        # 球队得分大/小 客队
-        if team_score_guest_dict:
-            for key, value in team_score_guest_dict.items():
-                sole_str = 'team_score_guest' + str(key) + str(match_id) + 'hg3535'
-                sole = Helper.genearte_MD5(sole_str)
-                odds_str = 'team_score_guest' + str(key) + str(match_id) + 'hg3535' + str(
-                    team_score_guest_rule_dict[key]) + str(value)
-                odds_only = Helper.genearte_MD5(odds_str)
-                condition = fuhao(str(team_score_guest_rule_dict[key]))
-                team_score_guest_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
-                                             "condition", "odds_only", "sole", "source", "type", "team"]
-                team_score_guest_dict_value = [match_id, league_id, key, '0', '0', 'team_score_guest', value, condition,
-                                               odds_only, sole, 'hg3535', '0', '']
-                team_score_guest_dict_data = dict(zip(team_score_guest_dict_key, team_score_guest_dict_value))
-                odds_onlys.append(odds_only)
-                if odds_only not in odds_only_list:
-                    data_list.append(team_score_guest_dict_data)
+        # if team_score_home_dict:
+        #     for key, value in team_score_home_dict.items():
+        #         sole_str = 'team_score_home' + str(key) + str(match_id) + 'hg3535'
+        #         sole = Helper.genearte_MD5(sole_str)
+        #         odds_str = 'team_score_home' + str(key) + str(match_id) + 'hg3535' + str(
+        #             team_score_home_rule_dict[key]) + str(value)
+        #         odds_only = Helper.genearte_MD5(odds_str)
+        #         condition = fuhao(str(team_score_home_rule_dict[key]))
+        #         team_score_home_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+        #                                     "condition", "odds_only", "sole", "source", "type", "team"]
+        #         team_score_home_dict_value = [match_id, league_id, key, '0', '0', 'team_score_home', value, condition,
+        #                                       odds_only, sole, 'hg3535', '0', '']
+        #         team_score_home_dict_data = dict(zip(team_score_home_dict_key, team_score_home_dict_value))
+        #         odds_onlys.append(odds_only)
+        #         if odds_only not in odds_only_list:
+        #             data_list.append(team_score_home_dict_data)
+        # # 球队得分大/小 客队
+        # if team_score_guest_dict:
+        #     for key, value in team_score_guest_dict.items():
+        #         sole_str = 'team_score_guest' + str(key) + str(match_id) + 'hg3535'
+        #         sole = Helper.genearte_MD5(sole_str)
+        #         odds_str = 'team_score_guest' + str(key) + str(match_id) + 'hg3535' + str(
+        #             team_score_guest_rule_dict[key]) + str(value)
+        #         odds_only = Helper.genearte_MD5(odds_str)
+        #         condition = fuhao(str(team_score_guest_rule_dict[key]))
+        #         team_score_guest_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+        #                                      "condition", "odds_only", "sole", "source", "type", "team"]
+        #         team_score_guest_dict_value = [match_id, league_id, key, '0', '0', 'team_score_guest', value, condition,
+        #                                        odds_only, sole, 'hg3535', '0', '']
+        #         team_score_guest_dict_data = dict(zip(team_score_guest_dict_key, team_score_guest_dict_value))
+        #         odds_onlys.append(odds_only)
+        #         if odds_only not in odds_only_list:
+        #             data_list.append(team_score_guest_dict_data)
         # 独赢
         if capots_dict:
             for key, value in capots_dict.items():
-                sole_str = 'capot' + str(key) + str(match_id) + 'hg3535'
+                sole_str = 'C' + str(key) + str(match_id) + 'hg3535'
                 sole = Helper.genearte_MD5(sole_str)
-                odds_str = 'capot' + str(key) + str(match_id) + 'hg3535' + str(value)
+                odds_str = 'C' + str(key) + str(match_id) + 'hg3535' + str(value)
                 odds_only = Helper.genearte_MD5(odds_str)
                 capots_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                    "condition", "odds_only", "sole", "source", "type", "team"]
-                capots_dict_value = [match_id, league_id, key, '0', '0', 'capot', value, '',
+                capots_dict_value = [match_id, league_id, key, '0', 0, 'C', value, '',
                                      odds_only, sole, 'hg3535', '0', '']
                 capots_dict_data = dict(zip(capots_dict_key, capots_dict_value))
                 odds_onlys.append(odds_only)
@@ -304,15 +304,15 @@ class Bangqiupipeline(object):
         # 总得分单双
         if odd_evens_dict:
             for key, value in odd_evens_dict.items():
-                sole_str = 'two_sides' + str(key) + str(match_id) + 'hg3535'
+                sole_str = 'TS' + str(key) + str(match_id) + 'hg3535'
                 sole = Helper.genearte_MD5(sole_str)
-                odds_str = 'two_sides' + str(key) + str(match_id) + 'hg3535' + str(
+                odds_str = 'TS' + str(key) + str(match_id) + 'hg3535' + str(
                     odd_evens_dict_rule[key]) + str(value)
                 odds_only = Helper.genearte_MD5(odds_str)
                 condition = fuhao(str(odd_evens_dict_rule[key]))
                 odd_evens_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                       "condition", "odds_only", "sole", "source", "type", "team"]
-                odd_evens_dict_value = [match_id, league_id, key, '0', '0', 'two_sides', value, condition,
+                odd_evens_dict_value = [match_id, league_id, key, '0', 0, 'TS', value, condition,
                                         odds_only, sole, 'hg3535', '0', '']
                 odd_evens_dict_data = dict(zip(odd_evens_dict_key, odd_evens_dict_value))
                 odds_onlys.append(odds_only)

+ 205 - 14
hg3535/pipeline/lanqiu.py

@@ -70,14 +70,20 @@ class Lanqiupipeline(object):
         # 球队得分
         qiudui = item['qiudui']
         pt = item['pt']
+        # 让球
         concedes_dict = item['concede']
         concedes_dict_rule = item['concede_rule']
+        # 总得分单双
         odd_evens_dict = item['odd_even']
         odd_evens_dict_rule = item['odd_even_rule']
+        # 总比分大小
         total_sizes_dict = item['total_size']
         total_sizes_dict_rule = item['total_size_rule']
+        # 球队得分最后一位数
         last_numbers_dict = item['last_number']
+        # 独赢
         capots_dict = item['capot']
+        # 球队得分大小
         team_scores_dict = item['team_score']
         team_scores_dict_rule = item['team_score_rule']
         # 让球
@@ -86,21 +92,21 @@ class Lanqiupipeline(object):
         uuid = Helper.genearte_MD5(league_name + 'hg3535')
         # 让球 数据插入数据库
         """联赛"""
-        # last_time = '2019-12-31 23:59:59'
-        # league_dict = {"game_code": "lq", "title": "league", "source": "hg3535"}
-        # league_list = []
+        last_time = '2019-12-31 23:59:59'
+        league_dict = {"game_code": "lq", "title": "league", "source": "hg3535"}
+        league_list = []
 
-        # league_key = ["name_chinese", "kind", "match_mode", "if_stop", "last_time", "lg_id", "source", "uuid"]
-        # league_value = [league_name, "1", "1", "0", last_time, league_id, "hg3535", uuid]
-        # league_data = dict(zip(league_key, league_value))
-        # league_list.append(league_data)
-        # league_dict['data'] = league_list
-        # # print(league_list)
-        # # print(league_dict)
-        # if self.db.hg3535_lq_league.find({'lg_id': league_id}).count() < 1:
-        #     res = Helper.async_post(url + '/setLeague', league_dict)
-        #     print(res)
-        #     self.db.hg3535_lq_league.insert(league_list)
+        league_key = ["name_chinese", "kind", "match_mode", "if_stop", "last_time", "lg_id", "source", "uuid"]
+        league_value = [league_name, "1", "1", "0", last_time, league_id, "hg3535", uuid]
+        league_data = dict(zip(league_key, league_value))
+        league_list.append(league_data)
+        league_dict['data'] = league_list
+        # print(league_list)
+        # print(league_dict)
+        if self.db.hg3535_lq_league.find({'lg_id': league_id}).count() < 1:
+            res = Helper.async_post(url + '/setLeague', league_dict)
+            print(res)
+            self.db.hg3535_lq_league.insert(league_list)
 
         """赛事"""
         competition = self.db.hg3535_lq_competition.find_one({"match_id": str(match_id)})
@@ -197,3 +203,188 @@ class Lanqiupipeline(object):
             res = Helper.async_post(url + '/setMatch', match_dict)
             print(res)
             self.db.hg3535_lq_competition.insert(match_list)
+
+        """赔率"""
+        try:
+            result = self.db.hg3535_lq_odds.find_one({'match_id': str(match_id), 'pt': pt})
+            odds_only_list = result['odds_only']
+        except:
+            result = ''
+            odds_only_list = []
+        data_list = []
+        odds_onlys = []
+        # 让球
+        if concedes_dict:
+            for key, value in concedes_dict.items():
+                if value:
+                    for index, concedes_value in enumerate(value):
+                        sole_str = 'CO' + str(index) + str(match_id) + 'hg3535'
+                        sole = Helper.genearte_MD5(sole_str)
+                        odds_str = 'CO' + str(index) + str(match_id) + 'hg3535' + str(
+                            concedes_dict_rule[key][index]) + str(concedes_value)
+                        odds_only = Helper.genearte_MD5(odds_str)
+                        condition = fuhao(str(concedes_dict_rule[key][index]))
+                        concedes_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+                                             "condition", "odds_only", "sole", "source", "type", "team"]
+                        concedes_dict_value = [match_id, league_id, key, '0', index, 'CO', concedes_value, condition,
+                                               odds_only, sole, 'hg3535', '0', '']
+                        concedes_dict_data = dict(zip(concedes_dict_key, concedes_dict_value))
+                        odds_onlys.append(odds_only)
+                        if odds_only not in odds_only_list:
+                            data_list.append(concedes_dict_data)
+                else:
+                    sole_str = 'CO' + str(key) + str(match_id) + 'hg3535'
+                    sole = Helper.genearte_MD5(sole_str)
+                    odds_str = 'CO' + str(key) + str(match_id) + 'hg3535' + str(
+                        concedes_dict_rule[key]) + str(value)
+                    odds_only = Helper.genearte_MD5(odds_str)
+                    condition = fuhao(str(concedes_dict_rule[key]))
+                    concedes_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+                                         "condition", "odds_only", "sole", "source", "type", "team"]
+                    concedes_dict_value = [match_id, league_id, key, '0', 0, 'CO', value, condition,
+                                           odds_only, sole, 'hg3535', '0', '']
+                    concedes_dict_data = dict(zip(concedes_dict_key, concedes_dict_value))
+                    odds_onlys.append(odds_only)
+                    if odds_only not in odds_only_list:
+                        data_list.append(concedes_dict_data)
+        # 总得分单双
+        if odd_evens_dict:
+            for key, value in odd_evens_dict.items():
+                sole_str = 'TS' + str(key) + str(match_id) + 'hg3535'
+                sole = Helper.genearte_MD5(sole_str)
+                odds_str = 'TS' + str(key) + str(match_id) + 'hg3535' + str(
+                    odd_evens_dict_rule[key]) + str(value)
+                odds_only = Helper.genearte_MD5(odds_str)
+                condition = fuhao(str(odd_evens_dict_rule[key]))
+                odd_evens_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+                                      "condition", "odds_only", "sole", "source", "type", "team"]
+                odd_evens_dict_value = [match_id, league_id, key, '0', 0, 'TS', value, condition,
+                                        odds_only, sole, 'hg3535', '0', '']
+                odd_evens_dict_data = dict(zip(odd_evens_dict_key, odd_evens_dict_value))
+                odds_onlys.append(odds_only)
+                if odds_only not in odds_only_list:
+                    data_list.append(odd_evens_dict_data)
+        # 总比分大小
+        if total_sizes_dict:
+            for key, value in total_sizes_dict.items():
+                if value:
+                    for index, total_sizes_value in enumerate(value):
+                        sole_str = 'TN' + str(key) + str(match_id) + 'hg3535'
+                        sole = Helper.genearte_MD5(sole_str)
+                        odds_str = 'TN' + str(key) + str(match_id) + 'hg3535' + str(
+                            total_sizes_dict_rule[key][index]) + str(total_sizes_value)
+                        odds_only = Helper.genearte_MD5(odds_str)
+                        condition = fuhao(str(total_sizes_dict_rule[key][index]))
+                        total_sizes_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+                                           "condition", "odds_only", "sole", "source", "type", "team"]
+                        total_sizes_value = [match_id, league_id, key, '0', index, 'TN', total_sizes_value, condition,
+                                             odds_only, sole, 'hg3535', '0', '']
+                        total_sizes_data = dict(zip(total_sizes_key, total_sizes_value))
+                        odds_onlys.append(odds_only)
+                        if odds_only not in odds_only_list:
+                            data_list.append(total_sizes_data)
+                else:
+                    sole_str = 'TN' + str(key) + str(match_id) + 'hg3535'
+                    sole = Helper.genearte_MD5(sole_str)
+                    odds_str = 'TN' + str(key) + str(match_id) + 'hg3535' + str(
+                        total_sizes_dict_rule[key]) + str(value)
+                    odds_only = Helper.genearte_MD5(odds_str)
+                    condition = fuhao(str(total_sizes_dict_rule[key]))
+                    total_sizes_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+                                       "condition", "odds_only", "sole", "source", "type", "team"]
+                    total_sizes_value = [match_id, league_id, key, '0', 0, 'TN', value, condition,
+                                         odds_only, sole, 'hg3535', '0', '']
+                    total_sizes_data = dict(zip(total_sizes_key, total_sizes_value))
+                    odds_onlys.append(odds_only)
+                    if odds_only not in odds_only_list:
+                        data_list.append(total_sizes_data)
+        # 球队得分大小
+        if team_scores_dict:
+            for key, value in team_scores_dict.items():
+                sole_str = 'TB' + str(key) + str(match_id) + 'hg3535'
+                sole = Helper.genearte_MD5(sole_str)
+                odds_str = 'TB' + str(key) + str(match_id) + 'hg3535' + str(
+                    team_scores_dict_rule[key]) + str(value)
+                odds_only = Helper.genearte_MD5(odds_str)
+                condition = fuhao(str(team_scores_dict_rule[key]))
+                team_scores_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+                                   "condition", "odds_only", "sole", "source", "type", "team"]
+                team_scores_value = [match_id, league_id, key, '0', 0, 'TB', value, condition,
+                                     odds_only, sole, 'hg3535', '0', '']
+                team_scores_data = dict(zip(team_scores_key, team_scores_value))
+                odds_onlys.append(odds_only)
+                if odds_only not in odds_only_list:
+                    data_list.append(team_scores_data)
+        # 球队得分最后一位数
+
+        last_home_dict = {'0或5': 'lnh0', '1或6': 'lnh1', '2或7': 'lnh2', '3或8': 'lnh3', '4或9': 'lnh4'}
+        last_home = last_numbers_dict['last_home']
+        if last_home:
+            for key, value in last_home.items():
+                for index, last_home_value in value.items():
+                    sole_str = 'LN' + last_home_dict[key] + str(match_id) + 'hg3535'
+                    sole = Helper.genearte_MD5(sole_str)
+                    odds_str = 'LN' + last_home_dict[key] + str(match_id) + 'hg3535' + '0' + str(last_home_value)
+                    odds_only = Helper.genearte_MD5(odds_str)
+                    last_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+                                        "condition", "odds_only", "sole", "source", "type", "team"]
+                    last_home_value = [match_id, league_id, last_home_dict[key], '0', index, 'LN', last_home_value, '',odds_only, sole, 'hg3535', '0', '']
+                    last_home_data = dict(zip(last_home_key, last_home_value))
+                    odds_onlys.append(odds_only)
+                    if odds_only not in odds_only_list:
+                        data_list.append(last_home_data)
+
+        last_guest = last_numbers_dict['last_guest']
+        last_guest_dict = {'0或5': 'lng0', '1或6': 'lng1', '2或7': 'lng2', '3或8': 'lng3', '4或9': 'lng4'}
+        if last_guest:
+            for key, value in last_numbers_dict.items():
+                for index, last_guest_value in value.items():
+                    sole_str = 'LN' + last_guest_dict[key] + str(match_id) + 'hg3535'
+                    sole = Helper.genearte_MD5(sole_str)
+                    odds_str = 'LN' + last_guest_dict[key] + str(match_id) + 'hg3535' + '0' + str(
+                        last_guest_value)
+                    odds_only = Helper.genearte_MD5(odds_str)
+                    last_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+                                        "condition", "odds_only", "sole", "source", "type", "team"]
+                    last_guest_value = [match_id, league_id, key, '0', index, 'LN', last_guest_value, '',
+                                          odds_only, sole, 'hg3535', '0', '']
+                    last_guest_data = dict(zip(last_guest_key, last_guest_value))
+                    odds_onlys.append(odds_only)
+                    if odds_only not in odds_only_list:
+                        data_list.append(last_guest_data)
+
+        # 独赢
+        if capots_dict:
+            for key, value in capots_dict.items():
+                sole_str = 'C' + str(key) + str(match_id) + 'hg3535'
+                sole = Helper.genearte_MD5(sole_str)
+                odds_str = 'C' + str(key) + str(match_id) + 'hg3535' + str(value)
+                odds_only = Helper.genearte_MD5(odds_str)
+                capots_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+                              "condition", "odds_only", "sole", "source", "type", "team"]
+                capots_value = [match_id, league_id, key, '0', 0, 'C', value, '',
+                                odds_only, sole, 'hg3535', '0', '']
+                capots_data = dict(zip(capots_key, capots_value))
+                odds_onlys.append(odds_only)
+                if odds_only not in odds_only_list:
+                    data_list.append(capots_data)
+        if pt == 3:
+            ris_stringscene = 1
+        else:
+            ris_stringscene = 0
+        odds_key = ["game_code", "title", "match_id", "lg_id", "data", "source", "odds_only", "tag", "uuid",
+                    "is_stringscene", "utime", "pt"]
+        odds_value = ["lq", "odds", match_id, league_id, data_list, "hg3535", odds_onlys, tag_number, uuid,
+                      ris_stringscene, utime, pt]
+        odds_dict = dict(zip(odds_key, odds_value))
+        # print(odds_dict)
+        # print(123)
+        if data_list:
+            res = Helper.async_post(url + '/setOdds', odds_dict)
+            print(res)
+            if '成功' in res:
+                if result:
+                    self.db.hg3535_lq_odds.update({'match_id': match_id, 'pt': pt}, {
+                        '$set': {"data": data_list, "odds_only": odds_onlys, "utime": utime}}, upsert=True)
+                else:
+                    self.db.hg3535_lq_odds.insert(odds_dict)

+ 25 - 24
hg3535/pipeline/roll_lanqiu.py

@@ -1,8 +1,10 @@
 import pymongo
 import time
 import logging
-from ball_func import fuhao
+from .ball_func import fuhao
 from ..utils.helper import Helper
+
+
 # from .ball_func import get_pcode, new_time
 
 
@@ -150,16 +152,16 @@ class Roll_Lanqiupipeline(object):
             for key, value in concedes_dict.items():
                 if value:
                     for index, concede_value in enumerate(value):
-                        hash_str = "concede" + key + str(index) + str(concedes_dict_rule[key][index]) + str(
+                        hash_str = "CO" + str(key) + str(index) + str(concedes_dict_rule[key][index]) + str(
                             concede_value) + "hg3535" + str(match_id)
-                        sole_str = "concede" + "key" + str(index) + str(match_id) + "hg3535"
+                        sole_str = "CO" + str(key) + str(index) + str(match_id) + "hg3535"
                         odds_only = Helper.genearte_MD5(hash_str)
                         sole = Helper.genearte_MD5(sole_str)
                         odds_onlys.append(odds_only)
                         concede_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                        "condition", "odds_only", "sole", "source", "type", "team"]
                         condition = fuhao(concedes_dict_rule[key][index])
-                        concede_value = [match_id, league_id, key, "0", index, 'concede', concede_value, condition,
+                        concede_value = [match_id, league_id, key, "0", index, 'CO', concede_value, condition,
                                          odds_only, sole, "hg3535", "0", ""]
                         concede_data = dict(zip(concede_key, concede_value))
                         if odds_only not in uuid_list:
@@ -169,9 +171,9 @@ class Roll_Lanqiupipeline(object):
                 if value:
                     for index, total_sizes_value in enumerate(value):
                         condition = fuhao(total_sizes_dict_rule[key][index])
-                        hash_str = "total_size" + key + str(index) + str(condition) + str(
+                        hash_str = "total_size" + str(key) + str(index) + str(condition) + str(
                             total_sizes_value) + "hg3535" + str(match_id)
-                        sole_str = "total_size" + "key" + str(index) + str(match_id) + "hg3535"
+                        sole_str = "total_size" + str(key) + str(index) + str(match_id) + "hg3535"
                         odds_only = Helper.genearte_MD5(hash_str)
                         sole = Helper.genearte_MD5(sole_str)
                         odds_onlys.append(odds_only)
@@ -187,15 +189,15 @@ class Roll_Lanqiupipeline(object):
             for key, value in odd_evens_dict.items():
                 if value:
                     condition = odd_evens_dict_rule[key]
-                    hash_str = "two_sides" + key + '0' + str(condition) + str(
+                    hash_str = "TS" + str(key) + '0' + str(condition) + str(
                         value) + "hg3535" + str(match_id)
-                    sole_str = "two_sides" + "key" + '0' + str(match_id) + "hg3535"
+                    sole_str = "TS" + str(key) + '0' + str(match_id) + "hg3535"
                     odds_only = Helper.genearte_MD5(hash_str)
                     sole = Helper.genearte_MD5(sole_str)
                     odds_onlys.append(odds_only)
                     odd_evens_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                      "condition", "odds_only", "sole", "source", "type", "team"]
-                    odd_evens_value = [match_id, league_id, key, "0", 0, 'two_sides', value,
+                    odd_evens_value = [match_id, league_id, key, "0", 0, 'TS', value,
                                        condition, odds_only, sole, "hg3535", "0", ""]
                     odd_evens_data = dict(zip(odd_evens_key, odd_evens_value))
                     if odds_only not in uuid_list:
@@ -209,15 +211,15 @@ class Roll_Lanqiupipeline(object):
                 # pass
                 odds_code = 'last_home' + lastnumber_dict[key]
                 condition = lastnumber_dict[key]
-                hash_str = "last_number" + odds_code + '0' + str(condition) + str(
+                hash_str = "LN" + odds_code + '0' + str(condition) + str(
                     value) + "hg3535" + str(match_id)
-                sole_str = "last_number" + "key" + '0' + str(match_id) + "hg3535"
+                sole_str = "LN" + str(key) + '0' + str(match_id) + "hg3535"
                 odds_only = Helper.genearte_MD5(hash_str)
                 sole = Helper.genearte_MD5(sole_str)
                 odds_onlys.append(odds_only)
                 last_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                  "condition", "odds_only", "sole", "source", "type", "team"]
-                last_home_value = [match_id, league_id, odds_code, "0", 0, 'last_number', value,
+                last_home_value = [match_id, league_id, odds_code, "0", 0, 'LN', value,
                                    condition, odds_only, sole, "hg3535", "0", ""]
                 last_home_data = dict(zip(last_home_key, last_home_value))
                 if odds_only not in uuid_list:
@@ -228,14 +230,14 @@ class Roll_Lanqiupipeline(object):
             for key, value in last_guest.items():
                 odds_code = 'last_guest' + lastnumber_dict[key]
                 condition = lastnumber_dict[key]
-                hash_str = "last_number" + odds_code + '0' + str(condition) + str(value) + "hg3535" + str(match_id)
-                sole_str = "last_number" + "key" + '0' + str(match_id) + "hg3535"
+                hash_str = "LN" + odds_code + '0' + str(condition) + str(value) + "hg3535" + str(match_id)
+                sole_str = "LN" + str(key) + '0' + str(match_id) + "hg3535"
                 odds_only = Helper.genearte_MD5(hash_str)
                 sole = Helper.genearte_MD5(sole_str)
                 odds_onlys.append(odds_only)
                 last_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                   "condition", "odds_only", "sole", "source", "type", "team"]
-                last_guest_value = [match_id, league_id, odds_code, "0", 0, 'last_number', value,
+                last_guest_value = [match_id, league_id, odds_code, "0", 0, 'LN', value,
                                     condition, odds_only, sole, "hg3535", "0", ""]
                 last_guest_data = dict(zip(last_guest_key, last_guest_value))
                 if odds_only not in uuid_list:
@@ -244,14 +246,14 @@ class Roll_Lanqiupipeline(object):
         if capots_dict:
             for key, value in capots_dict.items():
                 if value:
-                    hash_str = "capot" + key + '0' + '0' + str(value) + "hg3535" + str(match_id)
-                    sole_str = "capot" + "key" + '0' + str(match_id) + "hg3535"
+                    hash_str = "C" + str(key) + '0' + '0' + str(value) + "hg3535" + str(match_id)
+                    sole_str = "C" + str(key) + '0' + str(match_id) + "hg3535"
                     odds_only = Helper.genearte_MD5(hash_str)
                     sole = Helper.genearte_MD5(sole_str)
                     odds_onlys.append(odds_only)
                     capots_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                   "condition", "odds_only", "sole", "source", "type", "team"]
-                    capots_value = [match_id, league_id, key, "0", 0, 'capot', value,
+                    capots_value = [match_id, league_id, key, "0", 0, 'C', value,
                                     "", odds_only, sole, "hg3535", "0", ""]
                     capots_data = dict(zip(capots_key, capots_value))
                     if odds_only not in uuid_list:
@@ -261,16 +263,16 @@ class Roll_Lanqiupipeline(object):
             for key, team_scores_value in team_scores_dict.items():
                 if team_scores_value:
                     for index, value in enumerate(team_scores_value):
-                        hash_str = "team_score" + key + str(index) + str(team_scores_dict_rule[key][index]) + str(
+                        hash_str = "TB" + str(key) + str(index) + str(team_scores_dict_rule[key][index]) + str(
                             value) + "hg3535" + str(match_id)
-                        sole_str = "team_score" + "key" + str(index) + str(match_id) + "hg3535"
+                        sole_str = "TB" + str(key) + str(index) + str(match_id) + "hg3535"
                         odds_only = Helper.genearte_MD5(hash_str)
                         sole = Helper.genearte_MD5(sole_str)
                         odds_onlys.append(odds_only)
                         team_scores_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                            "condition", "odds_only", "sole", "source", "type", "team"]
                         condition = team_scores_dict_rule[key][index]
-                        team_scores_value = [match_id, league_id, key, "0", index, 'team_score', value, condition,
+                        team_scores_value = [match_id, league_id, key, "0", index, 'TB', value, condition,
                                              odds_only, sole, "hg3535", "0", ""]
                         team_scores_data = dict(zip(team_scores_key, team_scores_value))
                         if odds_only not in uuid_list:
@@ -298,8 +300,8 @@ class Roll_Lanqiupipeline(object):
                     "guest_rate": 0, "home_score": score_home,
                     "guest_score": score_guest, "all_goal": "", "status": 1,
                     "first_score": "", "last_score": "", "match_score": match_score, "uuid": uuid,
-                    "match_winer": "", "match_time": time_game,"u_home_score": "", "u_guest_score": "",
-                    "match_process": jijie, "tag": number,
+                    "match_winer": "", "match_time": time_game, "u_home_score": "", "u_guest_score": "",
+                    "match_process": jijie, "tag": number, "result_mark": '',
                     "match_id": match_id, "p_code": ""}
         data_list.append(lq_rball)
         r_data_dict = {
@@ -316,4 +318,3 @@ class Roll_Lanqiupipeline(object):
             except Exception as e:
                 logger.warning('滚球数据接口异常,提交失败')
                 logger.warning(e)
-

+ 81 - 80
hg3535/pipeline/roll_wangqiu.py

@@ -86,68 +86,68 @@ class Roll_Wangqiupipeline(object):
         new_sq_dict = json.dumps(sq_dict)
         uuid = Helper.genearte_MD5(league_name + 'hg3535')
         """联赛"""
-        # last_time = '2019-12-31 23:59:59'
-        # league_dict = {"game_code": "wq", "title": "league", "source": "hg3535"}
-        # league_list = []
-        #
-        # league_key = ["name_chinese", "kind", "match_mode", "if_stop", "last_time", "lg_id", "source", "uuid"]
-        # league_value = [league_name, "1", "1", "0", last_time, league_id, "hg3535", uuid]
-        # league_data = dict(zip(league_key, league_value))
-        # league_list.append(league_data)
-        # league_dict['data'] = league_list
-        # if self.db.hg3535_wq_league.find({'lg_id': league_id}).count() < 1:
-        #     res = Helper.async_post(url + '/setLeague', league_dict)
-        #     print(res)
-        #     self.db.hg3535_wq_league.insert(league_list)
+        last_time = '2019-12-31 23:59:59'
+        league_dict = {"game_code": "wq", "title": "league", "source": "hg3535"}
+        league_list = []
+
+        league_key = ["name_chinese", "kind", "match_mode", "if_stop", "last_time", "lg_id", "source", "uuid"]
+        league_value = [league_name, "1", "1", "0", last_time, league_id, "hg3535", uuid]
+        league_data = dict(zip(league_key, league_value))
+        league_list.append(league_data)
+        league_dict['data'] = league_list
+        if self.db.hg3535_wq_league.find({'lg_id': league_id}).count() < 1:
+            res = Helper.async_post(url + '/setLeague', league_dict)
+            print(res)
+            self.db.hg3535_wq_league.insert(league_list)
 
         """赛事"""
-        # competition = self.db.hg3535_wq_competition.find_one({"match_id": match_id})
-        # match_list = []
-        # if competition:
-        #     print('网球赛事已存在,修改网球赛事四状态')
-        #     is_morningplate = competition['is_morningplate']
-        #     is_rollball = competition['is_rollball']
-        #     is_stringscene = competition['is_stringscene']
-        #     is_today = competition['is_today']
-        #     status = competition['status']
-        #     match_date = competition['match_date']
-        #     match_time = competition['match_time']
-        #     us_time = competition['us_time']
-        #     if is_rollball != 1 or status != 1:
-        #         match_dict = {"game_code": "wq", "title": "match", "source": "hg3535"}
-        #         match_key = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time",
-        #                      "tag", "source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
-        #                      "half_match_id", "is_today", 'rule']
-        #         match_value = [team_home, team_guest, league_id, 1, match_id, match_date, match_time, tag_number,
-        #                        "hg3535", 1, is_morningplate, is_stringscene, us_time, uuid, 0, is_today, '']
-        #         match_data = dict(zip(match_key, match_value))
-        #         match_list.append(match_data)
-        #         match_dict['data'] = match_list
-        #         res = Helper.async_post(url + '/setMatch', match_dict)
-        #         print(res)
-        #         self.db.hg3535_wq_competition.insert(match_list)
-        #         self.db.hg3535_wq_competition.update({'match_id': str(match_id)},
-        #                                              {"$set": {"is_rollball": 1, "status": 1}},
-        #                                              upsert=True)
-        #     else:
-        #         print("网球赛事已存在,网球赛事状态时间未改变,不做修改")
-        # else:
-        #     is_rollball = 1
-        #     is_today = 0
-        #     is_morningplate = 0
-        #     is_stringscene = 0
-        #     match_dict = {"game_code": "wq", "title": "match", "source": "hg3535"}
-        #     match_key = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time",
-        #                  "tag", "source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
-        #                  "half_match_id", "is_today", 'rule']
-        #     match_value = [team_home, team_guest, league_id, 1, match_id, r_ctime, "00:00", tag_number,
-        #                    "hg3535", is_rollball, is_morningplate, is_stringscene, utime, uuid, 0, is_today, '']
-        #     match_data = dict(zip(match_key, match_value))
-        #     match_list.append(match_data)
-        #     match_dict['data'] = match_list
-        #     res = Helper.async_post(url + '/setMatch', match_dict)
-        #     print(res)
-        #     self.db.hg3535_wq_competition.insert(match_list)
+        competition = self.db.hg3535_wq_competition.find_one({"match_id": match_id})
+        match_list = []
+        if competition:
+            print('网球赛事已存在,修改网球赛事四状态')
+            is_morningplate = competition['is_morningplate']
+            is_rollball = competition['is_rollball']
+            is_stringscene = competition['is_stringscene']
+            is_today = competition['is_today']
+            status = competition['status']
+            match_date = competition['match_date']
+            match_time = competition['match_time']
+            us_time = competition['us_time']
+            if is_rollball != 1 or status != 1:
+                match_dict = {"game_code": "wq", "title": "match", "source": "hg3535"}
+                match_key = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time",
+                             "tag", "source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
+                             "half_match_id", "is_today", 'rule']
+                match_value = [team_home, team_guest, league_id, 1, match_id, match_date, match_time, tag_number,
+                               "hg3535", 1, is_morningplate, is_stringscene, us_time, uuid, 0, is_today, '']
+                match_data = dict(zip(match_key, match_value))
+                match_list.append(match_data)
+                match_dict['data'] = match_list
+                res = Helper.async_post(url + '/setMatch', match_dict)
+                print(res)
+                self.db.hg3535_wq_competition.insert(match_list)
+                self.db.hg3535_wq_competition.update({'match_id': str(match_id)},
+                                                     {"$set": {"is_rollball": 1, "status": 1}},
+                                                     upsert=True)
+            else:
+                print("网球赛事已存在,网球赛事状态时间未改变,不做修改")
+        else:
+            is_rollball = 1
+            is_today = 0
+            is_morningplate = 0
+            is_stringscene = 0
+            match_dict = {"game_code": "wq", "title": "match", "source": "hg3535"}
+            match_key = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time",
+                         "tag", "source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
+                         "half_match_id", "is_today", 'rule']
+            match_value = [team_home, team_guest, league_id, 1, match_id, r_ctime, "00:00", tag_number,
+                           "hg3535", is_rollball, is_morningplate, is_stringscene, utime, uuid, 0, is_today, '']
+            match_data = dict(zip(match_key, match_value))
+            match_list.append(match_data)
+            match_dict['data'] = match_list
+            res = Helper.async_post(url + '/setMatch', match_dict)
+            print(res)
+            self.db.hg3535_wq_competition.insert(match_list)
 
         """赔率"""
         try:
@@ -162,13 +162,13 @@ class Roll_Wangqiupipeline(object):
         if kemps_dict:
             for key, value in kemps_dict.items():
                 if value:
-                    sole_str = 'kemps' + 'key' + '0' + str(match_id) + 'hg3535'
+                    sole_str = 'C' + str(key) + '0' + str(match_id) + 'hg3535'
                     sole = Helper.genearte_MD5(sole_str)
-                    odds_str = 'kemps' + str(key) + '0' + '0' + str(value) + 'hg3535' + str(match_id)
+                    odds_str = 'C' + str(key) + '0' + '0' + str(value) + 'hg3535' + str(match_id)
                     odds_only = Helper.genearte_MD5(odds_str)
                     kemps_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                  "condition", "odds_only", "sole", "source", "type", "team"]
-                    kemps_value = [match_id, league_id, key, "0", 0, 'kemps', value, '',
+                    kemps_value = [match_id, league_id, key, "0", 0, 'C', value, '',
                                    odds_only, sole, "hg3535", "0", ""]
                     kemps_data = dict(zip(kemps_key, kemps_value))
                     odds_onlys.append(odds_only)
@@ -178,15 +178,15 @@ class Roll_Wangqiupipeline(object):
         if concedes_dict:
             for key, value in concedes_dict.items():
                 if value:
-                    sole_str = 'concedes' + 'key' + '0' + str(match_id) + 'hg3535'
+                    sole_str = 'LD' + str(key) + '0' + str(match_id) + 'hg3535'
                     sole = Helper.genearte_MD5(sole_str)
-                    odds_str = 'concedes' + str(key) + '0' + str(concedes_dict_rule[key]) + str(
+                    odds_str = 'LD' + str(key) + '0' + str(concedes_dict_rule[key]) + str(
                         value) + 'hg3535' + str(match_id)
                     odds_only = Helper.genearte_MD5(odds_str)
                     condition = fuhao(concedes_dict_rule[key])
                     concedes_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                     "condition", "odds_only", "sole", "source", "type", "team"]
-                    concedes_value = [match_id, league_id, key, "0", 0, 'concede', value, condition,
+                    concedes_value = [match_id, league_id, key, "0", 0, 'LD', value, condition,
                                       odds_only, sole, "hg3535", "0", ""]
                     concedes_data = dict(zip(concedes_key, concedes_value))
                     odds_onlys.append(odds_only)
@@ -196,15 +196,15 @@ class Roll_Wangqiupipeline(object):
         if bureaus_dict:
             for key, value in bureaus_dict.items():
                 if value:
-                    sole_str = 'bureaus' + 'key' + '0' + str(match_id) + 'hg3535'
+                    sole_str = 'LB' + str(key) + '0' + str(match_id) + 'hg3535'
                     sole = Helper.genearte_MD5(sole_str)
-                    odds_str = 'bureaus' + str(key) + '0' + str(bureaus_dict_rule[key]) + str(
+                    odds_str = 'LB' + str(key) + '0' + str(bureaus_dict_rule[key]) + str(
                         value) + 'hg3535' + str(match_id)
                     odds_only = Helper.genearte_MD5(odds_str)
                     condition = fuhao(bureaus_dict_rule[key])
                     bureaus_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                    "condition", "odds_only", "sole", "source", "type", "team"]
-                    bureaus_value = [match_id, league_id, key, "0", 0, 'bureaus', value, condition,
+                    bureaus_value = [match_id, league_id, key, "0", 0, 'LB', value, condition,
                                      odds_only, sole, "hg3535", "0", ""]
                     bureaus_data = dict(zip(bureaus_key, bureaus_value))
                     odds_onlys.append(odds_only)
@@ -214,15 +214,15 @@ class Roll_Wangqiupipeline(object):
         if total_number_dict:
             for key, value in total_number_dict.items():
                 if value:
-                    sole_str = 'total_number' + 'key' + '0' + str(match_id) + 'hg3535'
+                    sole_str = 'TN' + str(key) + '0' + str(match_id) + 'hg3535'
                     sole = Helper.genearte_MD5(sole_str)
-                    odds_str = 'total_number' + str(key) + '0' + str(
+                    odds_str = 'TN' + str(key) + '0' + str(
                         total_number_dict_rule[key]) + str(value) + 'hg3535' + str(match_id)
                     odds_only = Helper.genearte_MD5(odds_str)
                     condition = fuhao(total_number_dict_rule[key])
                     total_number_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                         "condition", "odds_only", "sole", "source", "type", "team"]
-                    total_number_value = [match_id, league_id, key, "0", 0, 'bureaus', value,
+                    total_number_value = [match_id, league_id, key, "0", 0, 'TN', value,
                                           condition, odds_only, sole, "hg3535", "0", ""]
                     total_number_data = dict(zip(total_number_key, total_number_value))
                     odds_onlys.append(odds_only)
@@ -233,15 +233,15 @@ class Roll_Wangqiupipeline(object):
             for key, value in odd_evens_dict.items():
                 if value:
                     condition = odd_evens_dict_rule[key]
-                    odds_str = "odd_evens" + key + '0' + str(odd_evens_dict_rule[key]) + str(
+                    odds_str = "TS" + str(key) + '0' + str(odd_evens_dict_rule[key]) + str(
                         value) + "hg3535" + str(match_id)
-                    sole_str = "odd_evens" + "key" + '0' + str(match_id) + "hg3535"
+                    sole_str = "TS" + str(key) + '0' + str(match_id) + "hg3535"
                     odds_only = Helper.genearte_MD5(odds_str)
                     sole = Helper.genearte_MD5(sole_str)
                     odds_onlys.append(odds_only)
                     odd_evens_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                      "condition", "odds_only", "sole", "source", "type", "team"]
-                    odd_evens_value = [match_id, league_id, key, "0", 0, 'odd_evens', value,
+                    odd_evens_value = [match_id, league_id, key, "0", 0, 'TS', value,
                                        condition, odds_only, sole, "hg3535", "0", ""]
                     odd_evens_data = dict(zip(odd_evens_key, odd_evens_value))
                     if odds_only not in odds_only_list:
@@ -266,16 +266,17 @@ class Roll_Wangqiupipeline(object):
         da_list = []
         wq_rball = {"lg_id": league_id, "home_player_name": team_home, "guest_player_name": team_guest,
                     "home_player_let_plate": '', "guest_player_let_plate": '', "home_player_let_inning": "",
-                    "guest_player_let_inning": "", "all_inning": "", "home_player_score": score_home,
+                    "guest_player_let_inning": "", "all_inning": score_dict['total_inning'],
+                    "home_player_score": score_home,
                     "guest_player_score": score_guest,
                     "status": 1, "first_score_player": "", "last_score_player": "",
                     "first_inning_score": score_dict['one_score'],
                     "second_inning_score": score_dict['second_score'], "third_inning_score": score_dict['third_score'],
                     "match_winer_player": "", "update_time": "",
                     "match_time": time_game, "match_process": jijie, "tag": tag_number, "match_id": match_id,
-                    "source": "hg3535",
-                    "match_score": score_dict['current_point_home_guest'], "ctime": ctime, "inning": "",
-                    "strat_time": "", "uuid": uuid, "result_mark": score_dict
+                    "source": "hg3535", "result_mark": score_dict, "warn_more": '', "uuid": uuid,
+                    # "match_score": score_dict['current_point_home_guest'], "ctime": ctime, "inning": "",
+                    # "strat_time": ""
                     }
 
         da_list.append(wq_rball)
@@ -290,5 +291,5 @@ class Roll_Wangqiupipeline(object):
                 res = Helper.async_post(url + '/setMatchResult', r_data_dict)
                 print(res)
             except Exception as e:
-                logger.warning('滚球接口数据异常, 提交失败')
+                logger.warning('网球滚球接口数据异常, 提交失败')
                 logger.warning(e)

+ 84 - 95
hg3535/pipeline/roll_zuqiu.py

@@ -2,7 +2,7 @@
 import pymongo
 import time
 import logging
-from ball_func import fuhao
+from .ball_func import fuhao
 from ..utils.helper import Helper
 from .ball_func import get_pcode
 
@@ -133,7 +133,8 @@ class Roll_Zuqiupipeline(object):
         except:
             uuid_list = []
             result = ''
-        p_code, p_id = get_pcode(corner_ball, 'goal_size')
+        # p_code, p_id = get_pcode(corner_ball, 'goal_size')
+        p_code = "GS"
         # 构建唯一索引
         half_size_guest = item["half_size_guest"]
         half_size_guest_rule = item["half_size_guest_rule"]
@@ -145,32 +146,32 @@ class Roll_Zuqiupipeline(object):
 
         # half_size_guest
         for index, value in enumerate(half_size_guest):
-            hash_str = p_code + "half_size_guest" + str(index) + str(half_size_guest_rule[index]) + str(
+            hash_str = p_code + "gss_h" + str(index) + str(half_size_guest_rule[index]) + str(
                 value) + "hg3535" + str(match_id)
-            sole_str = p_code + "half_size_guest" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "gss_h" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             half_size_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                    "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(half_size_guest_rule[index])
-            half_size_guest_value = [match_id, league_id, "half_size_guest", "0", index, p_code, value, condition,
+            half_size_guest_value = [match_id, league_id, "gss_h", "0", index, p_code, value, condition,
                                      odds_only, sole, "hg3535", "0", ""]
             half_size_guest_data = dict(zip(half_size_guest_key, half_size_guest_value))
             if odds_only not in uuid_list:
                 data_list.append(half_size_guest_data)
         # half_size_home
         for index, value in enumerate(half_size_home):
-            hash_str = p_code + "half_size_home" + str(index) + str(half_size_home_rule[index]) + str(
+            hash_str = p_code + "gsb_h" + str(index) + str(half_size_home_rule[index]) + str(
                 value) + "hg3535" + str(match_id)
-            sole_str = p_code + "half_size_home" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "gsb_h" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             half_size_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                   "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(half_size_home_rule[index])
-            half_size_home_value = [match_id, league_id, "half_size_guest", "0", index, p_code, value, condition,
+            half_size_home_value = [match_id, league_id, "gsb_h", "0", index, p_code, value, condition,
                                     odds_only, sole, "hg3535", "0", ""]
             half_size_home_data = dict(zip(half_size_home_key, half_size_home_value))
             if odds_only not in uuid_list:
@@ -183,70 +184,71 @@ class Roll_Zuqiupipeline(object):
         size_home_rule = item["size_home_rule"]
         # size_home
         for index, value in enumerate(size_home):
-            hash_str = p_code + "size_home" + str(index) + str(size_home_rule[index]) + str(value) + "hg3535" + str(
+            hash_str = p_code + "gsb" + str(index) + str(size_home_rule[index]) + str(value) + "hg3535" + str(
                 match_id)
-            sole_str = p_code + "size_home" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "gsb" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             size_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                              "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(size_home_rule[index])
-            size_home_value = [match_id, league_id, "size_home", "0", index, p_code, value, condition, odds_only,
+            size_home_value = [match_id, league_id, "gsb", "0", index, p_code, value, condition, odds_only,
                                sole, "hg3535", "0", ""]
             size_home_data = dict(zip(size_home_key, size_home_value))
             if odds_only not in uuid_list:
                 data_list.append(size_home_data)
         # size_guest
         for index, value in enumerate(size_guest):
-            hash_str = p_code + "size_guest" + str(index) + str(size_guest_rule[index]) + str(value) + "hg3535" + str(
+            hash_str = p_code + "gss" + str(index) + str(size_guest_rule[index]) + str(value) + "hg3535" + str(
                 match_id)
-            sole_str = p_code + "size_guest" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "gss" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             size_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                               "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(size_guest_rule[index])
-            size_guest_value = [match_id, league_id, "size_guest", "0", index, p_code, value, condition, odds_only,
+            size_guest_value = [match_id, league_id, "gss", "0", index, p_code, value, condition, odds_only,
                                 sole, "hg3535", "0", ""]
             size_home_data = dict(zip(size_guest_key, size_guest_value))
             if odds_only not in uuid_list:
                 data_list.append(size_home_data)
 
-        p_code, p_id = get_pcode(corner_ball, 'concede')
+        # p_code, p_id = get_pcode(corner_ball, 'concede')
+        p_code = 'CO'
         half_concede_home_rule = item["half_concede_home_rule"]
         half_concede_home = item["half_concede_home"]
         half_concede_guest_rule = item["half_concede_guest_rule"]
         half_concede_guest = item["half_concede_guest"]
         # half_concede_home
         for index, value in enumerate(half_concede_guest):
-            hash_str = p_code + "half_concede_guest" + str(index) + str(half_concede_guest_rule[index]) + str(
+            hash_str = p_code + "cog_h" + str(index) + str(half_concede_guest_rule[index]) + str(
                 value) + "hg3535" + str(match_id)
-            sole_str = p_code + "half_concede_guest" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "cog_h" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             half_concede_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                       "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(half_concede_guest_rule[index])
-            half_concede_guest_value = [match_id, league_id, "half_concede_guest", "0", index, p_code, value, condition,
+            half_concede_guest_value = [match_id, league_id, "cog_h", "0", index, p_code, value, condition,
                                         odds_only, sole, "hg3535", "0", ""]
             half_concede_guest_data = dict(zip(half_concede_guest_key, half_concede_guest_value))
             if odds_only not in uuid_list:
                 data_list.append(half_concede_guest_data)
         # half_concede_home
         for index, value in enumerate(half_concede_home):
-            hash_str = p_code + "half_concede_home" + str(index) + str(half_concede_home_rule[index]) + str(
+            hash_str = p_code + "coh_h" + str(index) + str(half_concede_home_rule[index]) + str(
                 value) + "hg3535" + str(match_id)
-            sole_str = p_code + "half_concede_home" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "coh_h" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             half_concede_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                      "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(half_concede_home_rule[index])
-            half_concede_home_value = [match_id, league_id, "half_concede_home", "0", index, p_code, value, condition,
+            half_concede_home_value = [match_id, league_id, "coh_h", "0", index, p_code, value, condition,
                                        odds_only, sole, "hg3535", "0", ""]
             half_concede_home_data = dict(zip(half_concede_home_key, half_concede_home_value))
             if odds_only not in uuid_list:
@@ -258,39 +260,40 @@ class Roll_Zuqiupipeline(object):
         concede_home_rule = item["concede_home_rule"]
         # concede_guest
         for index, value in enumerate(concede_guest):
-            hash_str = p_code + "concede_guest" + str(index) + str(concede_guest_rule[index]) + str(
+            hash_str = p_code + "cog" + str(index) + str(concede_guest_rule[index]) + str(
                 value) + "hg3535" + str(match_id)
-            sole_str = p_code + "concede_guest" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "cog" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             concede_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                  "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(concede_guest[index])
-            concede_guest_value = [match_id, league_id, "concede_guest", "0", index, p_code, value, condition,
+            concede_guest_value = [match_id, league_id, "cog", "0", index, p_code, value, condition,
                                    odds_only, sole, "hg3535", "0", ""]
             concede_guest_data = dict(zip(concede_guest_key, concede_guest_value))
             if odds_only not in uuid_list:
                 data_list.append(concede_guest_data)
         # concede_home
         for index, value in enumerate(concede_home):
-            hash_str = p_code + "concede_home" + str(index) + str(concede_home_rule[index]) + str(
+            hash_str = p_code + "coh" + str(index) + str(concede_home_rule[index]) + str(
                 value) + "hg3535" + str(match_id)
-            sole_str = p_code + "concede_home" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "coh" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             concede_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                 "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(concede_home_rule[index])
-            concede_home_value = [match_id, league_id, "concede_home", "0", index, p_code, value, condition, odds_only,
+            concede_home_value = [match_id, league_id, "coh", "0", index, p_code, value, condition, odds_only,
                                   sole, "hg3535", "0", ""]
             concede_guest_data = dict(zip(concede_home_key, concede_home_value))
             if odds_only not in uuid_list:
                 data_list.append(concede_guest_data)
 
         # 独赢----------------------------------------------------------------------------------------------------------
-        p_code, p_id = get_pcode(corner_ball, 'capot')
+        # p_code, p_id = get_pcode(corner_ball, 'capot')
+        p_code = 'C'
         half_capot_home = item["half_capot_home"]
         half_capot_guest = item["half_capot_guest"]
         half_capot_dogfall = item["half_capot_dogfall"]
@@ -299,152 +302,152 @@ class Roll_Zuqiupipeline(object):
         capot_dogfall = item["capot_dogfall"]
 
         # half_capot_home
-        hash_str = p_code + "half_capot_home" + '0' + '1' + str(half_capot_home) + "hg3535" + str(match_id)
-        sole_str = p_code + "half_capot_home" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "ch_h" + '0' + '1' + str(half_capot_home) + "hg3535" + str(match_id)
+        sole_str = p_code + "ch_h" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         half_capot_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                "odds_only", "sole", "source", "type", "team"]
-        half_capot_home_value = [match_id, league_id, "half_capot_home", "0", 0, p_code, half_capot_home, '1',
+        half_capot_home_value = [match_id, league_id, "ch_h", "0", 0, p_code, half_capot_home, '1',
                                  odds_only, sole, "hg3535", "0", ""]
         half_capot_homet_data = dict(zip(half_capot_home_key, half_capot_home_value))
         if odds_only not in uuid_list:
             data_list.append(half_capot_homet_data)
 
         # half_capot_guest
-        hash_str = p_code + "half_capot_guest" + '0' + '2' + str(half_capot_guest) + "hg3535" + str(match_id)
-        sole_str = p_code + "half_capot_guest" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "cg_h" + '0' + '2' + str(half_capot_guest) + "hg3535" + str(match_id)
+        sole_str = p_code + "cg_h" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         half_capot_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                 "odds_only", "sole", "source", "type", "team"]
-        half_capot_guest_value = [match_id, league_id, "half_capot_guest", "0", 0, p_code, half_capot_guest, '2',
+        half_capot_guest_value = [match_id, league_id, "cg_h", "0", 0, p_code, half_capot_guest, '2',
                                   odds_only, sole, "hg3535", "0", ""]
         half_capot_guest_data = dict(zip(half_capot_guest_key, half_capot_guest_value))
         if odds_only not in uuid_list:
             data_list.append(half_capot_guest_data)
 
         # half_capot_dogfall
-        hash_str = p_code + "half_capot_dogfall" + '0' + 'X' + str(half_capot_dogfall) + "hg3535" + str(match_id)
-        sole_str = p_code + "half_capot_dogfall" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "cd_h" + '0' + 'X' + str(half_capot_dogfall) + "hg3535" + str(match_id)
+        sole_str = p_code + "cd_h" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         half_capot_dogfall_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                   "odds_only", "sole", "source", "type", "team"]
-        half_capot_dogfall_value = [match_id, league_id, "half_capot_guest", "0", 0, p_code, half_capot_dogfall, 'X',
+        half_capot_dogfall_value = [match_id, league_id, "cd_h", "0", 0, p_code, half_capot_dogfall, 'X',
                                     odds_only, sole, "hg3535", "0", ""]
         half_capot_dogfall_data = dict(zip(half_capot_dogfall_key, half_capot_dogfall_value))
         if odds_only not in uuid_list:
             data_list.append(half_capot_dogfall_data)
         # capot_dogfall
-        hash_str = p_code + "capot_dogfall" + '0' + 'X' + str(capot_dogfall) + "hg3535" + str(match_id)
-        sole_str = p_code + "capot_dogfall" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "cd" + '0' + 'X' + str(capot_dogfall) + "hg3535" + str(match_id)
+        sole_str = p_code + "cd" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         capot_dogfall_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                              "odds_only", "sole", "source", "type", "team"]
-        capot_dogfall_value = [match_id, league_id, "half_capot_guest", "0", 0, p_code, capot_dogfall, 'X', odds_only,
+        capot_dogfall_value = [match_id, league_id, "cd", "0", 0, p_code, capot_dogfall, 'X', odds_only,
                                sole, "hg3535", "0", ""]
         capot_dogfall_data = dict(zip(capot_dogfall_key, capot_dogfall_value))
         if odds_only not in uuid_list:
             data_list.append(capot_dogfall_data)
 
         # capot_home
-        hash_str = p_code + "capot_home" + '0' + '1' + str(capot_home) + "hg3535" + str(match_id)
-        sole_str = p_code + "capot_home" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "ch" + '0' + '1' + str(capot_home) + "hg3535" + str(match_id)
+        sole_str = p_code + "ch" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         capot_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                           "odds_only", "sole", "source", "type", "team"]
-        capot_home_value = [match_id, league_id, "half_capot_home", "0", 0, p_code, capot_home, '1',
+        capot_home_value = [match_id, league_id, "ch", "0", 0, p_code, capot_home, '1',
                             odds_only, sole, "hg3535", "0", ""]
         capot_homet_data = dict(zip(capot_home_key, capot_home_value))
         if odds_only not in uuid_list:
             data_list.append(capot_homet_data)
         # capot_guest
-        hash_str = p_code + "capot_guest" + '0' + '2' + str(capot_guest) + "hg3535" + str(match_id)
-        sole_str = p_code + "capot_guest" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "cg" + '0' + '2' + str(capot_guest) + "hg3535" + str(match_id)
+        sole_str = p_code + "cg" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         capot_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                            "odds_only", "sole", "source", "type", "team"]
-        capot_guest_value = [match_id, league_id, "half_capot_guest", "0", 0, p_code, capot_home, '2',
+        capot_guest_value = [match_id, league_id, "cg", "0", 0, p_code, capot_home, '2',
                              odds_only, sole, "hg3535", "0", ""]
         capot_guest_data = dict(zip(capot_guest_key, capot_guest_value))
         if odds_only not in uuid_list:
             data_list.append(capot_guest_data)
 
         # 入球数单双-----------------------------------------------------------------------------------------------------
-        p_code, p_id = get_pcode(corner_ball, 'two_sides')
+        # p_code, p_id = get_pcode(corner_ball, 'two_sides')
+        p_code = 'TS'
         odd_even_odd = item["odd_even_odd"]
         odd_even_even = item["odd_even_even"]
         half_odd_even_odd = item["half_odd_even_odd"]
         half_odd_even_even = item["half_odd_even_even"]
 
         # odd_even_odd
-        hash_str = p_code + "two_sides_single" + '0' + '单' + str(odd_even_odd) + "hg3535" + str(match_id)
-        sole_str = p_code + "two_sides_single" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "tss" + '0' + '单' + str(odd_even_odd) + "hg3535" + str(match_id)
+        sole_str = p_code + "tss" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         single_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                       "odds_only", "sole", "source", "type", "team"]
-        single_value = [match_id, league_id, "two_sides_single", "0", 0, p_code, odd_even_odd, '单',
+        single_value = [match_id, league_id, "tss", "0", 0, p_code, odd_even_odd, '单',
                         odds_only, sole, "hg3535", "0", ""]
         single_data = dict(zip(single_key, single_value))
         if odds_only not in uuid_list:
             data_list.append(single_data)
         # odd_even_even
-        hash_str = p_code + "two_sides_double" + '0' + '双' + str(odd_even_even) + "hg3535" + str(match_id)
-        sole_str = p_code + "two_sides_double" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "tsd" + '0' + '双' + str(odd_even_even) + "hg3535" + str(match_id)
+        sole_str = p_code + "tss" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         double_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                       "odds_only", "sole", "source", "type", "team"]
-        double_value = [match_id, league_id, "two_sides_double", "0", 0, p_code, odd_even_even, '双',
+        double_value = [match_id, league_id, "tss", "0", 0, p_code, odd_even_even, '双',
                         odds_only, sole, "hg3535", "0", ""]
         double_data = dict(zip(double_key, double_value))
         if odds_only not in uuid_list:
             data_list.append(double_data)
         # half_odd_even_even
-        hash_str = p_code + "two_sides_double" + '0' + '双' + str(half_odd_even_even) + "hg3535" + str(match_id)
-        sole_str = p_code + "two_sides_double" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "tsd_h" + '0' + '双' + str(half_odd_even_even) + "hg3535" + str(match_id)
+        sole_str = p_code + "tsd_h" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         half_double_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                            "odds_only", "sole", "source", "type", "team"]
-        half_double_value = [match_id, league_id, "two_sides_double", "0", 0, p_code, half_odd_even_even, '双',
+        half_double_value = [match_id, league_id, "tsd_h", "0", 0, p_code, half_odd_even_even, '双',
                              odds_only, sole, "hg3535", "0", ""]
         half_double_data = dict(zip(half_double_key, half_double_value))
         if odds_only not in uuid_list:
             data_list.append(half_double_data)
         # half_odd_even_odd
-        hash_str = p_code + "two_sides_single" + '0' + '单' + str(half_odd_even_odd) + "hg3535" + str(match_id)
-        sole_str = p_code + "two_sides_single" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "tss_h" + '0' + '单' + str(half_odd_even_odd) + "hg3535" + str(match_id)
+        sole_str = p_code + "tss_h" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         half_single_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                            "odds_only", "sole", "source", "type", "team"]
-        half_single_value = [match_id, league_id, "two_sides_single", "0", 0, p_code, half_odd_even_odd, '单', odds_only,
+        half_single_value = [match_id, league_id, "tss_h", "0", 0, p_code, half_odd_even_odd, '单', odds_only,
                              sole, "hg3535", "0", ""]
         half_single_data = dict(zip(half_single_key, half_single_value))
         if odds_only not in uuid_list:
             data_list.append(half_single_data)
         # 总入球数 ------------------------------------------------------------------------------------------------------
-        p_code, p_id = get_pcode(corner_ball, 'total_goal')
+        # p_code, p_id = get_pcode(corner_ball, 'total_goal')
         total_goals = item['total_goal']
-        total_dict = {'total_goal_zero': '0-1', 'total_goal_two': '2-3', 'total_goal_four': '4-6',
-                      'total_goal_seven': '7或以上', 'half_total_goal_zero': '0', "half_total_goal_one": '1',
-                      "half_total_goal_two": '2', "half_total_goal_three": '3或以上'}
+        total_dict = {'tg0': '0-1', 'tg1': '2-3', 'tg2': '4-6','tg3': '7或以上', 'tg0_h': '0', "tg1_h": '1',
+                      "tg2_h": '2', "tg3_h": '3或以上'}
         # 全场入球数 单双
         # 上半场入球数 单双
         for key, value in total_goals.items():
@@ -463,12 +466,10 @@ class Roll_Zuqiupipeline(object):
 
         # 全场半场 ------------------------------------------------------------------------------------------------------
         half_fulls = item['half_full']
-        p_code, p_id = get_pcode(corner_ball, 'half_full')
-        full_dict = {"half_full_home_home": "主主", "half_full_home_dogfall": "主和",
-                     "half_full_home_guest": "主客", "half_full_dogfall_home": "和主",
-                     "half_full_dogfall_dogfall": "和和", "half_full_dogfall_guest": "和客",
-                     "half_full_guest_home": "客主", "half_full_guest_dogfall": "客和",
-                     "half_full_guest_guest": "客客"}
+        # p_code, p_id = get_pcode(corner_ball, 'half_full')
+        p_code = 'HF'
+        full_dict = {"hfhh": "主主", "hfhd": "主和", "hfhg": "主客", "hfdh": "和主",
+                     "hfdd": "和和", "hfdg": "和客", "hfgh": "客主", "hfgd": "客和", "hfgg": "客客"}
         if half_fulls:
             for key, value in half_fulls.items():
                 hash_str = p_code + key + '0' + full_dict[key] + str(value) + "hg3535" + str(match_id)
@@ -487,28 +488,14 @@ class Roll_Zuqiupipeline(object):
         # 波胆------------------------------------------------------------------------------------------------------------------
         bodan_datas = item['bodan_data']
         p_code, p_id = get_pcode(corner_ball, 'bodan')
-        bodan_dict = {"bodanhome_one_zero": "1-0", "bodanhome_two_zero": "2-0",
-                      "bodanhome_two_one": "2-1", "bodanhome_three_zero": "3-0",
-                      "bodanhome_three_one": "3-1", "bodanhome_three_two": "3-2",
-                      "bodanhome_four_zero": "4-0", "bodanhome_four_one": "4-1",
-                      "bodanhome_four_two": "4-2", "bodanhome_four_three": "4-3",
-                      "bodanguest_one_zero": "0-1", "bodanguest_two_zero": "0-2",
-                      "bodanguest_two_one": "1-2", "bodanguest_three_zero": "0-3",
-                      "bodanguest_three_one": "1-3", "bodanguest_three_two": "2-3",
-                      "bodanguest_four_zero": "0-4", "bodanguest_four_one": "1-4",
-                      "bodanguest_four_two": "2-4", "bodanguest_four_three": "3-4",
-                      "bodandogfall_zero_zero": "0-0", "bodandogfall_one_one": "1-1",
-                      "bodandogfall_two_two": "2-2", "bodandogfall_three_three": "3-3",
-                      "bodandogfall_four_four": "4-4", "bodanother": "其他",
-                      "halfbodanhome_one_zero": "1-0", "halfbodanhome_two_zero": "2-0",
-                      "halfbodanhome_two_one": "2-1", "halfbodanhome_three_zero": "3-0",
-                      "halfbodanhome_three_one": "3-1", "halfbodanhome_three_two": "3-2",
-                      "halfbodanguest_one_zero": "0-1", "halfbodanguest_two_zero": "0-2",
-                      "halfbodanguest_two_one": "1-2", "halfbodanguest_three_zero": "0-3",
-                      "halfbodanguest_three_one": "1-3", "halfbodanguest_three_two": "2-3",
-                      "halfbodandogfall_zero_zero": "0-0", "halfbodandogfall_one_one": "1-1",
-                      "halfbodandogfall_two_two": "2-2", "halfbodandogfall_three_three": "3-3",
-                      "halfbodanother": "其他"}
+        bodan_dict = {"b10": "1-0", "b20": "2-0", "b21": "2-1", "b30": "3-0", "b31": "3-1", "b32": "3-2",
+                      "b40": "4-0", "b41": "4-1", "b42": "4-2", "b43": "4-3", "b01": "0-1", "b02": "0-2",
+                      "b12": "1-2", "b03": "0-3", "b13": "1-3", "b23": "2-3", "b04": "0-4", "b14": "1-4",
+                      "b24": "2-4", "b34": "3-4", "b00": "0-0", "b11": "1-1", "b22": "2-2", "b33": "3-3",
+                      "b44": "4-4", "bo": "其他", "b10_h": "1-0", "b20_h": "2-0", "b21_h": "2-1", "b30_h": "3-0",
+                      "b31_h": "3-1", "b32_h": "3-2", "b01_h": "0-1", "b02_h": "0-2", "b12_h": "1-2", "b03_h": "0-3",
+                      "b13_h": "1-3", "b23_h": "2-3", "b00_h": "0-0", "b11_h": "1-1", "b22_h": "2-2", "b33_h": "3-3",
+                      "bo_h": "其他"}
         if bodan_datas:
             for key, value in bodan_datas.items():
                 hash_str = p_code + key + '0' + bodan_dict[key] + str(value) + "hg3535" + str(match_id)
@@ -526,9 +513,9 @@ class Roll_Zuqiupipeline(object):
 
         # 最先进球/最后进球 ----------------------------------------------------------------------------------------------
         first_last_balls = item['first_last_ball']
-        p_code, p_id = get_pcode(corner_ball, 'first_last_ball')
-        first_last_dict = {"first_last_ball": "最先进球", "first_ball_home": "最先进球", "first_ball_guest": "最先进球",
-                           "last_ball_home": "最后进球", "last_ball_guest": "最后进球", "not_ball": "没有进球"}
+        # p_code, p_id = get_pcode(corner_ball, 'first_last_ball')
+        p_code = 'FLB'
+        first_last_dict = {"flbfh": "最先进球", "flbfg": "最先进球", "flblh": "最后进球", "flblg": "最后进球", "flbn": "没有进球"}
         if first_last_balls:
             for key, value in first_last_balls.items():
                 hash_str = p_code + key + '0' + first_last_dict[key] + str(value) + "hg3535" + str(match_id)
@@ -546,7 +533,9 @@ class Roll_Zuqiupipeline(object):
                 if odds_only not in uuid_list:
                     data_list.append(first_last_balls_data)
 
-        p_code, p_id = get_pcode(corner_ball, 'tema_ball')
+        # p_code, p_id = get_pcode(corner_ball, 'tema_ball')
+        p_code = 'TB'
+        # 球队得分全场,上半场
         full_dicts = item['full_data']
         half_dicts = item['half_data']
         full_dict_rules = item['full_data_rule']

+ 16 - 16
hg3535/pipeline/wangqiu.py

@@ -212,15 +212,15 @@ class Wangqiupipeline(object):
         # 让盘
         if concedes_dict:
             for key, value in concedes_dict.items():
-                sole_str = 'dishes' + 'concedes' + str(key) + str(match_id) + 'hg3535'
+                sole_str = 'LD' + str(key) + '0' + str(match_id) + 'hg3535'
                 sole = Helper.genearte_MD5(sole_str)
-                odds_str = 'dishes' + 'concedes' + str(key) + str(match_id) + 'hg3535' + str(concedes_dict_rule[key]) + str(
+                odds_str = 'LD' + str(key) + str(match_id) + 'hg3535' + str(concedes_dict_rule[key]) + str(
                     value)
                 odds_only = Helper.genearte_MD5(odds_str)
                 condition = fuhao(concedes_dict_rule[key])
                 concedes_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                      "odds_only", "sole", "source", "type", "team"]
-                concedes_dict_value = [match_id, league_id, key, '0', '0', 'dishes', value, condition,
+                concedes_dict_value = [match_id, league_id, key, '0', 0, 'LD', value, condition,
                                        odds_only, sole, 'hg3535', '0', '']
                 concedes_dict_data = dict(zip(concedes_dict_key, concedes_dict_value))
                 odds_onlys.append(odds_only)
@@ -229,15 +229,15 @@ class Wangqiupipeline(object):
         # 让局
         if bureaus_dict:
             for key, value in bureaus_dict.items():
-                sole_str = 'bureau' + str(key) + str(match_id) + 'hg3535'
+                sole_str = 'LB' + str(key) + str(match_id) + 'hg3535'
                 sole = Helper.genearte_MD5(sole_str)
-                odds_str = 'bureau' + str(key) + str(match_id) + 'hg3535' + str(bureaus_dict_rule[key]) + str(
+                odds_str = 'LB' + str(key) + str(match_id) + 'hg3535' + str(bureaus_dict_rule[key]) + str(
                     value)
                 odds_only = Helper.genearte_MD5(odds_str)
                 condition = fuhao(bureaus_dict_rule[key])
                 bureaus_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                     "odds_only", "sole", "source", "type", "team"]
-                bureaus_dict_value = [match_id, league_id, key, '0', '0', 'bureau', value, condition,
+                bureaus_dict_value = [match_id, league_id, key, '0', 0, 'LB', value, condition,
                                       odds_only, sole, 'hg3535', '0', '']
                 bureaus_dict_data = dict(zip(bureaus_dict_key, bureaus_dict_value))
                 odds_onlys.append(odds_only)
@@ -246,33 +246,33 @@ class Wangqiupipeline(object):
         # 总局数大小
         if total_number_dict:
             for key, value in total_number_dict.items():
-                sole_str = 'total_number' + str(key) + str(match_id) + 'hg3535'
+                sole_str = 'TN' + str(key) + str(match_id) + 'hg3535'
                 sole = Helper.genearte_MD5(sole_str)
-                odds_str = 'total_number' + str(key) + str(match_id) + 'hg3535' + str(
+                odds_str = 'TN' + str(key) + str(match_id) + 'hg3535' + str(
                     total_number_dict_rule[key]) + str(value)
                 odds_only = Helper.genearte_MD5(odds_str)
                 condition = fuhao(total_number_dict_rule[key])
                 total_number_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
                                          "condition",
                                          "odds_only", "sole", "source", "type", "team"]
-                total_number_dict_value = [match_id, league_id, key, '0', '0', 'total_number', value, condition,
+                total_number_dict_value = [match_id, league_id, key, '0', 0, 'TN', value, condition,
                                            odds_only, sole, 'hg3535', '0', '']
                 total_number_dict_data = dict(zip(total_number_dict_key, total_number_dict_value))
                 odds_onlys.append(odds_only)
                 if odds_only not in odds_only_list:
                     data_list.append(total_number_dict_data)
-        # 总决赛单双
+        # 总局数单双
         if odd_evens_dict:
             for key, value in odd_evens_dict.items():
-                sole_str = 'two_game_sides' + str(key) + str(match_id) + 'hg3535'
+                sole_str = 'TS' + str(key) + str(match_id) + 'hg3535'
                 sole = Helper.genearte_MD5(sole_str)
-                odds_str = 'two_game_sides' + str(key) + str(match_id) + 'hg3535' + str(odd_evens_dict_rule[key]) + str(
+                odds_str = 'TS' + str(key) + str(match_id) + 'hg3535' + str(odd_evens_dict_rule[key]) + str(
                     value)
                 odds_only = Helper.genearte_MD5(odds_str)
                 condition = fuhao(odd_evens_dict_rule[key])
                 odd_evens_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                       "odds_only", "sole", "source", "type", "team"]
-                odd_evens_dict_value = [match_id, league_id, key, '0', '0', 'two_game_sides', value, condition,
+                odd_evens_dict_value = [match_id, league_id, key, '0', 0, 'TS', value, condition,
                                         odds_only, sole, 'hg3535', '0', '']
                 odd_evens_dict_data = dict(zip(odd_evens_dict_key, odd_evens_dict_value))
                 odds_onlys.append(odds_only)
@@ -281,13 +281,13 @@ class Wangqiupipeline(object):
         # 冠军
         if kemps_dict:
             for key, value in kemps_dict.items():
-                sole_str = 'kemp' + str(key) + str(match_id) + 'hg3535'
+                sole_str = 'C' + str(key) + str(match_id) + 'hg3535'
                 sole = Helper.genearte_MD5(sole_str)
-                odds_str = 'kemp' + str(key) + str(match_id) + 'hg3535' + '2' + str(value)
+                odds_str = 'C' + str(key) + str(match_id) + 'hg3535' + '2' + str(value)
                 odds_only = Helper.genearte_MD5(odds_str)
                 kemps_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                   "odds_only", "sole", "source", "type", "team"]
-                kemps_dict_value = [match_id, league_id, key, '0', '0', 'kemp', value, '',
+                kemps_dict_value = [match_id, league_id, key, '0', 0, 'C', value, '',
                                     odds_only, sole, 'hg3535', '0', '']
                 kemps_dict_data = dict(zip(kemps_dict_key, kemps_dict_value))
                 odds_onlys.append(odds_only)

+ 917 - 252
hg3535/pipeline/zuqiu.py

@@ -1,31 +1,67 @@
+import asyncio
 import datetime
-import pymongo
+import json
+import aiohttp
 import time
 import logging
+
+from motor.motor_asyncio import AsyncIOMotorClient
 from .ball_func import fuhao
 from ..utils.helper import Helper
-from .ball_func import get_pcode, new_time
-from concurrent.futures import ThreadPoolExecutor
-from requests_futures.sessions import FuturesSession
+from .ball_func import new_time
+# from concurrent.futures import ThreadPoolExecutor
+# from requests_futures.sessions import FuturesSession
 
 
 class Zuqiupipeline(object):
 
     def open_spider(self, spider):
-        self.mongo = pymongo.MongoClient(host="192.168.2.200", username="kaiyou", password="kaiyou", port=27017)
-        self.db = self.mongo['kaiyou']
-        self.session = FuturesSession(executor=ThreadPoolExecutor(max_workers=10))
+        self.connection = AsyncIOMotorClient("mongodb://{}:{}@{}:{}/database?authSource={}".format('kaiyou', 'kaiyou', '192.168.2.200', 27017, 'kaiyou'))
+        self.session = aiohttp.ClientSession()
+        self.url = 'http://admin.5gogo.com'
 
     def process_item(self, item, spider):
-        zq_odds = []
-        # url = 'http://192.168.2.200:9093'
-        url = 'http://admin.5gogo.com'
-        # zq_competitions = []
+        loop = asyncio.get_event_loop()
+        tasks = [
+            asyncio.ensure_future(self._league(item)),
+            asyncio.ensure_future(self._match(item)),
+            asyncio.ensure_future(self._odds(item))
+        ]
+        loop.run_until_complete(asyncio.wait(tasks))
+
+    async def _league(self, item):
+        logger = logging.getLogger(__name__)
+        # 联赛id
+        league_id = item['league_id']
+        # 联赛name
+        league_name = item['league_name']
+        # 联赛接口写入
+        last_time = '2019-12-31 23:59:59'
+        uuid = Helper.genearte_MD5(league_name + 'hg3535')
+        _zq_league = await self.connection.get_database('kaiyou').zq_league35.find_one({'uuid': uuid})
+        if not _zq_league:
+            league_dict = {"game_code": "zq", "title": "league", "source": "hg3535"}
+            league_list = []
+            league_key = ["name_chinese", "kind", "match_mode", "if_stop", "last_time", "lg_id", "source", "uuid"]
+            league_value = [league_name, "1", "1", "0", last_time, league_id, "hg3535", uuid]
+            league_data = dict(zip(league_key, league_value))
+            league_list.append(league_data)
+            league_dict['data'] = league_list
+            response_data = await self.session.post(self.url + '/setLeague', data={"data": json.dumps(league_dict),
+                                                                                   "token": 'JlUo1415650051585d481566c10c9'})
+            if response_data.status == 200:
+                await self.connection.get_database('kaiyou').zq_league35.insert_one(league_data)
+                logger.info(league_dict)
+            else:
+                logger.warning(response_data.status)
+                logger.warning(league_dict)
+        else:
+            logger.info('足球联赛已存在')
+
+    async def _match(self, item):
         logger = logging.getLogger(__name__)
-        # 比赛日期
         try:
             data_game = item['data_game'].split("/")
-            # print(data_game)
             month = str(data_game[1].strip())
             day = str(data_game[0])
         except Exception as e:
@@ -36,16 +72,11 @@ class Zuqiupipeline(object):
                           'Aug': '08', 'Sep': '09', 'Oct': '10', 'Nov': '11', 'Dec': '12'}
             month = month_dict[months]
             day = str(data_game[0])
-
         # 比赛时间
         time_game = str(item['time_game'])
         # 比赛时间,时间戳
         # datetime.datetime.now().year
         us_time = str(datetime.datetime.now().year) + "-" + month + "-" + day + " " + time_game + ":00"
-        r_ctime = str(datetime.datetime.now().year) + "-" + month + "-" + day
-        # 现在时间,时间戳
-        utime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
-        expire_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time() + 60))
         # 比赛id
         match_id = item['game_id']
         # 联赛id
@@ -59,115 +90,110 @@ class Zuqiupipeline(object):
         # number
         tag_number = item['number']
         pt = item['pt']
-        corner_ball = item['corner_ball']
+        # corner_ball = item['corner_ball']
         match_date, match_time, time3 = new_time(us_time)
         # 联赛接口写入
-        last_time = '2019-12-31 23:59:59'
-        league_dict = {"game_code": "zq", "title": "league", "source": "hg3535"}
-        league_list = []
         uuid = Helper.genearte_MD5(league_name + 'hg3535')
-
-        league_key = ["name_chinese", "kind", "match_mode", "if_stop", "last_time", "lg_id", "source", "uuid"]
-        league_value = [league_name, "1", "1", "0", last_time, league_id, "hg3535", uuid]
-        league_data = dict(zip(league_key, league_value))
-        league_list.append(league_data)
-        league_dict['data'] = league_list
-        if self.db.hg3535_zq_league.find({'lg_id': league_id}).count() < 1:
-            response_data = Helper.async_post(url + '/setLeague', league_dict)
-            print(response_data)
-            self.db.hg3535_zq_league.insert(league_list)
-        competition = self.db.hg3535_zq_competition.find_one({"match_id": str(match_id)})
-        match_list = []
-        if competition:
-            print('赛事已存在,修改赛事四状态')
-            is_morningplate = competition['is_morningplate']
-            is_rollball = competition['is_rollball']
-            is_stringscene = competition['is_stringscene']
-            is_today = competition['is_today']
-            lmtime = competition['match_time']
-            if pt == '3':
-                if is_stringscene != 1 or lmtime != match_time:
-                    match_dict = {"game_code": "zq", "title": "match", "source": "hg3535"}
-                    match_kay = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time",
-                                 "tag","source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
-                                 "half_match_id", "is_today"]
-                    match_value = [team_home, team_guest, league_id, 0, match_id, match_date, match_time, tag_number,
-                                   "hg3535",is_rollball, is_morningplate, 1, us_time, uuid, 0, is_today]
-                    match_data = dict(zip(match_kay, match_value))
-                    match_list.append(match_data)
-                    match_dict['data'] = match_list
-                    response_data = Helper.async_post(url + '/setMatch', match_dict)
-                    print(response_data)
-                    self.db.hg3535_zq_competition.update({'match_id': str(match_id)}, {"$set": {"is_stringscene": 1, "match_time": match_time}}, upsert=True)
-            if pt == '2':
-                if is_morningplate != 1 or lmtime != match_time:
-                    match_dict = {"game_code": "zq", "title": "match", "source": "hg3535"}
-                    match_kay = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time",
-                                 "tag","source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
-                                 "half_match_id", "is_today"]
-                    match_value = [team_home, team_guest, league_id, 0, match_id, match_date, match_time, tag_number,
-                                   "hg3535",is_rollball, 1, is_stringscene, us_time, uuid, 0, is_today]
-                    match_data = dict(zip(match_kay, match_value))
-                    match_list.append(match_data)
-                    match_dict['data'] = match_list
-                    response_data = Helper.async_post(url + '/setMatch', match_dict)
-                    print(response_data)
-                    self.db.hg3535_zq_competition.update({'match_id': str(match_id)}, {"$set": {"is_morningplate": 1, "match_time": match_time}}, upsert=True)
-            if pt == '1':
-                if is_today != 1 or lmtime != match_time:
-                    match_dict = {"game_code": "zq", "title": "match", "source": "hg3535"}
-                    match_kay = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time",
-                                 "tag","source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
-                                 "half_match_id", "is_today"]
-                    match_value = [team_home, team_guest, league_id, 0, match_id, match_date, match_time, tag_number,
-                                   "hg3535",is_rollball, is_morningplate, is_stringscene, us_time, uuid, 0, 1]
-                    match_data = dict(zip(match_kay, match_value))
-                    match_list.append(match_data)
-                    match_dict['data'] = match_list
-                    response_data = Helper.async_post(url + '/setMatch', match_dict)
-                    print(response_data)
-                    self.db.hg3535_zq_competition.update({'match_id': str(match_id)}, {"$set": {"is_today": 1, "match_time": match_time}}, upsert=True)
-
-            else:
-                print("赛事已存在,赛事状态时间为改变,不做修改")
+        pt_dict = {'1': 'is_today', '2': 'is_morningplate', '3': 'is_stringscene', '4': 'is_rollball'}
+        pt_status = pt_dict[pt]
+        if pt == '3':
+            is_rollball = 0
+            is_today = 0
+            is_morningplate = 0
+            is_stringscene = 1
+        elif pt == '2':
+            is_rollball = 0
+            is_today = 0
+            is_morningplate = 1
+            is_stringscene = 0
         else:
-            if pt == '3':
-                is_rollball = 0
-                is_today = 0
-                is_morningplate = 0
-                is_stringscene = 1
-            elif pt == '2':
-                is_rollball = 0
-                is_today = 0
-                is_morningplate = 1
-                is_stringscene = 0
-            else:
-                is_today = 1
-                is_rollball = 0
-                is_morningplate = 0
-                is_stringscene = 0
-            # 赛事接口写入
+            is_today = 1
+            is_rollball = 0
+            is_morningplate = 0
+            is_stringscene = 0
+        _zq_match = await self.connection.get_database('kaiyou').zq_competition35.find_one({'match_id': match_id, pt_status: 1})
+
+        if not _zq_match:
+            match_list = []
             match_dict = {"game_code": "zq", "title": "match", "source": "hg3535"}
-            match_kay = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time", "tag",
-                         "source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
+            match_kay = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time",
+                         "tag", "source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
                          "half_match_id", "is_today"]
-            match_value = [team_home, team_guest, league_id, 0, match_id, match_date, match_time, tag_number, "hg3535",
-                           is_rollball, is_morningplate, is_stringscene, us_time, uuid, 0, is_today]
+            match_value = [team_home, team_guest, league_id, 0, match_id, match_date, match_time, tag_number,
+                           "hg3535", is_rollball, is_morningplate, is_stringscene, us_time, uuid, 0, is_today]
             match_data = dict(zip(match_kay, match_value))
             match_list.append(match_data)
             match_dict['data'] = match_list
-            response_data = Helper.async_post(url + '/setMatch', match_dict)
-            self.db.hg3535_zq_competition.insert(match_list)
-            print(response_data)
-        # 赔率
+            response_data = await self.session.post(self.url + '/setMatch',
+                                                    data={"data": json.dumps(match_data), "token": 'JlUo1415650051585d481566c10c9'})
+            if response_data.status == 200:
+                await self.connection.get_database('kaiyou').zq_competition35.insert_one(match_data)
+            else:
+                logger.warning(response_data.status)
+                logger.warning(match_dict)
+        else:
+            logger.info('足球赛事已存在')
+
+    async def _odds(self, item):
+        logger = logging.getLogger(__name__)
+        # 比赛日期
         try:
-            result = self.db.hg3535_zq_odds.find_one({'match_id': match_id, 'pt': pt})
-            uuid_list = result['odds_only']
-        except:
-            uuid_list = []
-            result = ''
-        p_code, p_id = get_pcode(corner_ball, 'goal_size')
+            data_game = item['data_game'].split("/")
+            # print(data_game)
+            month = str(data_game[1].strip())
+            day = str(data_game[0])
+        except Exception as e:
+            logger.warning(e)
+            data_game = item['data_game'].split(" ")
+            months = str(data_game[1].strip())
+            month_dict = {'Jan': '01', 'Feb': '02', 'Mar': '03', 'Apr': '04', 'May': '05', 'Jun': '06', 'Jul': '07',
+                          'Aug': '08', 'Sep': '09', 'Oct': '10', 'Nov': '11', 'Dec': '12'}
+            month = month_dict[months]
+            day = str(data_game[0])
+
+        # 比赛时间
+        time_game = str(item['time_game'])
+        # 比赛时间,时间戳
+        # datetime.datetime.now().year
+        us_time = str(datetime.datetime.now().year) + "-" + month + "-" + day + " " + time_game + ":00"
+        # r_ctime = str(datetime.datetime.now().year) + "-" + month + "-" + day
+        # 现在时间,时间戳
+        utime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
+        # expire_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time() + 60))
+        # 比赛id
+        match_id = item['game_id']
+        # 联赛id
+        league_id = item['league_id']
+        # 联赛name
+        league_name = item['league_name']
+        # # 主队
+        team_home = item['team_home']
+        # 客队
+        team_guest = item['team_guest']
+        # number
+        tag_number = item['number']
+        pt = item['pt']
+        corner_ball = item['corner_ball']
+        match_date, match_time, time3 = new_time(us_time)
+        # 联赛接口写入
+        # last_time = '2019-12-31 23:59:59'
+        uuid = Helper.genearte_MD5(league_name + 'hg3535')
+        # 赔率
+        _zq_odds = await self.connection.get_database('kaiyou').zq_zodds35.find_one({'match_id': match_id})
+        if _zq_odds:
+            _uid_list = _zq_odds['uid']
+            pass
+        else:
+            _uid_list = []
+        # try:
+        #     result = self.db.hg3535_zq_odds.find_one({'match_id': match_id, 'pt': pt})
+        #     uuid_list = result['odds_only']
+        # except:
+        #     uuid_list = []
+        #     result = ''
+        # p_code, p_id = get_pcode(corner_ball, 'goal_size')
         # 构建唯一索引
+        p_code = "GS"
         half_size_guest = item["half_size_guest"]
         half_size_guest_rule = item["half_size_guest_rule"]
         half_size_home = item["half_size_home"]
@@ -177,36 +203,38 @@ class Zuqiupipeline(object):
         odds_onlys = []
         # half_size_guest
         for index, value in enumerate(half_size_guest):
-            hash_str = p_code + "half_size_guest" + str(index) + str(half_size_guest_rule[index]) + str(
+            hash_str = p_code + "gss_h" + str(index) + str(half_size_guest_rule[index]) + str(
                 value) + "hg3535" + str(match_id)
-            sole_str = p_code + "half_size_guest" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "gss_h" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             half_size_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                    "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(half_size_guest_rule[index])
-            half_size_guest_value = [match_id, league_id, "half_size_guest", "0", index, p_code, value, condition,
+            half_size_guest_value = [match_id, league_id, "gss_h", "0", index, p_code, value, condition,
                                      odds_only, sole, "hg3535", "0", ""]
             half_size_guest_data = dict(zip(half_size_guest_key, half_size_guest_value))
-            if odds_only not in uuid_list:
+            if odds_only not in _uid_list:
                 data_list.append(half_size_guest_data)
+                _uid_list.append(odds_only)
         # half_size_home
         for index, value in enumerate(half_size_home):
-            hash_str = p_code + "half_size_home" + str(index) + str(half_size_home_rule[index]) + str(
+            hash_str = p_code + "gsb_h" + str(index) + str(half_size_home_rule[index]) + str(
                 value) + "hg3535" + str(match_id)
-            sole_str = p_code + "half_size_home" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "gsb_h" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             half_size_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                   "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(half_size_home_rule[index])
-            half_size_home_value = [match_id, league_id, "half_size_guest", "0", index, p_code, value, condition,
+            half_size_home_value = [match_id, league_id, "gsb_h", "0", index, p_code, value, condition,
                                     odds_only, sole, "hg3535", "0", ""]
             half_size_home_data = dict(zip(half_size_home_key, half_size_home_value))
             # if uid_num < 1:
-            if odds_only not in uuid_list:
+            if odds_only not in _uid_list:
+                _uid_list.append(odds_only)
                 data_list.append(half_size_home_data)
 
         # 全场场大小
@@ -216,75 +244,80 @@ class Zuqiupipeline(object):
         size_home_rule = item["size_home_rule"]
         # size_home
         for index, value in enumerate(size_home):
-            hash_str = p_code + "size_home" + str(index) + str(size_home_rule[index]) + str(value) + "hg3535" + str(
+            hash_str = p_code + "gsb" + str(index) + str(size_home_rule[index]) + str(value) + "hg3535" + str(
                 match_id)
-            sole_str = p_code + "size_home" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "gsb" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             size_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                              "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(size_home_rule[index])
-            size_home_value = [match_id, league_id, "size_home", "0", index, p_code, value, condition, odds_only,
+            size_home_value = [match_id, league_id, "gsb", "0", index, p_code, value, condition, odds_only,
                                sole, "hg3535", "0", ""]
             size_home_data = dict(zip(size_home_key, size_home_value))
-            if odds_only not in uuid_list:
+            if odds_only not in _uid_list:
                 data_list.append(size_home_data)
+                _uid_list.append(odds_only)
         # size_guest
         for index, value in enumerate(size_guest):
-            hash_str = p_code + "size_guest" + str(index) + str(size_guest_rule[index]) + str(value) + "hg3535" + str(
+            hash_str = p_code + "gss" + str(index) + str(size_guest_rule[index]) + str(value) + "hg3535" + str(
                 match_id)
-            sole_str = p_code + "size_guest" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "gss" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             size_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                               "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(size_guest_rule[index])
-            size_guest_value = [match_id, league_id, "size_guest", "0", index, p_code, value, condition, odds_only,
+            size_guest_value = [match_id, league_id, "gss", "0", index, p_code, value, condition, odds_only,
                                 sole, "hg3535", "0", ""]
             size_home_data = dict(zip(size_guest_key, size_guest_value))
-            if odds_only not in uuid_list:
+            if odds_only not in _uid_list:
                 data_list.append(size_home_data)
+                _uid_list.append(odds_only)
 
-        p_code, p_id = get_pcode(corner_ball, 'concede')
+        # p_code, p_id = get_pcode(corner_ball, 'concede')
+        p_code = 'CO'
         half_concede_home_rule = item["half_concede_home_rule"]
         half_concede_home = item["half_concede_home"]
         half_concede_guest_rule = item["half_concede_guest_rule"]
         half_concede_guest = item["half_concede_guest"]
         # half_concede_home
         for index, value in enumerate(half_concede_guest):
-            hash_str = p_code + "half_concede_guest" + str(index) + str(half_concede_guest_rule[index]) + str(
+            hash_str = p_code + "cog_h" + str(index) + str(half_concede_guest_rule[index]) + str(
                 value) + "hg3535" + str(match_id)
-            sole_str = p_code + "half_concede_guest" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "cog_h" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             half_concede_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                       "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(half_concede_guest_rule[index])
-            half_concede_guest_value = [match_id, league_id, "half_concede_guest", "0", index, p_code, value, condition,
+            half_concede_guest_value = [match_id, league_id, "cog_h", "0", index, p_code, value, condition,
                                         odds_only, sole, "hg3535", "0", ""]
             half_concede_guest_data = dict(zip(half_concede_guest_key, half_concede_guest_value))
             # if uid_num < 1:
-            if odds_only not in uuid_list:
+            if odds_only not in _uid_list:
                 data_list.append(half_concede_guest_data)
+                _uid_list.append(odds_only)
         # half_concede_home
         for index, value in enumerate(half_concede_home):
-            hash_str = p_code + "half_concede_home" + str(index) + str(half_concede_home_rule[index]) + str(
+            hash_str = p_code + "coh_h" + str(index) + str(half_concede_home_rule[index]) + str(
                 value) + "hg3535" + str(match_id)
-            sole_str = p_code + "half_concede_home" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "coh_h" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             half_concede_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                      "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(half_concede_home_rule[index])
-            half_concede_home_value = [match_id, league_id, "half_concede_home", "0", index, p_code, value, condition,
+            half_concede_home_value = [match_id, league_id, "coh_h", "0", index, p_code, value, condition,
                                        odds_only, sole, "hg3535", "0", ""]
             half_concede_home_data = dict(zip(half_concede_home_key, half_concede_home_value))
-            if odds_only not in uuid_list:
+            if odds_only not in _uid_list:
                 data_list.append(half_concede_home_data)
+                _uid_list.append(odds_only)
 
         concede_guest = item["concede_guest"]
         concede_guest_rule = item["concede_guest_rule"]
@@ -292,39 +325,42 @@ class Zuqiupipeline(object):
         concede_home_rule = item["concede_home_rule"]
         # concede_guest
         for index, value in enumerate(concede_guest):
-            hash_str = p_code + "concede_guest" + str(index) + str(concede_guest_rule[index]) + str(
+            hash_str = p_code + "cog" + str(index) + str(concede_guest_rule[index]) + str(
                 value) + "hg3535" + str(match_id)
-            sole_str = p_code + "concede_guest" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "cog" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             concede_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                  "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(concede_guest[index])
-            concede_guest_value = [match_id, league_id, "concede_guest", "0", index, p_code, value, condition,
+            concede_guest_value = [match_id, league_id, "cog", "0", index, p_code, value, condition,
                                    odds_only, sole, "hg3535", "0", ""]
             concede_guest_data = dict(zip(concede_guest_key, concede_guest_value))
-            if odds_only not in uuid_list:
+            if odds_only not in _uid_list:
                 data_list.append(concede_guest_data)
+                _uid_list.append(odds_only)
         # concede_home
         for index, value in enumerate(concede_home):
-            hash_str = p_code + "concede_home" + str(index) + str(concede_home_rule[index]) + str(
+            hash_str = p_code + "coh" + str(index) + str(concede_home_rule[index]) + str(
                 value) + "hg3535" + str(match_id)
-            sole_str = p_code + "concede_home" + str(index) + str(match_id) + "hg3535"
+            sole_str = p_code + "coh" + str(index) + str(match_id) + "hg3535"
             odds_only = Helper.genearte_MD5(hash_str)
             sole = Helper.genearte_MD5(sole_str)
             odds_onlys.append(odds_only)
             concede_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                 "odds_only", "sole", "source", "type", "team"]
             condition = fuhao(concede_home_rule[index])
-            concede_home_value = [match_id, league_id, "concede_home", "0", index, p_code, value, condition, odds_only,
+            concede_home_value = [match_id, league_id, "coh", "0", index, p_code, value, condition, odds_only,
                                   sole, "hg3535", "0", ""]
             concede_guest_data = dict(zip(concede_home_key, concede_home_value))
-            if odds_only not in uuid_list:
+            if odds_only not in _uid_list:
                 data_list.append(concede_guest_data)
+                _uid_list.append(odds_only)
 
         # 独赢----------------------------------------------------------------------------------------------------------
-        p_code, p_id = get_pcode(corner_ball, 'capot')
+        # p_code, p_id = get_pcode(corner_ball, 'capot')
+        p_code = 'C'
         half_capot_home = item["half_capot_home"]
         half_capot_guest = item["half_capot_guest"]
         half_capot_dogfall = item["half_capot_dogfall"]
@@ -333,158 +369,169 @@ class Zuqiupipeline(object):
         capot_dogfall = item["capot_dogfall"]
 
         # half_capot_home
-        hash_str = p_code + "half_capot_home" + '0' + '1' + str(half_capot_home) + "hg3535" + str(match_id)
-        sole_str = p_code + "half_capot_home" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "ch_h" + '0' + '1' + str(half_capot_home) + "hg3535" + str(match_id)
+        sole_str = p_code + "ch_h" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         half_capot_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                "odds_only", "sole", "source", "type", "team"]
-        half_capot_home_value = [match_id, league_id, "half_capot_home", "0", 0, p_code, half_capot_home, '1',
+        half_capot_home_value = [match_id, league_id, "ch_h", "0", 0, p_code, half_capot_home, '1',
                                  odds_only, sole, "hg3535", "0", ""]
         half_capot_homet_data = dict(zip(half_capot_home_key, half_capot_home_value))
-        if odds_only not in uuid_list:
+        if odds_only not in _uid_list:
             data_list.append(half_capot_homet_data)
+            _uid_list.append(odds_only)
 
         # half_capot_guest
-        hash_str = p_code + "half_capot_guest" + '0' + '2' + str(half_capot_guest) + "hg3535" + str(match_id)
-        sole_str = p_code + "half_capot_guest" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "cg_h" + '0' + '2' + str(half_capot_guest) + "hg3535" + str(match_id)
+        sole_str = p_code + "cg_h" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         half_capot_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                 "odds_only", "sole", "source", "type", "team"]
-        half_capot_guest_value = [match_id, league_id, "half_capot_guest", "0", 0, p_code, half_capot_guest, '2',
+        half_capot_guest_value = [match_id, league_id, "cg_h", "0", 0, p_code, half_capot_guest, '2',
                                   odds_only, sole, "hg3535", "0", ""]
         half_capot_guest_data = dict(zip(half_capot_guest_key, half_capot_guest_value))
-        if odds_only not in uuid_list:
+        if odds_only not in _uid_list:
             data_list.append(half_capot_guest_data)
+            _uid_list.append(odds_only)
 
         # half_capot_dogfall
-        hash_str = p_code + "half_capot_dogfall" + '0' + 'X' + str(half_capot_dogfall) + "hg3535" + str(match_id)
-        sole_str = p_code + "half_capot_dogfall" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "cd_h" + '0' + 'X' + str(half_capot_dogfall) + "hg3535" + str(match_id)
+        sole_str = p_code + "cd_h" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         half_capot_dogfall_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                                   "odds_only", "sole", "source", "type", "team"]
-        half_capot_dogfall_value = [match_id, league_id, "half_capot_guest", "0", 0, p_code, half_capot_dogfall, 'X',
+        half_capot_dogfall_value = [match_id, league_id, "cd_h", "0", 0, p_code, half_capot_dogfall, 'X',
                                     odds_only, sole, "hg3535", "0", ""]
         half_capot_dogfall_data = dict(zip(half_capot_dogfall_key, half_capot_dogfall_value))
-        if odds_only not in uuid_list:
+        if odds_only not in _uid_list:
             data_list.append(half_capot_dogfall_data)
+            _uid_list.append(odds_only)
 
         # capot_dogfall
-        hash_str = p_code + "capot_dogfall" + '0' + 'X' + str(capot_dogfall) + "hg3535" + str(match_id)
-        sole_str = p_code + "capot_dogfall" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "cd" + '0' + 'X' + str(capot_dogfall) + "hg3535" + str(match_id)
+        sole_str = p_code + "cd" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         capot_dogfall_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                              "odds_only", "sole", "source", "type", "team"]
-        capot_dogfall_value = [match_id, league_id, "half_capot_guest", "0", 0, p_code, capot_dogfall, 'X', odds_only,
+        capot_dogfall_value = [match_id, league_id, "cd", "0", 0, p_code, capot_dogfall, 'X', odds_only,
                                sole, "hg3535", "0", ""]
         capot_dogfall_data = dict(zip(capot_dogfall_key, capot_dogfall_value))
-        if odds_only not in uuid_list:
+        if odds_only not in _uid_list:
             data_list.append(capot_dogfall_data)
+            _uid_list.append(odds_only)
 
         # capot_home
-        hash_str = p_code + "capot_home" + '0' + '1' + str(capot_home) + "hg3535" + str(match_id)
-        sole_str = p_code + "capot_home" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "ch" + '0' + '1' + str(capot_home) + "hg3535" + str(match_id)
+        sole_str = p_code + "ch" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         capot_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                           "odds_only", "sole", "source", "type", "team"]
-        capot_home_value = [match_id, league_id, "half_capot_home", "0", 0, p_code, capot_home, '1',
+        capot_home_value = [match_id, league_id, "ch", "0", 0, p_code, capot_home, '1',
                             odds_only, sole, "hg3535", "0", ""]
         capot_homet_data = dict(zip(capot_home_key, capot_home_value))
-        if odds_only not in uuid_list:
+        if odds_only not in _uid_list:
             data_list.append(capot_homet_data)
+            _uid_list.append(odds_only)
 
         # capot_guest
-        hash_str = p_code + "capot_guest" + '0' + '2' + str(capot_guest) + "hg3535" + str(match_id)
-        sole_str = p_code + "capot_guest" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "cg" + '0' + '2' + str(capot_guest) + "hg3535" + str(match_id)
+        sole_str = p_code + "cg" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         capot_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                            "odds_only", "sole", "source", "type", "team"]
-        capot_guest_value = [match_id, league_id, "half_capot_guest", "0", 0, p_code, capot_home, '2',
+        capot_guest_value = [match_id, league_id, "cg", "0", 0, p_code, capot_home, '2',
                              odds_only, sole, "hg3535", "0", ""]
         capot_guest_data = dict(zip(capot_guest_key, capot_guest_value))
-        if odds_only not in uuid_list:
+        if odds_only not in _uid_list:
             data_list.append(capot_guest_data)
+            _uid_list.append(odds_only)
 
         # 入球数单双-----------------------------------------------------------------------------------------------------
-        p_code, p_id = get_pcode(corner_ball, 'two_sides')
+        # p_code, p_id = get_pcode(corner_ball, 'two_sides')
+        p_code = 'TS'
         odd_even_odd = item["odd_even_odd"]
         odd_even_even = item["odd_even_even"]
         half_odd_even_odd = item["half_odd_even_odd"]
         half_odd_even_even = item["half_odd_even_even"]
 
         # odd_even_odd
-        hash_str = p_code + "two_sides_single" + '0' + '单' + str(odd_even_odd) + "hg3535" + str(match_id)
-        sole_str = p_code + "two_sides_single" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "tss" + '0' + '单' + str(odd_even_odd) + "hg3535" + str(match_id)
+        sole_str = p_code + "tss" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         single_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                       "odds_only", "sole", "source", "type", "team"]
-        single_value = [match_id, league_id, "two_sides_single", "0", 0, p_code, odd_even_odd, '单',
+        single_value = [match_id, league_id, "tss", "0", 0, p_code, odd_even_odd, '单',
                         odds_only, sole, "hg3535", "0", ""]
         single_data = dict(zip(single_key, single_value))
-        if odds_only not in uuid_list:
+        if odds_only not in _uid_list:
             data_list.append(single_data)
+            _uid_list.append(odds_only)
 
         # odd_even_even
-        hash_str = p_code + "two_sides_double" + '0' + '双' + str(odd_even_even) + "hg3535" + str(match_id)
-        sole_str = p_code + "two_sides_double" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "tsd" + '0' + '双' + str(odd_even_even) + "hg3535" + str(match_id)
+        sole_str = p_code + "tsd" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         double_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                       "odds_only", "sole", "source", "type", "team"]
-        double_value = [match_id, league_id, "two_sides_double", "0", 0, p_code, odd_even_even, '双',
+        double_value = [match_id, league_id, "tsd", "0", 0, p_code, odd_even_even, '双',
                         odds_only, sole, "hg3535", "0", ""]
         double_data = dict(zip(double_key, double_value))
-        if odds_only not in uuid_list:
+        if odds_only not in _uid_list:
             data_list.append(double_data)
+            _uid_list.append(odds_only)
 
         # half_odd_even_even
-        hash_str = p_code + "two_sides_double" + '0' + '双' + str(half_odd_even_even) + "hg3535" + str(match_id)
-        sole_str = p_code + "two_sides_double" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "tsd_h" + '0' + '双' + str(half_odd_even_even) + "hg3535" + str(match_id)
+        sole_str = p_code + "tsd_h" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         half_double_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                            "odds_only", "sole", "source", "type", "team"]
-        half_double_value = [match_id, league_id, "two_sides_double", "0", 0, p_code, half_odd_even_even, '双',
+        half_double_value = [match_id, league_id, "tsd_h", "0", 0, p_code, half_odd_even_even, '双',
                              odds_only, sole, "hg3535", "0", ""]
         half_double_data = dict(zip(half_double_key, half_double_value))
-        if odds_only not in uuid_list:
+        if odds_only not in _uid_list:
             data_list.append(half_double_data)
+            _uid_list.append(odds_only)
 
         # half_odd_even_odd
-        hash_str = p_code + "two_sides_single" + '0' + '单' + str(half_odd_even_odd) + "hg3535" + str(match_id)
-        sole_str = p_code + "two_sides_single" + '0' + str(match_id) + "hg3535"
+        hash_str = p_code + "tss_h" + '0' + '单' + str(half_odd_even_odd) + "hg3535" + str(match_id)
+        sole_str = p_code + "tss_h" + '0' + str(match_id) + "hg3535"
         odds_only = Helper.genearte_MD5(hash_str)
         sole = Helper.genearte_MD5(sole_str)
         odds_onlys.append(odds_only)
         half_single_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
                            "odds_only", "sole", "source", "type", "team"]
-        half_single_value = [match_id, league_id, "two_sides_single", "0", 0, p_code, half_odd_even_odd, '单', odds_only,
+        half_single_value = [match_id, league_id, "tss_h", "0", 0, p_code, half_odd_even_odd, '单', odds_only,
                              sole, "hg3535", "0", ""]
         half_single_data = dict(zip(half_single_key, half_single_value))
-        if odds_only not in uuid_list:
+        if odds_only not in _uid_list:
             data_list.append(half_single_data)
+            _uid_list.append(odds_only)
 
         # 总入球数 ------------------------------------------------------------------------------------------------------
-        p_code, p_id = get_pcode(corner_ball, 'total_goal')
+        # p_code, p_id = get_pcode(corner_ball, 'total_goal')
+        p_code = 'TG'
         total_goals = item['total_goal']
-        total_dict = {'total_goal_zero': '0-1', 'total_goal_two': '2-3', 'total_goal_four': '4-6',
-                      'total_goal_seven': '7或以上', 'half_total_goal_zero': '0', "half_total_goal_one": '1',
-                      "half_total_goal_two": '2', "half_total_goal_three": '3或以上'}
+        total_dict = {'tg0': '0-1', 'tg1': '2-3', 'tg2': '4-6', 'tg3': '7或以上', 'tg0_h': '0', "tg1_h": '1',
+                      "tg2_h": '2', "tg3_h": '3或以上'}
         # 全场入球数 单双
         # 上半场入球数 单双
         for key, value in total_goals.items():
@@ -498,17 +545,16 @@ class Zuqiupipeline(object):
             total_goals_value = [match_id, league_id, key, "0", 0, p_code, value, total_dict[key], odds_only,
                                  sole, "hg3535", "0", ""]
             total_goals_data = dict(zip(total_goals_key, total_goals_value))
-            if odds_only not in uuid_list:
+            if odds_only not in _uid_list:
                 data_list.append(total_goals_data)
+                _uid_list.append(odds_only)
 
         # 全场半场 ------------------------------------------------------------------------------------------------------
         half_fulls = item['half_full']
-        p_code, p_id = get_pcode(corner_ball, 'half_full')
-        full_dict = {"half_full_home_home": "主主", "half_full_home_dogfall": "主和",
-                     "half_full_home_guest": "主客", "half_full_dogfall_home": "和主",
-                     "half_full_dogfall_dogfall": "和和", "half_full_dogfall_guest": "和客",
-                     "half_full_guest_home": "客主", "half_full_guest_dogfall": "客和",
-                     "half_full_guest_guest": "客客"}
+        # p_code, p_id = get_pcode(corner_ball, 'half_full')
+        p_code = 'HF'
+        full_dict = {"hfhh": "主主", "hfhd": "主和", "hfhg": "主客", "hfdh": "和主",
+                     "hfdd": "和和", "hfdg": "和客", "hfgh": "客主", "hfgd": "客和", "hfgg": "客客"}
         if half_fulls:
             for key, value in half_fulls.items():
                 hash_str = p_code + key + '0' + full_dict[key] + str(value) + "hg3535" + str(match_id)
@@ -517,38 +563,26 @@ class Zuqiupipeline(object):
                 sole = Helper.genearte_MD5(sole_str)
                 odds_onlys.append(odds_only)
                 half_fulls_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
-                                   "odds_only", "sole", "source", "type", "team"]
+                                  "odds_only", "sole", "source", "type", "team"]
                 half_fulls_value = [match_id, league_id, key, "0", 0, p_code, value, full_dict[key], odds_only,
-                                     sole, "hg3535", "0", ""]
+                                    sole, "hg3535", "0", ""]
                 half_fulls_data = dict(zip(half_fulls_key, half_fulls_value))
-                if odds_only not in uuid_list:
+                if odds_only not in _uid_list:
                     data_list.append(half_fulls_data)
+                    _uid_list.append(odds_only)
 
         # 波胆------------------------------------------------------------------------------------------------------------------
         bodan_datas = item['bodan_data']
-        p_code, p_id = get_pcode(corner_ball, 'bodan')
-        bodan_dict = {"bodanhome_one_zero": "1-0", "bodanhome_two_zero": "2-0",
-                      "bodanhome_two_one": "2-1", "bodanhome_three_zero": "3-0",
-                      "bodanhome_three_one": "3-1", "bodanhome_three_two": "3-2",
-                      "bodanhome_four_zero": "4-0", "bodanhome_four_one": "4-1",
-                      "bodanhome_four_two": "4-2", "bodanhome_four_three": "4-3",
-                      "bodanguest_one_zero": "0-1", "bodanguest_two_zero": "0-2",
-                      "bodanguest_two_one": "1-2", "bodanguest_three_zero": "0-3",
-                      "bodanguest_three_one": "1-3", "bodanguest_three_two": "2-3",
-                      "bodanguest_four_zero": "0-4", "bodanguest_four_one": "1-4",
-                      "bodanguest_four_two": "2-4", "bodanguest_four_three": "3-4",
-                      "bodandogfall_zero_zero": "0-0", "bodandogfall_one_one": "1-1",
-                      "bodandogfall_two_two": "2-2", "bodandogfall_three_three": "3-3",
-                      "bodandogfall_four_four": "4-4", "bodanother": "其他",
-                      "halfbodanhome_one_zero": "1-0", "halfbodanhome_two_zero": "2-0",
-                      "halfbodanhome_two_one": "2-1", "halfbodanhome_three_zero": "3-0",
-                      "halfbodanhome_three_one": "3-1", "halfbodanhome_three_two": "3-2",
-                      "halfbodanguest_one_zero": "0-1", "halfbodanguest_two_zero": "0-2",
-                      "halfbodanguest_two_one": "1-2", "halfbodanguest_three_zero": "0-3",
-                      "halfbodanguest_three_one": "1-3", "halfbodanguest_three_two": "2-3",
-                      "halfbodandogfall_zero_zero": "0-0", "halfbodandogfall_one_one": "1-1",
-                      "halfbodandogfall_two_two": "2-2", "halfbodandogfall_three_three": "3-3",
-                      "halfbodanother": "其他"}
+        # p_code, p_id = get_pcode(corner_ball, 'bodan')
+        p_code = 'B'
+        bodan_dict = {"b10": "1-0", "b20": "2-0", "b21": "2-1", "b30": "3-0", "b31": "3-1", "b32": "3-2",
+                      "b40": "4-0", "b41": "4-1", "b42": "4-2", "b43": "4-3", "b01": "0-1", "b02": "0-2",
+                      "b12": "1-2", "b03": "0-3", "b13": "1-3", "b23": "2-3", "b04": "0-4", "b14": "1-4",
+                      "b24": "2-4", "b34": "3-4", "b00": "0-0", "b11": "1-1", "b22": "2-2", "b33": "3-3",
+                      "b44": "4-4", "bo": "其他", "b10_h": "1-0", "b20_h": "2-0", "b21_h": "2-1", "b30_h": "3-0",
+                      "b31_h": "3-1", "b32_h": "3-2", "b01_h": "0-1", "b02_h": "0-2", "b12_h": "1-2", "b03_h": "0-3",
+                      "b13_h": "1-3", "b23_h": "2-3", "b00_h": "0-0", "b11_h": "1-1", "b22_h": "2-2", "b33_h": "3-3",
+                      "bo_h": "其他"}
         if bodan_datas:
             for key, value in bodan_datas.items():
                 hash_str = p_code + key + '0' + bodan_dict[key] + str(value) + "hg3535" + str(match_id)
@@ -561,14 +595,15 @@ class Zuqiupipeline(object):
                 bodan_dict_value = [match_id, league_id, key, "0", 0, p_code, value, bodan_dict[key], odds_only,
                                     sole, "hg3535", "0", ""]
                 bodan_dict_data = dict(zip(bodan_dict_key, bodan_dict_value))
-                if odds_only not in uuid_list:
+                if odds_only not in _uid_list:
                     data_list.append(bodan_dict_data)
+                    _uid_list.append(odds_only)
 
         # 最先进球/最后进球 ----------------------------------------------------------------------------------------------
         first_last_balls = item['first_last_ball']
-        p_code, p_id = get_pcode(corner_ball, 'first_last_ball')
-        first_last_dict = {"first_last_ball": "最先进球", "first_ball_home": "最先进球", "first_ball_guest": "最先进球",
-                           "last_ball_home": "最后进球", "last_ball_guest": "最后进球", "not_ball": "没有进球"}
+        # p_code, p_id = get_pcode(corner_ball, 'first_last_ball')
+        p_code = 'FLB'
+        first_last_dict = {"flbfh": "最先进球", "flbfg": "最先进球", "flblh": "最后进球", "flblg": "最后进球", "flbn": "没有进球"}
         if first_last_balls:
             for key, value in first_last_balls.items():
                 hash_str = p_code + key + '0' + first_last_dict[key] + str(value) + "hg3535" + str(match_id)
@@ -576,16 +611,23 @@ class Zuqiupipeline(object):
                 odds_only = Helper.genearte_MD5(hash_str)
                 sole = Helper.genearte_MD5(sole_str)
                 odds_onlys.append(odds_only)
-                first_last_balls_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
-                                  "odds_only", "sole", "source", "type", "team"]
-                first_last_balls_value = [match_id, league_id, key, "0", 0, p_code, value, first_last_dict[key], odds_only,
-                                    sole, "hg3535", "0", ""]
+                first_last_balls_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+                                        "condition",
+                                        "odds_only", "sole", "source", "type", "team"]
+                first_last_balls_value = [match_id, league_id, key, "0", 0, p_code, value, first_last_dict[key],
+                                          odds_only,
+                                          sole, "hg3535", "0", ""]
                 first_last_balls_data = dict(zip(first_last_balls_key, first_last_balls_value))
-                if odds_only not in uuid_list:
+                if odds_only not in _uid_list:
                     data_list.append(first_last_balls_data)
+                    _uid_list.append(odds_only)
 
-        p_code, p_id = get_pcode(corner_ball, 'tema_ball')
+        # p_code, p_id = get_pcode(corner_ball, 'tema_ball')
+        # 球队得分大小
+        p_code = 'TB'
+        # 全场
         full_dicts = item['full_data']
+        # 上半场
         half_dicts = item['half_data']
         full_dict_rules = item['full_data_rule']
         half_dict_rules = item['half_data_rule']
@@ -597,12 +639,13 @@ class Zuqiupipeline(object):
                 sole = Helper.genearte_MD5(sole_str)
                 odds_onlys.append(odds_only)
                 full_dict_rules_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
-                                        "condition", "odds_only", "sole", "source", "type", "team"]
+                                       "condition", "odds_only", "sole", "source", "type", "team"]
                 full_dict_rules_value = [match_id, league_id, key, "0", 0, p_code, value, full_dict_rules[key],
-                                          odds_only,sole, "hg3535", "0", ""]
+                                         odds_only, sole, "hg3535", "0", ""]
                 full_dict_rules_data = dict(zip(full_dict_rules_key, full_dict_rules_value))
-                if odds_only not in uuid_list:
+                if odds_only not in _uid_list:
                     data_list.append(full_dict_rules_data)
+                    _uid_list.append(odds_only)
         #
         if half_dicts:
             for key, value in half_dicts.items():
@@ -612,25 +655,647 @@ class Zuqiupipeline(object):
                 sole = Helper.genearte_MD5(sole_str)
                 odds_onlys.append(odds_only)
                 half_dicts_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
-                                "condition","odds_only", "sole", "source", "type", "team"]
+                                  "condition", "odds_only", "sole", "source", "type", "team"]
                 half_dicts_value = [match_id, league_id, key, "0", 0, p_code, value, half_dict_rules[key],
-                                         odds_only, sole, "hg3535", "0", ""]
+                                    odds_only, sole, "hg3535", "0", ""]
                 half_dicts_data = dict(zip(half_dicts_key, half_dicts_value))
-                if odds_only not in uuid_list:
+                if odds_only not in _uid_list:
                     data_list.append(half_dicts_data)
+                    _uid_list.append(odds_only)
         if pt == '3':
             ris_stringscene = 1
         else:
             ris_stringscene = 0
-        odds_key = ["game_code", "title", "match_id", "lg_id", "data", "source", "odds_only", "tag", "uuid", "is_stringscene", "utime", "pt"]
-        odds_value = ["zq", "odds", match_id, league_id, data_list, "hg3535", odds_onlys, tag_number, uuid, ris_stringscene, utime, pt]
+        odds_key = ["game_code", "title", "match_id", "lg_id", "data", "source", "odds_only", "tag", "uuid",
+                    "is_stringscene", "utime", "pt"]
+        odds_value = ["zq", "odds", match_id, league_id, data_list, "hg3535", odds_onlys, tag_number, uuid,
+                      ris_stringscene, utime, pt]
         odds_dict = dict(zip(odds_key, odds_value))
         if data_list:
             # print(odds_dict)
-            response_data = Helper.async_post(url + '/setOdds', odds_dict)
-            print(response_data)
-            if "成功" in response_data:
-                if result:
-                    self.db.hg3535_zq_odds.update({'match_id': match_id, 'pt': pt}, {'$set': {"data": data_list, "odds_only": odds_onlys, "utime": utime}}, upsert=True)
+            # response_data = Helper.async_post(self.url + '/setOdds', odds_dict)
+            response_data = await self.session.post(self.url + '/setOdds',
+                                                    data={"data": json.dumps(odds_dict), "token": 'JlUo1415650051585d481566c10c9'})
+            if response_data.status == 200:
+                    # self.db.hg3535_zq_odds.update({'match_id': match_id, 'pt': pt}, {
+                    #     '$set': {"data": data_list, "odds_only": odds_onlys, "utime": utime}}, upsert=True)
+                if _zq_odds:
+                    pass
+                    await self.connection.get_database('kaiyou').zq_odds35.update_one({'match_id': match_id}, {'$set': {'uid': odds_onlys}})
                 else:
-                    self.db.hg3535_zq_odds.insert(odds_dict)
+                    await self.connection.get_database('kaiyou').zq_odds35.insert_one(
+                        {'match_id': match_id, 'uid': odds_onlys})
+            else:
+                logger.info('赔率提交失败')
+
+    # async def match_all(self, item, spider):
+    #     zq_odds = []
+    #     # url = 'http://192.168.2.200:9093'
+    #     url = 'http://admin.5gogo.com'
+    #     # zq_competitions = []
+    #     logger = logging.getLogger(__name__)
+    #     # 比赛日期
+    #     try:
+    #         data_game = item['data_game'].split("/")
+    #         # print(data_game)
+    #         month = str(data_game[1].strip())
+    #         day = str(data_game[0])
+    #     except Exception as e:
+    #         logger.warning(e)
+    #         data_game = item['data_game'].split(" ")
+    #         months = str(data_game[1].strip())
+    #         month_dict = {'Jan': '01', 'Feb': '02', 'Mar': '03', 'Apr': '04', 'May': '05', 'Jun': '06', 'Jul': '07',
+    #                       'Aug': '08', 'Sep': '09', 'Oct': '10', 'Nov': '11', 'Dec': '12'}
+    #         month = month_dict[months]
+    #         day = str(data_game[0])
+    #
+    #     # 比赛时间
+    #     time_game = str(item['time_game'])
+    #     # 比赛时间,时间戳
+    #     # datetime.datetime.now().year
+    #     us_time = str(datetime.datetime.now().year) + "-" + month + "-" + day + " " + time_game + ":00"
+    #     r_ctime = str(datetime.datetime.now().year) + "-" + month + "-" + day
+    #     # 现在时间,时间戳
+    #     utime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
+    #     expire_time = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time() + 60))
+    #     # 比赛id
+    #     match_id = item['game_id']
+    #     # 联赛id
+    #     league_id = item['league_id']
+    #     # 联赛name
+    #     league_name = item['league_name']
+    #     # # 主队
+    #     team_home = item['team_home']
+    #     # 客队
+    #     team_guest = item['team_guest']
+    #     # number
+    #     tag_number = item['number']
+    #     pt = item['pt']
+    #     corner_ball = item['corner_ball']
+    #     match_date, match_time, time3 = new_time(us_time)
+    #     # 联赛接口写入
+    #     last_time = '2019-12-31 23:59:59'
+    #     league_dict = {"game_code": "zq", "title": "league", "source": "hg3535"}
+    #     league_list = []
+    #     uuid = Helper.genearte_MD5(league_name + 'hg3535')
+    #
+    #     league_key = ["name_chinese", "kind", "match_mode", "if_stop", "last_time", "lg_id", "source", "uuid"]
+    #     league_value = [league_name, "1", "1", "0", last_time, league_id, "hg3535", uuid]
+    #     league_data = dict(zip(league_key, league_value))
+    #     league_list.append(league_data)
+    #     league_dict['data'] = league_list
+    #     if self.db.hg3535_zq_league.find({'lg_id': league_id}).count() < 1:
+    #         response_data = Helper.async_post(url + '/setLeague', league_dict)
+    #         print(response_data)
+    #         self.db.hg3535_zq_league.insert(league_list)
+    #     competition = self.db.hg3535_zq_competition.find_one({"match_id": str(match_id)})
+    #     match_list = []
+    #     if competition:
+    #         print('赛事已存在,修改赛事四状态')
+    #         is_morningplate = competition['is_morningplate']
+    #         is_rollball = competition['is_rollball']
+    #         is_stringscene = competition['is_stringscene']
+    #         is_today = competition['is_today']
+    #         lmtime = competition['match_time']
+    #         if pt == '3':
+    #             if is_stringscene != 1 or lmtime != match_time:
+    #                 match_dict = {"game_code": "zq", "title": "match", "source": "hg3535"}
+    #                 match_kay = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time",
+    #                              "tag","source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
+    #                              "half_match_id", "is_today"]
+    #                 match_value = [team_home, team_guest, league_id, 0, match_id, match_date, match_time, tag_number,
+    #                                "hg3535",is_rollball, is_morningplate, 1, us_time, uuid, 0, is_today]
+    #                 match_data = dict(zip(match_kay, match_value))
+    #                 match_list.append(match_data)
+    #                 match_dict['data'] = match_list
+    #                 response_data = Helper.async_post(url + '/setMatch', match_dict)
+    #                 print(response_data)
+    #                 self.db.hg3535_zq_competition.update({'match_id': str(match_id)}, {"$set": {"is_stringscene": 1, "match_time": match_time}}, upsert=True)
+    #         if pt == '2':
+    #             if is_morningplate != 1 or lmtime != match_time:
+    #                 match_dict = {"game_code": "zq", "title": "match", "source": "hg3535"}
+    #                 match_kay = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time",
+    #                              "tag","source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
+    #                              "half_match_id", "is_today"]
+    #                 match_value = [team_home, team_guest, league_id, 0, match_id, match_date, match_time, tag_number,
+    #                                "hg3535",is_rollball, 1, is_stringscene, us_time, uuid, 0, is_today]
+    #                 match_data = dict(zip(match_kay, match_value))
+    #                 match_list.append(match_data)
+    #                 match_dict['data'] = match_list
+    #                 response_data = Helper.async_post(url + '/setMatch', match_dict)
+    #                 print(response_data)
+    #                 self.db.hg3535_zq_competition.update({'match_id': str(match_id)}, {"$set": {"is_morningplate": 1, "match_time": match_time}}, upsert=True)
+    #         if pt == '1':
+    #             if is_today != 1 or lmtime != match_time:
+    #                 match_dict = {"game_code": "zq", "title": "match", "source": "hg3535"}
+    #                 match_kay = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time",
+    #                              "tag","source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
+    #                              "half_match_id", "is_today"]
+    #                 match_value = [team_home, team_guest, league_id, 0, match_id, match_date, match_time, tag_number,
+    #                                "hg3535",is_rollball, is_morningplate, is_stringscene, us_time, uuid, 0, 1]
+    #                 match_data = dict(zip(match_kay, match_value))
+    #                 match_list.append(match_data)
+    #                 match_dict['data'] = match_list
+    #                 response_data = Helper.async_post(url + '/setMatch', match_dict)
+    #                 print(response_data)
+    #                 self.db.hg3535_zq_competition.update({'match_id': str(match_id)}, {"$set": {"is_today": 1, "match_time": match_time}}, upsert=True)
+    #
+    #         else:
+    #             print("赛事已存在,赛事状态时间为改变,不做修改")
+    #     else:
+    #         if pt == '3':
+    #             is_rollball = 0
+    #             is_today = 0
+    #             is_morningplate = 0
+    #             is_stringscene = 1
+    #         elif pt == '2':
+    #             is_rollball = 0
+    #             is_today = 0
+    #             is_morningplate = 1
+    #             is_stringscene = 0
+    #         else:
+    #             is_today = 1
+    #             is_rollball = 0
+    #             is_morningplate = 0
+    #             is_stringscene = 0
+    #         # 赛事接口写入
+    #         match_dict = {"game_code": "zq", "title": "match", "source": "hg3535"}
+    #         match_kay = ["home_team", "guest_team", "lg_id", "status", "match_id", "match_date", "match_time", "tag",
+    #                      "source", "is_rollball", "is_morningplate", "is_stringscene", "us_time", "uuid",
+    #                      "half_match_id", "is_today"]
+    #         match_value = [team_home, team_guest, league_id, 0, match_id, match_date, match_time, tag_number, "hg3535",
+    #                        is_rollball, is_morningplate, is_stringscene, us_time, uuid, 0, is_today]
+    #         match_data = dict(zip(match_kay, match_value))
+    #         match_list.append(match_data)
+    #         match_dict['data'] = match_list
+    #         response_data = Helper.async_post(url + '/setMatch', match_dict)
+    #         self.db.hg3535_zq_competition.insert(match_list)
+    #         print(response_data)
+    #     # 赔率
+    #     try:
+    #         result = self.db.hg3535_zq_odds.find_one({'match_id': match_id, 'pt': pt})
+    #         uuid_list = result['odds_only']
+    #     except:
+    #         uuid_list = []
+    #         result = ''
+    #     # p_code, p_id = get_pcode(corner_ball, 'goal_size')
+    #     # 构建唯一索引
+    #     p_code = "GS"
+    #     half_size_guest = item["half_size_guest"]
+    #     half_size_guest_rule = item["half_size_guest_rule"]
+    #     half_size_home = item["half_size_home"]
+    #     half_size_home_rule = item["half_size_home_rule"]
+    #     zuqiu = item['zuqiu']
+    #     data_list = []
+    #     odds_onlys = []
+    #     # half_size_guest
+    #     for index, value in enumerate(half_size_guest):
+    #         hash_str = p_code + "gss_h" + str(index) + str(half_size_guest_rule[index]) + str(
+    #             value) + "hg3535" + str(match_id)
+    #         sole_str = p_code + "gss_h" + str(index) + str(match_id) + "hg3535"
+    #         odds_only = Helper.genearte_MD5(hash_str)
+    #         sole = Helper.genearte_MD5(sole_str)
+    #         odds_onlys.append(odds_only)
+    #         half_size_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                                "odds_only", "sole", "source", "type", "team"]
+    #         condition = fuhao(half_size_guest_rule[index])
+    #         half_size_guest_value = [match_id, league_id, "gss_h", "0", index, p_code, value, condition,
+    #                                  odds_only, sole, "hg3535", "0", ""]
+    #         half_size_guest_data = dict(zip(half_size_guest_key, half_size_guest_value))
+    #         if odds_only not in uuid_list:
+    #             data_list.append(half_size_guest_data)
+    #     # half_size_home
+    #     for index, value in enumerate(half_size_home):
+    #         hash_str = p_code + "gsb_h" + str(index) + str(half_size_home_rule[index]) + str(
+    #             value) + "hg3535" + str(match_id)
+    #         sole_str = p_code + "gsb_h" + str(index) + str(match_id) + "hg3535"
+    #         odds_only = Helper.genearte_MD5(hash_str)
+    #         sole = Helper.genearte_MD5(sole_str)
+    #         odds_onlys.append(odds_only)
+    #         half_size_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                               "odds_only", "sole", "source", "type", "team"]
+    #         condition = fuhao(half_size_home_rule[index])
+    #         half_size_home_value = [match_id, league_id, "gsb_h", "0", index, p_code, value, condition,
+    #                                 odds_only, sole, "hg3535", "0", ""]
+    #         half_size_home_data = dict(zip(half_size_home_key, half_size_home_value))
+    #         # if uid_num < 1:
+    #         if odds_only not in uuid_list:
+    #             data_list.append(half_size_home_data)
+    #
+    #     # 全场场大小
+    #     size_guest = item["size_guest"]
+    #     size_guest_rule = item["size_guest_rule"]
+    #     size_home = item["size_home"]
+    #     size_home_rule = item["size_home_rule"]
+    #     # size_home
+    #     for index, value in enumerate(size_home):
+    #         hash_str = p_code + "gsb" + str(index) + str(size_home_rule[index]) + str(value) + "hg3535" + str(
+    #             match_id)
+    #         sole_str = p_code + "gsb" + str(index) + str(match_id) + "hg3535"
+    #         odds_only = Helper.genearte_MD5(hash_str)
+    #         sole = Helper.genearte_MD5(sole_str)
+    #         odds_onlys.append(odds_only)
+    #         size_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                          "odds_only", "sole", "source", "type", "team"]
+    #         condition = fuhao(size_home_rule[index])
+    #         size_home_value = [match_id, league_id, "gsb", "0", index, p_code, value, condition, odds_only,
+    #                            sole, "hg3535", "0", ""]
+    #         size_home_data = dict(zip(size_home_key, size_home_value))
+    #         if odds_only not in uuid_list:
+    #             data_list.append(size_home_data)
+    #     # size_guest
+    #     for index, value in enumerate(size_guest):
+    #         hash_str = p_code + "gss" + str(index) + str(size_guest_rule[index]) + str(value) + "hg3535" + str(
+    #             match_id)
+    #         sole_str = p_code + "gss" + str(index) + str(match_id) + "hg3535"
+    #         odds_only = Helper.genearte_MD5(hash_str)
+    #         sole = Helper.genearte_MD5(sole_str)
+    #         odds_onlys.append(odds_only)
+    #         size_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                           "odds_only", "sole", "source", "type", "team"]
+    #         condition = fuhao(size_guest_rule[index])
+    #         size_guest_value = [match_id, league_id, "gss", "0", index, p_code, value, condition, odds_only,
+    #                             sole, "hg3535", "0", ""]
+    #         size_home_data = dict(zip(size_guest_key, size_guest_value))
+    #         if odds_only not in uuid_list:
+    #             data_list.append(size_home_data)
+    #
+    #     # p_code, p_id = get_pcode(corner_ball, 'concede')
+    #     p_code = 'CO'
+    #     half_concede_home_rule = item["half_concede_home_rule"]
+    #     half_concede_home = item["half_concede_home"]
+    #     half_concede_guest_rule = item["half_concede_guest_rule"]
+    #     half_concede_guest = item["half_concede_guest"]
+    #     # half_concede_home
+    #     for index, value in enumerate(half_concede_guest):
+    #         hash_str = p_code + "cog_h" + str(index) + str(half_concede_guest_rule[index]) + str(
+    #             value) + "hg3535" + str(match_id)
+    #         sole_str = p_code + "cog_h" + str(index) + str(match_id) + "hg3535"
+    #         odds_only = Helper.genearte_MD5(hash_str)
+    #         sole = Helper.genearte_MD5(sole_str)
+    #         odds_onlys.append(odds_only)
+    #         half_concede_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                                   "odds_only", "sole", "source", "type", "team"]
+    #         condition = fuhao(half_concede_guest_rule[index])
+    #         half_concede_guest_value = [match_id, league_id, "cog_h", "0", index, p_code, value, condition,
+    #                                     odds_only, sole, "hg3535", "0", ""]
+    #         half_concede_guest_data = dict(zip(half_concede_guest_key, half_concede_guest_value))
+    #         # if uid_num < 1:
+    #         if odds_only not in uuid_list:
+    #             data_list.append(half_concede_guest_data)
+    #     # half_concede_home
+    #     for index, value in enumerate(half_concede_home):
+    #         hash_str = p_code + "coh_h" + str(index) + str(half_concede_home_rule[index]) + str(
+    #             value) + "hg3535" + str(match_id)
+    #         sole_str = p_code + "coh_h" + str(index) + str(match_id) + "hg3535"
+    #         odds_only = Helper.genearte_MD5(hash_str)
+    #         sole = Helper.genearte_MD5(sole_str)
+    #         odds_onlys.append(odds_only)
+    #         half_concede_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                                  "odds_only", "sole", "source", "type", "team"]
+    #         condition = fuhao(half_concede_home_rule[index])
+    #         half_concede_home_value = [match_id, league_id, "coh_h", "0", index, p_code, value, condition,
+    #                                    odds_only, sole, "hg3535", "0", ""]
+    #         half_concede_home_data = dict(zip(half_concede_home_key, half_concede_home_value))
+    #         if odds_only not in uuid_list:
+    #             data_list.append(half_concede_home_data)
+    #
+    #     concede_guest = item["concede_guest"]
+    #     concede_guest_rule = item["concede_guest_rule"]
+    #     concede_home = item["concede_home"]
+    #     concede_home_rule = item["concede_home_rule"]
+    #     # concede_guest
+    #     for index, value in enumerate(concede_guest):
+    #         hash_str = p_code + "cog" + str(index) + str(concede_guest_rule[index]) + str(
+    #             value) + "hg3535" + str(match_id)
+    #         sole_str = p_code + "cog" + str(index) + str(match_id) + "hg3535"
+    #         odds_only = Helper.genearte_MD5(hash_str)
+    #         sole = Helper.genearte_MD5(sole_str)
+    #         odds_onlys.append(odds_only)
+    #         concede_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                              "odds_only", "sole", "source", "type", "team"]
+    #         condition = fuhao(concede_guest[index])
+    #         concede_guest_value = [match_id, league_id, "cog", "0", index, p_code, value, condition,
+    #                                odds_only, sole, "hg3535", "0", ""]
+    #         concede_guest_data = dict(zip(concede_guest_key, concede_guest_value))
+    #         if odds_only not in uuid_list:
+    #             data_list.append(concede_guest_data)
+    #     # concede_home
+    #     for index, value in enumerate(concede_home):
+    #         hash_str = p_code + "coh" + str(index) + str(concede_home_rule[index]) + str(
+    #             value) + "hg3535" + str(match_id)
+    #         sole_str = p_code + "coh" + str(index) + str(match_id) + "hg3535"
+    #         odds_only = Helper.genearte_MD5(hash_str)
+    #         sole = Helper.genearte_MD5(sole_str)
+    #         odds_onlys.append(odds_only)
+    #         concede_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                             "odds_only", "sole", "source", "type", "team"]
+    #         condition = fuhao(concede_home_rule[index])
+    #         concede_home_value = [match_id, league_id, "coh", "0", index, p_code, value, condition, odds_only,
+    #                               sole, "hg3535", "0", ""]
+    #         concede_guest_data = dict(zip(concede_home_key, concede_home_value))
+    #         if odds_only not in uuid_list:
+    #             data_list.append(concede_guest_data)
+    #
+    #     # 独赢----------------------------------------------------------------------------------------------------------
+    #     # p_code, p_id = get_pcode(corner_ball, 'capot')
+    #     p_code = 'C'
+    #     half_capot_home = item["half_capot_home"]
+    #     half_capot_guest = item["half_capot_guest"]
+    #     half_capot_dogfall = item["half_capot_dogfall"]
+    #     capot_home = item["capot_home"]
+    #     capot_guest = item["capot_guest"]
+    #     capot_dogfall = item["capot_dogfall"]
+    #
+    #     # half_capot_home
+    #     hash_str = p_code + "ch_h" + '0' + '1' + str(half_capot_home) + "hg3535" + str(match_id)
+    #     sole_str = p_code + "ch_h" + '0' + str(match_id) + "hg3535"
+    #     odds_only = Helper.genearte_MD5(hash_str)
+    #     sole = Helper.genearte_MD5(sole_str)
+    #     odds_onlys.append(odds_only)
+    #     half_capot_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                            "odds_only", "sole", "source", "type", "team"]
+    #     half_capot_home_value = [match_id, league_id, "ch_h", "0", 0, p_code, half_capot_home, '1',
+    #                              odds_only, sole, "hg3535", "0", ""]
+    #     half_capot_homet_data = dict(zip(half_capot_home_key, half_capot_home_value))
+    #     if odds_only not in uuid_list:
+    #         data_list.append(half_capot_homet_data)
+    #
+    #     # half_capot_guest
+    #     hash_str = p_code + "cg_h" + '0' + '2' + str(half_capot_guest) + "hg3535" + str(match_id)
+    #     sole_str = p_code + "cg_h" + '0' + str(match_id) + "hg3535"
+    #     odds_only = Helper.genearte_MD5(hash_str)
+    #     sole = Helper.genearte_MD5(sole_str)
+    #     odds_onlys.append(odds_only)
+    #     half_capot_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                             "odds_only", "sole", "source", "type", "team"]
+    #     half_capot_guest_value = [match_id, league_id, "cg_h", "0", 0, p_code, half_capot_guest, '2',
+    #                               odds_only, sole, "hg3535", "0", ""]
+    #     half_capot_guest_data = dict(zip(half_capot_guest_key, half_capot_guest_value))
+    #     if odds_only not in uuid_list:
+    #         data_list.append(half_capot_guest_data)
+    #
+    #     # half_capot_dogfall
+    #     hash_str = p_code + "cd_h" + '0' + 'X' + str(half_capot_dogfall) + "hg3535" + str(match_id)
+    #     sole_str = p_code + "cd_h" + '0' + str(match_id) + "hg3535"
+    #     odds_only = Helper.genearte_MD5(hash_str)
+    #     sole = Helper.genearte_MD5(sole_str)
+    #     odds_onlys.append(odds_only)
+    #     half_capot_dogfall_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                               "odds_only", "sole", "source", "type", "team"]
+    #     half_capot_dogfall_value = [match_id, league_id, "cd_h", "0", 0, p_code, half_capot_dogfall, 'X',
+    #                                 odds_only, sole, "hg3535", "0", ""]
+    #     half_capot_dogfall_data = dict(zip(half_capot_dogfall_key, half_capot_dogfall_value))
+    #     if odds_only not in uuid_list:
+    #         data_list.append(half_capot_dogfall_data)
+    #
+    #     # capot_dogfall
+    #     hash_str = p_code + "cd" + '0' + 'X' + str(capot_dogfall) + "hg3535" + str(match_id)
+    #     sole_str = p_code + "cd" + '0' + str(match_id) + "hg3535"
+    #     odds_only = Helper.genearte_MD5(hash_str)
+    #     sole = Helper.genearte_MD5(sole_str)
+    #     odds_onlys.append(odds_only)
+    #     capot_dogfall_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                          "odds_only", "sole", "source", "type", "team"]
+    #     capot_dogfall_value = [match_id, league_id, "cd", "0", 0, p_code, capot_dogfall, 'X', odds_only,
+    #                            sole, "hg3535", "0", ""]
+    #     capot_dogfall_data = dict(zip(capot_dogfall_key, capot_dogfall_value))
+    #     if odds_only not in uuid_list:
+    #         data_list.append(capot_dogfall_data)
+    #
+    #     # capot_home
+    #     hash_str = p_code + "ch" + '0' + '1' + str(capot_home) + "hg3535" + str(match_id)
+    #     sole_str = p_code + "ch" + '0' + str(match_id) + "hg3535"
+    #     odds_only = Helper.genearte_MD5(hash_str)
+    #     sole = Helper.genearte_MD5(sole_str)
+    #     odds_onlys.append(odds_only)
+    #     capot_home_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                       "odds_only", "sole", "source", "type", "team"]
+    #     capot_home_value = [match_id, league_id, "ch", "0", 0, p_code, capot_home, '1',
+    #                         odds_only, sole, "hg3535", "0", ""]
+    #     capot_homet_data = dict(zip(capot_home_key, capot_home_value))
+    #     if odds_only not in uuid_list:
+    #         data_list.append(capot_homet_data)
+    #
+    #     # capot_guest
+    #     hash_str = p_code + "cg" + '0' + '2' + str(capot_guest) + "hg3535" + str(match_id)
+    #     sole_str = p_code + "cg" + '0' + str(match_id) + "hg3535"
+    #     odds_only = Helper.genearte_MD5(hash_str)
+    #     sole = Helper.genearte_MD5(sole_str)
+    #     odds_onlys.append(odds_only)
+    #     capot_guest_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                        "odds_only", "sole", "source", "type", "team"]
+    #     capot_guest_value = [match_id, league_id, "cg", "0", 0, p_code, capot_home, '2',
+    #                          odds_only, sole, "hg3535", "0", ""]
+    #     capot_guest_data = dict(zip(capot_guest_key, capot_guest_value))
+    #     if odds_only not in uuid_list:
+    #         data_list.append(capot_guest_data)
+    #
+    #     # 入球数单双-----------------------------------------------------------------------------------------------------
+    #     # p_code, p_id = get_pcode(corner_ball, 'two_sides')
+    #     p_code = 'TS'
+    #     odd_even_odd = item["odd_even_odd"]
+    #     odd_even_even = item["odd_even_even"]
+    #     half_odd_even_odd = item["half_odd_even_odd"]
+    #     half_odd_even_even = item["half_odd_even_even"]
+    #
+    #     # odd_even_odd
+    #     hash_str = p_code + "tss" + '0' + '单' + str(odd_even_odd) + "hg3535" + str(match_id)
+    #     sole_str = p_code + "tss" + '0' + str(match_id) + "hg3535"
+    #     odds_only = Helper.genearte_MD5(hash_str)
+    #     sole = Helper.genearte_MD5(sole_str)
+    #     odds_onlys.append(odds_only)
+    #     single_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                   "odds_only", "sole", "source", "type", "team"]
+    #     single_value = [match_id, league_id, "tss", "0", 0, p_code, odd_even_odd, '单',
+    #                     odds_only, sole, "hg3535", "0", ""]
+    #     single_data = dict(zip(single_key, single_value))
+    #     if odds_only not in uuid_list:
+    #         data_list.append(single_data)
+    #
+    #     # odd_even_even
+    #     hash_str = p_code + "tsd" + '0' + '双' + str(odd_even_even) + "hg3535" + str(match_id)
+    #     sole_str = p_code + "tsd" + '0' + str(match_id) + "hg3535"
+    #     odds_only = Helper.genearte_MD5(hash_str)
+    #     sole = Helper.genearte_MD5(sole_str)
+    #     odds_onlys.append(odds_only)
+    #     double_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                   "odds_only", "sole", "source", "type", "team"]
+    #     double_value = [match_id, league_id, "tsd", "0", 0, p_code, odd_even_even, '双',
+    #                     odds_only, sole, "hg3535", "0", ""]
+    #     double_data = dict(zip(double_key, double_value))
+    #     if odds_only not in uuid_list:
+    #         data_list.append(double_data)
+    #
+    #     # half_odd_even_even
+    #     hash_str = p_code + "tsd_h" + '0' + '双' + str(half_odd_even_even) + "hg3535" + str(match_id)
+    #     sole_str = p_code + "tsd_h" + '0' + str(match_id) + "hg3535"
+    #     odds_only = Helper.genearte_MD5(hash_str)
+    #     sole = Helper.genearte_MD5(sole_str)
+    #     odds_onlys.append(odds_only)
+    #     half_double_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                        "odds_only", "sole", "source", "type", "team"]
+    #     half_double_value = [match_id, league_id, "tsd_h", "0", 0, p_code, half_odd_even_even, '双',
+    #                          odds_only, sole, "hg3535", "0", ""]
+    #     half_double_data = dict(zip(half_double_key, half_double_value))
+    #     if odds_only not in uuid_list:
+    #         data_list.append(half_double_data)
+    #
+    #     # half_odd_even_odd
+    #     hash_str = p_code + "tss_h" + '0' + '单' + str(half_odd_even_odd) + "hg3535" + str(match_id)
+    #     sole_str = p_code + "tss_h" + '0' + str(match_id) + "hg3535"
+    #     odds_only = Helper.genearte_MD5(hash_str)
+    #     sole = Helper.genearte_MD5(sole_str)
+    #     odds_onlys.append(odds_only)
+    #     half_single_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                        "odds_only", "sole", "source", "type", "team"]
+    #     half_single_value = [match_id, league_id, "tss_h", "0", 0, p_code, half_odd_even_odd, '单', odds_only,
+    #                          sole, "hg3535", "0", ""]
+    #     half_single_data = dict(zip(half_single_key, half_single_value))
+    #     if odds_only not in uuid_list:
+    #         data_list.append(half_single_data)
+    #
+    #     # 总入球数 ------------------------------------------------------------------------------------------------------
+    #     # p_code, p_id = get_pcode(corner_ball, 'total_goal')
+    #     p_code = 'TG'
+    #     total_goals = item['total_goal']
+    #     total_dict = {'tg0': '0-1', 'tg1': '2-3', 'tg2': '4-6','tg3': '7或以上', 'tg0_h': '0', "tg1_h": '1',
+    #                   "tg2_h": '2', "tg3_h": '3或以上'}
+    #     # 全场入球数 单双
+    #     # 上半场入球数 单双
+    #     for key, value in total_goals.items():
+    #         hash_str = p_code + key + '0' + total_dict[key] + str(value) + "hg3535" + str(match_id)
+    #         sole_str = p_code + key + '0' + str(match_id) + "hg3535"
+    #         odds_only = Helper.genearte_MD5(hash_str)
+    #         sole = Helper.genearte_MD5(sole_str)
+    #         odds_onlys.append(odds_only)
+    #         total_goals_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                            "odds_only", "sole", "source", "type", "team"]
+    #         total_goals_value = [match_id, league_id, key, "0", 0, p_code, value, total_dict[key], odds_only,
+    #                              sole, "hg3535", "0", ""]
+    #         total_goals_data = dict(zip(total_goals_key, total_goals_value))
+    #         if odds_only not in uuid_list:
+    #             data_list.append(total_goals_data)
+    #
+    #     # 全场半场 ------------------------------------------------------------------------------------------------------
+    #     half_fulls = item['half_full']
+    #     # p_code, p_id = get_pcode(corner_ball, 'half_full')
+    #     p_code = 'HF'
+    #     full_dict = {"hfhh": "主主", "hfhd": "主和", "hfhg": "主客", "hfdh": "和主",
+    #                  "hfdd": "和和", "hfdg": "和客", "hfgh": "客主", "hfgd": "客和", "hfgg": "客客"}
+    #     if half_fulls:
+    #         for key, value in half_fulls.items():
+    #             hash_str = p_code + key + '0' + full_dict[key] + str(value) + "hg3535" + str(match_id)
+    #             sole_str = p_code + key + '0' + str(match_id) + "hg3535"
+    #             odds_only = Helper.genearte_MD5(hash_str)
+    #             sole = Helper.genearte_MD5(sole_str)
+    #             odds_onlys.append(odds_only)
+    #             half_fulls_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                                "odds_only", "sole", "source", "type", "team"]
+    #             half_fulls_value = [match_id, league_id, key, "0", 0, p_code, value, full_dict[key], odds_only,
+    #                                  sole, "hg3535", "0", ""]
+    #             half_fulls_data = dict(zip(half_fulls_key, half_fulls_value))
+    #             if odds_only not in uuid_list:
+    #                 data_list.append(half_fulls_data)
+    #
+    #     # 波胆------------------------------------------------------------------------------------------------------------------
+    #     bodan_datas = item['bodan_data']
+    #     # p_code, p_id = get_pcode(corner_ball, 'bodan')
+    #     p_code = 'B'
+    #     bodan_dict = {"b10": "1-0", "b20": "2-0", "b21": "2-1", "b30": "3-0", "b31": "3-1", "b32": "3-2",
+    #                   "b40": "4-0", "b41": "4-1", "b42": "4-2", "b43": "4-3", "b01": "0-1", "b02": "0-2",
+    #                   "b12": "1-2", "b03": "0-3", "b13": "1-3", "b23": "2-3", "b04": "0-4", "b14": "1-4",
+    #                   "b24": "2-4", "b34": "3-4", "b00": "0-0", "b11": "1-1", "b22": "2-2", "b33": "3-3",
+    #                   "b44": "4-4", "bo": "其他", "b10_h": "1-0", "b20_h": "2-0", "b21_h": "2-1", "b30_h": "3-0",
+    #                   "b31_h": "3-1", "b32_h": "3-2", "b01_h": "0-1", "b02_h": "0-2", "b12_h": "1-2", "b03_h": "0-3",
+    #                   "b13_h": "1-3", "b23_h": "2-3", "b00_h": "0-0", "b11_h": "1-1", "b22_h": "2-2", "b33_h": "3-3",
+    #                   "bo_h": "其他"}
+    #     if bodan_datas:
+    #         for key, value in bodan_datas.items():
+    #             hash_str = p_code + key + '0' + bodan_dict[key] + str(value) + "hg3535" + str(match_id)
+    #             sole_str = p_code + key + '0' + str(match_id) + "hg3535"
+    #             odds_only = Helper.genearte_MD5(hash_str)
+    #             sole = Helper.genearte_MD5(sole_str)
+    #             odds_onlys.append(odds_only)
+    #             bodan_dict_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                               "odds_only", "sole", "source", "type", "team"]
+    #             bodan_dict_value = [match_id, league_id, key, "0", 0, p_code, value, bodan_dict[key], odds_only,
+    #                                 sole, "hg3535", "0", ""]
+    #             bodan_dict_data = dict(zip(bodan_dict_key, bodan_dict_value))
+    #             if odds_only not in uuid_list:
+    #                 data_list.append(bodan_dict_data)
+    #
+    #     # 最先进球/最后进球 ----------------------------------------------------------------------------------------------
+    #     first_last_balls = item['first_last_ball']
+    #     # p_code, p_id = get_pcode(corner_ball, 'first_last_ball')
+    #     p_code = 'FLB'
+    #     first_last_dict = {"flbfh": "最先进球", "flbfg": "最先进球", "flblh": "最后进球", "flblg": "最后进球", "flbn": "没有进球"}
+    #     if first_last_balls:
+    #         for key, value in first_last_balls.items():
+    #             hash_str = p_code + key + '0' + first_last_dict[key] + str(value) + "hg3535" + str(match_id)
+    #             sole_str = p_code + key + '0' + str(match_id) + "hg3535"
+    #             odds_only = Helper.genearte_MD5(hash_str)
+    #             sole = Helper.genearte_MD5(sole_str)
+    #             odds_onlys.append(odds_only)
+    #             first_last_balls_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds", "condition",
+    #                               "odds_only", "sole", "source", "type", "team"]
+    #             first_last_balls_value = [match_id, league_id, key, "0", 0, p_code, value, first_last_dict[key], odds_only,
+    #                                 sole, "hg3535", "0", ""]
+    #             first_last_balls_data = dict(zip(first_last_balls_key, first_last_balls_value))
+    #             if odds_only not in uuid_list:
+    #                 data_list.append(first_last_balls_data)
+    #
+    #     # p_code, p_id = get_pcode(corner_ball, 'tema_ball')
+    #     # 球队得分大小
+    #     p_code = 'TB'
+    #     # 全场
+    #     full_dicts = item['full_data']
+    #     # 上半场
+    #     half_dicts = item['half_data']
+    #     full_dict_rules = item['full_data_rule']
+    #     half_dict_rules = item['half_data_rule']
+    #     if full_dicts:
+    #         for key, value in full_dicts.items():
+    #             hash_str = p_code + key + '0' + full_dict_rules[key] + str(value) + "hg3535" + str(match_id)
+    #             sole_str = p_code + key + '0' + str(match_id) + "hg3535"
+    #             odds_only = Helper.genearte_MD5(hash_str)
+    #             sole = Helper.genearte_MD5(sole_str)
+    #             odds_onlys.append(odds_only)
+    #             full_dict_rules_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+    #                                     "condition", "odds_only", "sole", "source", "type", "team"]
+    #             full_dict_rules_value = [match_id, league_id, key, "0", 0, p_code, value, full_dict_rules[key],
+    #                                       odds_only,sole, "hg3535", "0", ""]
+    #             full_dict_rules_data = dict(zip(full_dict_rules_key, full_dict_rules_value))
+    #             if odds_only not in uuid_list:
+    #                 data_list.append(full_dict_rules_data)
+    #     #
+    #     if half_dicts:
+    #         for key, value in half_dicts.items():
+    #             hash_str = p_code + key + '0' + half_dict_rules[key] + str(value) + "hg3535" + str(match_id)
+    #             sole_str = p_code + key + '0' + str(match_id) + "hg3535"
+    #             odds_only = Helper.genearte_MD5(hash_str)
+    #             sole = Helper.genearte_MD5(sole_str)
+    #             odds_onlys.append(odds_only)
+    #             half_dicts_key = ["match_id", "lg_id", "odds_code", "status", "sort", "p_code", "odds",
+    #                             "condition","odds_only", "sole", "source", "type", "team"]
+    #             half_dicts_value = [match_id, league_id, key, "0", 0, p_code, value, half_dict_rules[key],
+    #                                      odds_only, sole, "hg3535", "0", ""]
+    #             half_dicts_data = dict(zip(half_dicts_key, half_dicts_value))
+    #             if odds_only not in uuid_list:
+    #                 data_list.append(half_dicts_data)
+    #     if pt == '3':
+    #         ris_stringscene = 1
+    #     else:
+    #         ris_stringscene = 0
+    #     odds_key = ["game_code", "title", "match_id", "lg_id", "data", "source", "odds_only", "tag", "uuid", "is_stringscene", "utime", "pt"]
+    #     odds_value = ["zq", "odds", match_id, league_id, data_list, "hg3535", odds_onlys, tag_number, uuid, ris_stringscene, utime, pt]
+    #     odds_dict = dict(zip(odds_key, odds_value))
+    #     if data_list:
+    #         # print(odds_dict)
+    #         response_data = Helper.async_post(url + '/setOdds', odds_dict)
+    #         print(response_data)
+    #         if "成功" in response_data:
+    #             if result:
+    #                 self.db.hg3535_zq_odds.update({'match_id': match_id, 'pt': pt}, {'$set': {"data": data_list, "odds_only": odds_onlys, "utime": utime}}, upsert=True)
+    #             else:
+    #                 self.db.hg3535_zq_odds.insert(odds_dict)

+ 63 - 55
hg3535/settings.py

@@ -14,7 +14,6 @@ BOT_NAME = 'hg3535'
 SPIDER_MODULES = ['hg3535.spiders']
 NEWSPIDER_MODULE = 'hg3535.spiders'
 
-
 # Crawl responsibly by identifying yourself (and your website) on the user-agent
 USER_AGENT = {
     'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20120813 Firefox/16.0'
@@ -24,28 +23,28 @@ USER_AGENT = {
 ROBOTSTXT_OBEY = False
 
 # Configure maximum concurrent requests performed by Scrapy (default: 16)
-CONCURRENT_REQUESTS = 16
+CONCURRENT_REQUESTS = 32
 
 # Configure a delay for requests for the same website (default: 0)
 # See https://doc.scrapy.org/en/latest/topics/settings.html#download-delay
 # See also autothrottle settings and docs
-#DOWNLOAD_DELAY = 3
-DOWNLOAD_DELAY = 0
+# DOWNLOAD_DELAY = 3
+DOWNLOAD_DELAY = 0.15
 # The download delay setting will honor only one of:
-CONCURRENT_REQUESTS_PER_DOMAIN = 16
-CONCURRENT_REQUESTS_PER_IP = 16
+CONCURRENT_REQUESTS_PER_DOMAIN = 32
+CONCURRENT_REQUESTS_PER_IP = 0
 
 # Disable cookies (enabled by default)
-#COOKIES_ENABLED = False
+# COOKIES_ENABLED = False
 
 # Disable Telnet Console (enabled by default)
-#TELNETCONSOLE_ENABLED = False
+# TELNETCONSOLE_ENABLED = False
 
 # Override the default request headers:
-#DEFAULT_REQUEST_HEADERS = {
+# DEFAULT_REQUEST_HEADERS = {
 #   'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
 #   'Accept-Language': 'en',
-#}
+# }
 
 # Enable or disable spider middlewares
 # See https://doc.scrapy.org/en/latest/topics/spider-middleware.html
@@ -61,59 +60,59 @@ CONCURRENT_REQUESTS_PER_IP = 16
 # Enable or disable downloader middlewares
 # See https://doc.scrapy.org/en/latest/topics/downloader-middleware.html
 DOWNLOADER_MIDDLEWARES = {
-   # 'hg3535.middlewares.Hg3535DownloaderMiddleware': 200,
-   'hg3535.middlewares.Hg3535timeoutDownloaderMiddleware': 200,
-   'scrapy.downloadermiddlewares.downloadtimeout.DownloadTimeoutMiddleware': 500,
-   # 'scrapy.contrib.downloadermiddleware.retry.RetryMiddleware': 502,
+    # 'hg3535.middlewares.Hg3535DownloaderMiddleware': 200,
+    'hg3535.middlewares.Hg3535timeoutDownloaderMiddleware': 200,
+    'scrapy.downloadermiddlewares.downloadtimeout.DownloadTimeoutMiddleware': 500,
+    # 'scrapy.contrib.downloadermiddleware.retry.RetryMiddleware': 502,
 
 }
 
 # Enable or disable extensions
 # See https://doc.scrapy.org/en/latest/topics/extensions.html
-#EXTENSIONS = {
+# EXTENSIONS = {
 #    'scrapy.extensions.telnet.TelnetConsole': None,
-#}
+# }
 
 # Configure item pipeline
 # See https://doc.scrapy.org/en/latest/topics/item-pipeline.html
 ITEM_PIPELINES = {
-   'scrapy_redis.pipelines.RedisPipeline': 400,
-   # # 篮球
-   # 'hg3535.pipeline.Lanqiupipeline': 300,
-   # # 冠军
-   # 'hg3535.pipeline.Guanjunpipeline': 300,
-   # # 联赛
-   # 'hg3535.pipeline.Liansaipipeline': 300,
-   # # 足球
-   # 'hg3535.pipeline.Zuqiupipeline': 300,
-   # # 网球
-   # "hg3535.pipeline.Wangqiupipeline": 300,
-   # # 网球波胆
-   # 'hg3535.pipeline.Wqbodanpipeline': 300,
-   # # 棒球让球&大小盘
-   # "hg3535.pipeline.Bangqiupipeline": 300,
+    # 'scrapy_redis.pipelines.RedisPipeline': 400,
+    # # 篮球
+    # 'hg3535.pipeline.Lanqiupipeline': 300,
+    # # 冠军
+    # 'hg3535.pipeline.Guanjunpipeline': 300,
+    # # 联赛
+    # 'hg3535.pipeline.Liansaipipeline': 300,
+    # # 足球
+    # 'hg3535.pipeline.Zuqiupipeline': 300,
+    # # 网球
+    # "hg3535.pipeline.Wangqiupipeline": 300,
+    # # 网球波胆
+    # 'hg3535.pipeline.Wqbodanpipeline': 300,
+    # # 棒球让球&大小盘
+    # "hg3535.pipeline.Bangqiupipeline": 300,
 }
 
 # Enable and configure the AutoThrottle extension (disabled by default)
 # See https://doc.scrapy.org/en/latest/topics/autothrottle.html
-#AUTOTHROTTLE_ENABLED = True
+# AUTOTHROTTLE_ENABLED = True
 # The initial download delay
-#AUTOTHROTTLE_START_DELAY = 5
+# AUTOTHROTTLE_START_DELAY = 5
 # The maximum download delay to be set in case of high latencies
-#AUTOTHROTTLE_MAX_DELAY = 60
+# AUTOTHROTTLE_MAX_DELAY = 60
 # The average number of requests Scrapy should be sending in parallel to
 # each remote server
-#AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
+# AUTOTHROTTLE_TARGET_CONCURRENCY = 1.0
 # Enable showing throttling stats for every response received:
-#AUTOTHROTTLE_DEBUG = False
+# AUTOTHROTTLE_DEBUG = False
 
 # Enable and configure HTTP caching (disabled by default)
 # See https://doc.scrapy.org/en/latest/topics/downloader-middleware.html#httpcache-middleware-settings
-#HTTPCACHE_ENABLED = True
-#HTTPCACHE_EXPIRATION_SECS = 0
-#HTTPCACHE_DIR = 'httpcache'
-#HTTPCACHE_IGNORE_HTTP_CODES = []
-#HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.FilesystemCacheStorage'
+# HTTPCACHE_ENABLED = True
+# HTTPCACHE_EXPIRATION_SECS = 0
+# HTTPCACHE_DIR = 'httpcache'
+# HTTPCACHE_IGNORE_HTTP_CODES = []
+# HTTPCACHE_STORAGE = 'scrapy.extensions.httpcache.FilesystemCacheStorage'
 # DOWNLOAD_TIMEOUT = 180
 
 REACTOR_THREADPOOL_MAXSIZE = 40
@@ -123,10 +122,9 @@ RETRY_ENABLED = False
 DOWNLOAD_TIMEOUT = 1
 REDIRECT_ENABLED = False
 
-
 # SCHEDULER_PERSIST = False  # 是否在关闭时候保留原来的调度器和去重记录,True=保留,False=清空
-SCHEDULER_FLUSH_ON_START = False
-TELNETCONSOLE_PORT = None
+# SCHEDULER_FLUSH_ON_START = False
+# TELNETCONSOLE_PORT = None
 # TELNETCONSOLE_ENABLED=False
 # AttributeError: 'TelnetConsole' object has no attribute 'port'
 
@@ -151,7 +149,7 @@ TELNETCONSOLE_PORT = None
 # POST_PORT = '5433'
 # POST_PASSWORD = '123456'
 
-#以后解开这个位置的注释
+# 以后解开这个位置的注释
 # POST_HOST = '172.17.0.4'
 # POST_DATABASE = 'kaiyou'
 # POST_USER = 'kaiyou'
@@ -165,17 +163,17 @@ TELNETCONSOLE_PORT = None
 # POST_PORT = '10432'
 # POST_PASSWORD = '123456'
 
-R_HOST = '192.168.2.200'
-R_POST = '6379'
-R_PASSWORD = '123456'
+# R_HOST = '192.168.2.200'
+# R_POST = '6379'
+# R_PASSWORD = '123456'
 #
 # POST_HOST = 'localhost'
 # POST_DATABASE = 'kaiyou'
 # POST_USER = 'kaiyou'
 # POST_PORT = '10432'
 # POST_PASSWORD = '123456'
-SCHEDULER = "scrapy_redis.scheduler.Scheduler"
-DUPEFILTER_CLASS = "scrapy_redis.dupefilter.RFPDupeFilter"
+# SCHEDULER = "scrapy_redis.scheduler.Scheduler"
+# DUPEFILTER_CLASS = "scrapy_redis.dupefilter.RFPDupeFilter"
 
 # SCHEDULER_SERIALIZER = "scrapy_redis.picklecompat"
 
@@ -184,8 +182,18 @@ DUPEFILTER_CLASS = "scrapy_redis.dupefilter.RFPDupeFilter"
 # SCHEDULER_PERSIST = False
 
 # #使用优先级队列安排请求。(默认)
-SCHEDULER_QUEUE_CLASS = 'scrapy_redis.queue.PriorityQueue'
-REDIS_HOST = '192.168.2.200'
-REDIS_PORT = 6379
-REDIS_PARAMS = {'password': 123456, 'db': 1}
-#
+# SCHEDULER_QUEUE_CLASS = 'scrapy_redis.queue.PriorityQueue'
+# REDIS_HOST = '192.168.2.200'
+# REDIS_PORT = 6379
+# REDIS_PARAMS = {'password': 123456, 'db': 1}
+# 随机等待
+RANDOMIZE_DOWNLOAD_DELAY = True
+# AutoThrottle扩展
+AUTOTHROTTLE_ENABLED = True
+AUTOTHROTTLE_DEBUG = True
+AUTOTHROTTLE_TARGET_CONCURRENCY = 0.5
+AUTOTHROTTLE_MAX_DELAY = 60
+# SCHEDULER = "scrapy_redis.scheduler.Scheduler"
+# DUPEFILTER_CLASS = "scrapy_redis.dupefilter.RFPDupeFilter"
+# REDIS_URL = 'redis://:123456@192.168.2.200:6379'
+# SCHEDULER_PERSIST = False

+ 102 - 102
hg3535/spiders/bangqiu.py

@@ -106,80 +106,80 @@ class BqrangqiuSpider(scrapy.Spider):
                     concedes_dict_rule = {}
                     try:
                         concedes = result['o']["ah"]["v"]
-                        concedes_dict_rule['concede_home'] = concedes[1]
-                        concedes_dict_rule['concede_guest'] = concedes[3]
+                        concedes_dict_rule['coh'] = concedes[1]
+                        concedes_dict_rule['cog'] = concedes[3]
                         if pt is 3:
-                            concedes_dict['concede_home'] = float(concedes[5]) - 1
-                            concedes_dict['concede_guest'] = float(concedes[7]) - 1
+                            concedes_dict['coh'] = float(concedes[5]) - 1
+                            concedes_dict['cog'] = float(concedes[7]) - 1
                         else:
-                            concedes_dict['concede_home'] = float(concedes[5])
-                            concedes_dict['concede_guest'] = float(concedes[7])
+                            concedes_dict['coh'] = float(concedes[5])
+                            concedes_dict['cog'] = float(concedes[7])
                     except:
-                        concedes_dict_rule['concede_home'] = ""
-                        concedes_dict['concede_home'] = ""
-                        concedes_dict_rule['concede_guest'] = ""
-                        concedes_dict['concede_guest'] = ""
+                        concedes_dict_rule['coh'] = ""
+                        concedes_dict['coh'] = ""
+                        concedes_dict_rule['cog'] = ""
+                        concedes_dict['cog'] = ""
                     # 让球 前5局-------------------------------------------------------------------------------------------------------------
                     try:
                         concedes = result['o']["ahf5in"]["v"]
-                        concedes_dict_rule['five_concede_home'] = concedes[1]
-                        concedes_dict_rule['five_concede_guest'] = concedes[3]
+                        concedes_dict_rule['coh_5'] = concedes[1]
+                        concedes_dict_rule['cog_5'] = concedes[3]
                         if pt is 3:
-                            concedes_dict['five_concede_home'] = float(concedes[5]) - 1
-                            concedes_dict['five_concede_guest'] = float(concedes[7]) - 1
+                            concedes_dict['coh_5'] = float(concedes[5]) - 1
+                            concedes_dict['cog_5'] = float(concedes[7]) - 1
                         else:
-                            concedes_dict['five_concede_home'] = concedes[5]
-                            concedes_dict['five_concede_guest'] = concedes[7]
+                            concedes_dict['coh_5'] = concedes[5]
+                            concedes_dict['cog_5'] = concedes[7]
                     except:
-                        concedes_dict_rule['five_concede_home'] = ""
-                        concedes_dict['five_concede_home'] = ""
-                        concedes_dict_rule['five_concede_guest'] = ""
-                        concedes_dict['five_concede_guest'] = ""
+                        concedes_dict_rule['coh_5'] = ""
+                        concedes_dict['coh_5'] = ""
+                        concedes_dict_rule['cog_5'] = ""
+                        concedes_dict['cog_5'] = ""
                     # ---------------------------------------------------独赢----------------------------------------------------------------
                     capots_dict = {}
                     try:
                         capots = result['o']["ml"]["v"]
-                        capots_dict['capot_home'] = capots[1]
-                        capots_dict['capot_guest'] = capots[3]
+                        capots_dict['ch'] = capots[1]
+                        capots_dict['cg'] = capots[3]
 
                     except:
-                        capots_dict['capot_home'] = ""
-                        capots_dict['capot_guest'] = ""
+                        capots_dict['ch'] = ""
+                        capots_dict['cg'] = ""
                     # ---------------------------------------------------总得分:大/小--------------------------------------------------------
 
                     total_size_dict = {}
                     total_size_dict_rule = {}
                     try:
                         total_sizes = result['o']["ou"]["v"]
-                        total_size_dict_rule['total_size_big'] = total_sizes[1]
-                        total_size_dict_rule['total_size_small'] = total_sizes[3]
+                        total_size_dict_rule['tnb'] = total_sizes[1]
+                        total_size_dict_rule['tns'] = total_sizes[3]
                         if pt is 3:
-                            total_size_dict['total_size_big'] = float(total_sizes[5]) - 1
-                            total_size_dict['total_size_small'] = float(total_sizes[7]) - 1
+                            total_size_dict['tnb'] = float(total_sizes[5]) - 1
+                            total_size_dict['tns'] = float(total_sizes[7]) - 1
                         else:
-                            total_size_dict['total_size_big'] = total_sizes[5]
-                            total_size_dict['total_size_small'] = total_sizes[7]
+                            total_size_dict['tnb'] = total_sizes[5]
+                            total_size_dict['tns'] = total_sizes[7]
                     except:
-                        total_size_dict_rule['total_size_big'] = ""
-                        total_size_dict['total_size_big'] = ""
-                        total_size_dict_rule['total_size_small'] = ""
-                        total_size_dict['total_size_small'] = ""
+                        total_size_dict_rule['tnb'] = ""
+                        total_size_dict['tnb'] = ""
+                        total_size_dict_rule['tns'] = ""
+                        total_size_dict['tns'] = ""
                     # 总得分: 大/小 前5局-----------------------------------------------------------------------------------------------------
                     try:
                         total_sizes = result['o']["ouf5in"]["v"]
-                        total_size_dict_rule['five_total_size_big'] = total_sizes[1]
-                        total_size_dict_rule['five_total_size_small'] = total_sizes[3]
+                        total_size_dict_rule['tnb_5'] = total_sizes[1]
+                        total_size_dict_rule['tns_5'] = total_sizes[3]
                         if pt is 3:
-                            total_size_dict['five_total_size_big'] = float(total_sizes[5]) - 1
-                            total_size_dict['five_total_size_small'] = float(total_sizes[7]) - 1
+                            total_size_dict['tnb_5'] = float(total_sizes[5]) - 1
+                            total_size_dict['tns_5'] = float(total_sizes[7]) - 1
                         else:
-                            total_size_dict['five_total_size_big'] = total_sizes[5]
-                            total_size_dict['five_total_size_small'] = total_sizes[7]
+                            total_size_dict['tnb_5'] = total_sizes[5]
+                            total_size_dict['tns_5'] = total_sizes[7]
                     except:
-                        total_size_dict_rule['five_total_size_big'] = ""
-                        total_size_dict['five_total_size_big'] = ""
-                        total_size_dict_rule['five_total_size_small'] = ""
-                        total_size_dict['five_total_size_small'] = ""
+                        total_size_dict_rule['tnb_5'] = ""
+                        total_size_dict['tnb_5'] = ""
+                        total_size_dict_rule['tns_5'] = ""
+                        total_size_dict['tns_5'] = ""
 
                     # ------------------------------------------------------总得分:单/双-----------------------------------------------------
                     odd_evens_dict = {}
@@ -187,20 +187,20 @@ class BqrangqiuSpider(scrapy.Spider):
                     try:
                         odd_evens = result['o']["oe"]["v"]
                         # 上半场 主队让球条件
-                        odd_evens_dict_rule['two_sides_single'] = "单"
-                        odd_evens_dict_rule['two_sides_double'] = "双"
+                        odd_evens_dict_rule['tss'] = "单"
+                        odd_evens_dict_rule['tsd'] = "双"
                         if pt is 3:
-                            odd_evens_dict['two_sides_single'] = float(odd_evens[1]) - 1
-                            odd_evens_dict['two_sides_double'] = float(odd_evens[3]) - 1
+                            odd_evens_dict['tss'] = float(odd_evens[1]) - 1
+                            odd_evens_dict['tsd'] = float(odd_evens[3]) - 1
                         else:
-                            odd_evens_dict['two_sides_single'] = odd_evens[1]
-                            odd_evens_dict['two_sides_double'] = odd_evens[3]
+                            odd_evens_dict['tss'] = odd_evens[1]
+                            odd_evens_dict['tsd'] = odd_evens[3]
 
                     except:
-                        odd_evens_dict['two_sides_single'] = ""
-                        odd_evens_dict['two_sides_double'] = ""
-                        odd_evens_dict_rule['two_sides_single'] = ""
-                        odd_evens_dict_rule['two_sides_double'] = ""
+                        odd_evens_dict['tss'] = ""
+                        odd_evens_dict['tsd'] = ""
+                        odd_evens_dict_rule['tss'] = ""
+                        odd_evens_dict_rule['tsd'] = ""
                     # 联赛id
                     item['league_id'] = league_id
                     # 联赛名
@@ -240,52 +240,52 @@ class BqrangqiuSpider(scrapy.Spider):
                     item['odd_evens_dict'] = odd_evens_dict
                     item['odd_evens_dict_rule'] = odd_evens_dict_rule
                     item['bangqiu'] = bangqiu
-                    # yield item
+                    yield item
 
-                if result['pci']['ctid'] is 208:
-                    """球队得分大/小  主队"""
-                    team_score_home_dict = {}
-                    team_score_home_rule_dict = {}
-                    try:
-                        team_score_home = result['o']['ou']['v']
-                        team_score_home_rule_dict['team_score_big'] = team_score_home[1]
-                        team_score_home_rule_dict['team_score_small'] = team_score_home[3]
-                        if pt is 3:
-                            team_score_home_dict['team_score_big'] = float(team_score_home[5]) - 1
-                            team_score_home_dict['team_score_small'] = float(team_score_home[7]) - 1
-                        else:
-                            team_score_home_dict['team_score_big'] = team_score_home[5]
-                            team_score_home_dict['team_score_small'] = team_score_home[7]
-                    except:
-                        team_score_home_dict['team_score_big'] = ''
-                        team_score_home_rule_dict['team_score_big'] = ''
-                        team_score_home_dict['team_score_small'] = ''
-                        team_score_home_rule_dict['team_score_small'] = ''
-                    # 球队得分大/小  主队
-                    item['team_score_home_dict'] = team_score_home_dict
-                    item['team_score_home_rule_dict'] = team_score_home_rule_dict
-
-                if result['pci']['ctid'] is 209:
-                    """球队得分大/小  客队"""
-                    team_score_guest_dict = {}
-                    team_score_guest_rule_dict = {}
-                    try:
-                        team_score_guest = result['o']['ou']['v']
-                        team_score_guest_rule_dict['team_score_big'] = team_score_guest[1]
-                        team_score_guest_rule_dict['team_score_small'] = team_score_guest[3]
-                        if pt is 3:
-                            team_score_guest_dict['team_score_big'] = float(team_score_guest[5]) - 1
-                            team_score_guest_dict['team_score_small'] = float(team_score_guest[7]) - 1
-                        else:
-                            team_score_guest_dict['team_score_big'] = team_score_guest[5]
-                            team_score_guest_dict['team_score_small'] = team_score_guest[7]
-                    except:
-                        team_score_guest_dict['team_score_big'] = ''
-                        team_score_guest_rule_dict['team_score_big'] = ''
-                        team_score_guest_dict['team_score_small'] = ''
-                        team_score_guest_rule_dict['team_score_small'] = ''
-                    # 球队得分大/小  客队
-                    item['team_score_guest_dict'] = team_score_guest_dict
-                    item['team_score_guest_rule_dict'] = team_score_guest_rule_dict
-
-            yield item
+            #     if result['pci']['ctid'] is 208:
+            #         """球队得分大/小  主队"""
+            #         team_score_home_dict = {}
+            #         team_score_home_rule_dict = {}
+            #         try:
+            #             team_score_home = result['o']['ou']['v']
+            #             team_score_home_rule_dict['team_score_big'] = team_score_home[1]
+            #             team_score_home_rule_dict['team_score_small'] = team_score_home[3]
+            #             if pt is 3:
+            #                 team_score_home_dict['team_score_big'] = float(team_score_home[5]) - 1
+            #                 team_score_home_dict['team_score_small'] = float(team_score_home[7]) - 1
+            #             else:
+            #                 team_score_home_dict['team_score_big'] = team_score_home[5]
+            #                 team_score_home_dict['team_score_small'] = team_score_home[7]
+            #         except:
+            #             team_score_home_dict['team_score_big'] = ''
+            #             team_score_home_rule_dict['team_score_big'] = ''
+            #             team_score_home_dict['team_score_small'] = ''
+            #             team_score_home_rule_dict['team_score_small'] = ''
+            #         # 球队得分大/小  主队
+            #         item['team_score_home_dict'] = team_score_home_dict
+            #         item['team_score_home_rule_dict'] = team_score_home_rule_dict
+            #
+            #     if result['pci']['ctid'] is 209:
+            #         """球队得分大/小  客队"""
+            #         team_score_guest_dict = {}
+            #         team_score_guest_rule_dict = {}
+            #         try:
+            #             team_score_guest = result['o']['ou']['v']
+            #             team_score_guest_rule_dict['team_score_big'] = team_score_guest[1]
+            #             team_score_guest_rule_dict['team_score_small'] = team_score_guest[3]
+            #             if pt is 3:
+            #                 team_score_guest_dict['team_score_big'] = float(team_score_guest[5]) - 1
+            #                 team_score_guest_dict['team_score_small'] = float(team_score_guest[7]) - 1
+            #             else:
+            #                 team_score_guest_dict['team_score_big'] = team_score_guest[5]
+            #                 team_score_guest_dict['team_score_small'] = team_score_guest[7]
+            #         except:
+            #             team_score_guest_dict['team_score_big'] = ''
+            #             team_score_guest_rule_dict['team_score_big'] = ''
+            #             team_score_guest_dict['team_score_small'] = ''
+            #             team_score_guest_rule_dict['team_score_small'] = ''
+            #         # 球队得分大/小  客队
+            #         item['team_score_guest_dict'] = team_score_guest_dict
+            #         item['team_score_guest_rule_dict'] = team_score_guest_rule_dict
+            #
+            # yield item

+ 0 - 69
hg3535/spiders/bq_jieshu.py

@@ -1,69 +0,0 @@
-# -*- coding: utf-8 -*-
-import datetime
-import re
-
-import scrapy
-
-from ..items import Bangjieguo
-
-
-class HgjieshuSpider(scrapy.Spider):
-    name = 'bq_jieshu'
-    to_day = datetime.datetime.now()
-    allowed_domains = ['hg3535z.com']
-    custom_settings = {
-        "ITEM_PIPELINES":{
-            'hg3535.pipeline.Bangjieshuqiupipeline': 300,
-        },
-        'LOG_LEVEL': 'DEBUG',
-        'LOG_FILE': "../hg3535/log/bq_jieshu_{}_{}_{}.log".format(to_day.year, to_day.month, to_day.day)
-    }
-    start_urls = ['https://hg3535z.com/zh-cn/info-centre/sportsbook-info/results/4/normal/1', 'https://hg3535z.com/zh-cn/info-centre/sportsbook-info/results/4/normal/2']
-
-    def parse(self, response):
-        if response.status == 200:
-            # 所有比赛对象
-            # tema = response.xpath('//div[@class="rt-event"]//span[@class="pt"]/text()')
-            # print(tema)
-            # 所有比赛队名
-            # tema_name = [i.extract() for i in tema]
-            # 获得所有比分对象
-            # tema_score = response.xpath('//div[contains(@class,"rt-ft")]')
-            tema_score = response.xpath('//div[@class="flex-wrap"]/../div[5]')
-            # 获得所有比赛id对象
-            tema_id = response.xpath('//div[@class="flex-wrap"]/../div[1]/@id')
-            # str.replace()
-            # 所有比赛id列表
-            temaid_list = [i.extract().replace('e-', "") for i in tema_id]
-            temascore_list = []
-            for score in tema_score:
-                # 正则匹配规则
-                p1 = r"\d{1,3}-\d{1,3}"
-                pattern1 = re.compile(p1)
-                try:
-                    # 获取正则匹配结果
-                    c = pattern1.findall(score.extract())[0]
-                    temascore_list.append(c)
-                except:
-                    c = ""
-                    temascore_list.append(c)
-            # print(temaid_list)
-            # print(temascore_list)
-            # print(len(temaid_list))
-            # print(len(temascore_list))
-            # 赛事id,赛事比元组列表
-            tema_tupe = {(temaid_list[i], temascore_list[i]) for i in range(len(temaid_list))}
-            print(tema_tupe)
-            print(len(tema_tupe))
-            # for y in tema_tupe:
-            #     if y[1]:
-            #         item = Bangjieguo()
-            #         item['id_score'] = y
-            #         yield item
-            id_list = []
-            item = Bangjieguo()
-            for y in tema_tupe:
-                if y[1]:
-                    id_list.append(y[0])
-            item['id_score'] = id_list
-            yield item

+ 277 - 281
hg3535/spiders/lanqiu.py

@@ -159,224 +159,224 @@ class LanqiuSpider(scrapy.Spider):
                         # 主队让球条件,主队让球赔率,客队让球条件,客队让球赔率
                         concede_home_rule, concede_home, concede_guest_rule, concede_guest = rangqiu_daxiao(
                             inner=concedes, pt=pt)
-                        concedes_dict_rule['concede_home'] = concede_home_rule
-                        concedes_dict['concede_home'] = concede_home
-                        concedes_dict_rule['concede_guest'] = concede_guest_rule
-                        concedes_dict['concede_guest'] = concede_guest
+                        concedes_dict_rule['coh'] = concede_home_rule
+                        concedes_dict['coh'] = concede_home
+                        concedes_dict_rule['cog'] = concede_guest_rule
+                        concedes_dict['cog'] = concede_guest
                     except:
                         # concede_guest = ""
                         # concede_guest_rule = ""
                         # concede_home = ""
                         # concede_home_rule = ""
-                        concedes_dict_rule['concede_home'] = None
-                        concedes_dict['concede_home'] = None
-                        concedes_dict_rule['concede_guest'] = None
-                        concedes_dict['concede_guest'] = None
+                        concedes_dict_rule['coh'] = ""
+                        concedes_dict['coh'] = ""
+                        concedes_dict_rule['cog'] = ""
+                        concedes_dict['cog'] = ""
                     # print(concedes_dict)
                     try:
                         half_concedes = result['o']["ah1st"]["v"]
                         # 上半场 主队让球条件
                         half_concede_home_rule, half_concede_home, half_concede_guest_rule, half_concede_guest = rangqiu_daxiao(
                             inner=half_concedes, pt=pt)
-                        concedes_dict_rule['half_concede_home'] = half_concede_home_rule
-                        concedes_dict['half_concede_home'] = half_concede_home
-                        concedes_dict_rule['half_concede_guest'] = half_concede_guest_rule
-                        concedes_dict['half_concede_guest'] = half_concede_guest
+                        concedes_dict_rule['coh_h'] = half_concede_home_rule
+                        concedes_dict['coh_h'] = half_concede_home
+                        concedes_dict_rule['cog_h'] = half_concede_guest_rule
+                        concedes_dict['cog_h'] = half_concede_guest
 
                     except:
                         # half_concede_home_rule = ""
                         # half_concede_home = ""
                         # half_concede_guest_rule = ""
                         # half_concede_guest = ""
-                        concedes_dict_rule['half_concede_home'] = None
-                        concedes_dict['half_concede_home'] = None
-                        concedes_dict_rule['half_concede_guest'] = None
-                        concedes_dict['half_concede_guest'] = None
+                        concedes_dict_rule['coh_h'] = ""
+                        concedes_dict['coh_h'] = ""
+                        concedes_dict_rule['cog_h'] = ""
+                        concedes_dict['cog_h'] = ""
 
                     # 第一节让球
                     try:
                         one_concedes = result['o']["ahq1"]["v"]
                         one_concede_home_rule, one_concede_home, one_concede_guest_rule, one_concede_guest = rangqiu_daxiao(
                             inner=one_concedes, pt=pt)
-                        concedes_dict_rule['one_concede_home'] = one_concede_home_rule
-                        concedes_dict['one_concede_home'] = one_concede_home
-                        concedes_dict_rule['one_concede_guest'] = one_concede_guest_rule
-                        concedes_dict['one_concede_guest'] = one_concede_guest
+                        concedes_dict_rule['coh_1'] = one_concede_home_rule
+                        concedes_dict['coh_1'] = one_concede_home
+                        concedes_dict_rule['cog_1'] = one_concede_guest_rule
+                        concedes_dict['cog_1'] = one_concede_guest
 
                     except:
                         # one_concede_guest = ""
                         # one_concede_guest_rule = ""
                         # one_concede_home = ""
                         # one_concede_home_rule = ""
-                        concedes_dict_rule['one_concede_home'] = None
-                        concedes_dict['one_concede_home'] = None
-                        concedes_dict_rule['one_concede_guest'] = None
-                        concedes_dict['one_concede_guest'] = None
+                        concedes_dict_rule['coh_1'] = ""
+                        concedes_dict['coh_1'] = ""
+                        concedes_dict_rule['cog_1'] = ""
+                        concedes_dict['cog_1'] = ""
                     # 第二节让球
                     try:
                         two_concedes = result['o']["ahq2"]["v"]
                         two_concede_home_rule, two_concede_home, two_concede_guest_rule, two_concede_guest = rangqiu_daxiao(
                             inner=two_concedes, pt=pt)
-                        concedes_dict_rule['two_concede_home'] = two_concede_home_rule
-                        concedes_dict['two_concede_home'] = two_concede_home
-                        concedes_dict_rule['two_concede_guest'] = two_concede_guest_rule
-                        concedes_dict['two_concede_guest'] = two_concede_guest
+                        concedes_dict_rule['coh_2'] = two_concede_home_rule
+                        concedes_dict['coh_2'] = two_concede_home
+                        concedes_dict_rule['cog_2'] = two_concede_guest_rule
+                        concedes_dict['cog_2'] = two_concede_guest
                     except:
                         # two_concede_guest = ""
                         # two_concede_guest_rule = ""
                         # two_concede_home = ""
                         # two_concede_home_rule = ""
-                        concedes_dict_rule['two_concede_home'] = None
-                        concedes_dict['two_concede_home'] = None
-                        concedes_dict_rule['two_concede_guest'] = None
-                        concedes_dict['two_concede_guest'] = None
+                        concedes_dict_rule['coh_2'] = ""
+                        concedes_dict['coh_2'] = ""
+                        concedes_dict_rule['cog_2'] = ""
+                        concedes_dict['cog_2'] = ""
                     # 第三节让球
                     try:
                         three_concedes = result['o']["ahq3"]["v"]
                         three_concede_home_rule, three_concede_home, three_concede_guest_rule, three_concede_guest = rangqiu_daxiao(
                             inner=three_concedes, pt=pt)
-                        concedes_dict_rule['three_concede_home'] = three_concede_home_rule
-                        concedes_dict['three_concede_home'] = three_concede_home
-                        concedes_dict_rule['three_concede_guest'] = three_concede_guest_rule
-                        concedes_dict['three_concede_guest'] = three_concede_guest
+                        concedes_dict_rule['coh_3'] = three_concede_home_rule
+                        concedes_dict['coh_3'] = three_concede_home
+                        concedes_dict_rule['cog_3'] = three_concede_guest_rule
+                        concedes_dict['cog_3'] = three_concede_guest
 
                     except:
                         # three_concede_guest = ""
                         # three_concede_guest_rule = ""
                         # three_concede_home = ""
                         # three_concede_home_rule = ""
-                        concedes_dict_rule['three_concede_home'] = None
-                        concedes_dict['three_concede_home'] = None
-                        concedes_dict_rule['three_concede_guest'] = None
-                        concedes_dict['three_concede_guest'] = None
+                        concedes_dict_rule['coh_3'] = ""
+                        concedes_dict['coh_3'] = ""
+                        concedes_dict_rule['cog_3'] = ""
+                        concedes_dict['cog_3'] = ""
                     # 第四节让球
                     try:
                         four_concedes = result['o']["ahq4"]["v"]
                         four_concede_home_rule, four_concede_home, four_concede_guest_rule, four_concede_guest = rangqiu_daxiao(
                             inner=four_concedes, pt=pt)
-                        concedes_dict_rule['four_concede_home'] = four_concede_home_rule
-                        concedes_dict['four_concede_home'] = four_concede_home
-                        concedes_dict_rule['four_concede_guest'] = four_concede_guest_rule
-                        concedes_dict['four_concede_guest'] = four_concede_guest
+                        concedes_dict_rule['coh_4'] = four_concede_home_rule
+                        concedes_dict['coh_4'] = four_concede_home
+                        concedes_dict_rule['cog_4'] = four_concede_guest_rule
+                        concedes_dict['cog_4'] = four_concede_guest
 
                     except:
                         # four_concede_guest = ""
                         # four_concede_guest_rule = ""
                         # four_concede_home = ""
                         # four_concede_home_rule = ""
-                        concedes_dict_rule['four_concede_home'] = None
-                        concedes_dict['four_concede_home'] = None
-                        concedes_dict_rule['four_concede_guest'] = None
-                        concedes_dict['four_concede_guest'] = None
-                    # ----------------------------------------总分大小分割线 - ---------------------------------------------------------------
+                        concedes_dict_rule['coh_4'] = ""
+                        concedes_dict['coh_4'] = ""
+                        concedes_dict_rule['cog_4'] = ""
+                        concedes_dict['cog_4'] = ""
+                    # ----------------------------------------总分大小分割线 ----------------------------------------------------------------
                     # 全场总分大小
                     try:
                         total_sizes = result['o']["ou"]["v"]
                         total_sizes_big_rule, total_sizes_big, total_sizes_small_rule, total_sizes_small = rangqiu_daxiao(
                             inner=total_sizes, pt=pt)
-                        total_sizes_dict_rule["total_size_big"] = total_sizes_big_rule
-                        total_sizes_dict["total_size_big"] = total_sizes_big
-                        total_sizes_dict_rule["total_size_small"] = total_sizes_small_rule
-                        total_sizes_dict["total_size_small"] = total_sizes_small
+                        total_sizes_dict_rule["tnb"] = total_sizes_big_rule
+                        total_sizes_dict["tnb"] = total_sizes_big
+                        total_sizes_dict_rule["tns"] = total_sizes_small_rule
+                        total_sizes_dict["tns"] = total_sizes_small
                     except:
                         # total_sizes_big_rule = ""
                         # total_sizes_big = ""
                         # total_sizes_small_rule = ""
                         # total_sizes_small = ""
-                        total_sizes_dict_rule["total_size_big"] = None
-                        total_sizes_dict["total_size_big"] = None
-                        total_sizes_dict_rule["total_size_small"] = None
-                        total_sizes_dict["total_size_small"] = None
+                        total_sizes_dict_rule["tnb"] = ""
+                        total_sizes_dict["tnb"] = ""
+                        total_sizes_dict_rule["tns"] = ""
+                        total_sizes_dict["tns"] = ""
                     # 上半场总分大小
                     try:
                         half_total_sizes = result['o']["ou1st"]["v"]
                         half_total_sizes_big_rule, half_total_sizes_big, half_total_sizes_small_rule, half_total_sizes_small = rangqiu_daxiao(
                             inner=half_total_sizes, pt=pt)
-                        total_sizes_dict_rule["half_total_size_big"] = half_total_sizes_big_rule
-                        total_sizes_dict["half_total_size_big"] = half_total_sizes_big
-                        total_sizes_dict_rule["half_total_size_small"] = half_total_sizes_small_rule
-                        total_sizes_dict["half_total_size_small"] = half_total_sizes_small
+                        total_sizes_dict_rule["tnb_h"] = half_total_sizes_big_rule
+                        total_sizes_dict["tnb_h"] = half_total_sizes_big
+                        total_sizes_dict_rule["tns_h"] = half_total_sizes_small_rule
+                        total_sizes_dict["tns_h"] = half_total_sizes_small
                     except:
                         # half_total_sizes_big_rule = ""
                         # half_total_sizes_big = ""
                         # half_total_sizes_small_rule = ""
                         # half_total_sizes_small = ""
-                        total_sizes_dict_rule["half_total_size_big"] = None
-                        total_sizes_dict["half_total_size_big"] = None
-                        total_sizes_dict_rule["half_total_size_small"] = None
-                        total_sizes_dict["half_total_size_small"] = None
+                        total_sizes_dict_rule["tnb_h"] = ""
+                        total_sizes_dict["tnb_h"] = ""
+                        total_sizes_dict_rule["tns_h"] = ""
+                        total_sizes_dict["tns_h"] = ""
                     # 第一节总分大小
                     try:
                         one_total_sizes = result['o']["ou1st"]["v"]
                         one_total_sizes_big_rule, one_total_size_big, one_total_sizes_small_rule, one_total_sizes_small = rangqiu_daxiao(
                             inner=one_total_sizes, pt=pt)
-                        total_sizes_dict_rule["one_total_size_big"] = one_total_sizes_big_rule
-                        total_sizes_dict["one_total_size_big"] = one_total_size_big
-                        total_sizes_dict_rule["one_total_size_small"] = one_total_sizes_small_rule
-                        total_sizes_dict["one_total_size_small"] = one_total_sizes_small
+                        total_sizes_dict_rule["tnb_1"] = one_total_sizes_big_rule
+                        total_sizes_dict["tnb_1"] = one_total_size_big
+                        total_sizes_dict_rule["tns_1"] = one_total_sizes_small_rule
+                        total_sizes_dict["tns_1"] = one_total_sizes_small
                     except:
                         # one_total_sizes_big_rule = ""
                         # one_total_sizes_big = ""
                         # one_total_sizes_small_rule = ""
                         # one_total_sizes_small = ""
-                        total_sizes_dict_rule["one_total_size_big"] = None
-                        total_sizes_dict["one_total_size_big"] = None
-                        total_sizes_dict_rule["one_total_size_small"] = None
-                        total_sizes_dict["one_total_size_small"] = None
+                        total_sizes_dict_rule["tnb_1"] = ""
+                        total_sizes_dict["tnb_1"] = ""
+                        total_sizes_dict_rule["tns_1"] = ""
+                        total_sizes_dict["tns_1"] = ""
                     # 第二节场总分大小
                     try:
                         two_total_sizes = result['o']["ou1st"]["v"]
                         two_total_sizes_big_rule, two_total_sizes_big, two_total_sizes_small_rule, two_total_sizes_small = rangqiu_daxiao(
                             inner=two_total_sizes, pt=pt)
-                        total_sizes_dict_rule["two_total_size_big"] = two_total_sizes_big_rule
-                        total_sizes_dict["two_total_size_big"] = two_total_sizes_big
-                        total_sizes_dict_rule["two_total_size_small"] = two_total_sizes_small_rule
-                        total_sizes_dict["two_total_size_small"] = two_total_sizes_small
+                        total_sizes_dict_rule["tnb_2"] = two_total_sizes_big_rule
+                        total_sizes_dict["tnb_2"] = two_total_sizes_big
+                        total_sizes_dict_rule["tns_2"] = two_total_sizes_small_rule
+                        total_sizes_dict["tns_2"] = two_total_sizes_small
                     except:
                         # two_total_sizes_big_rule = ""
                         # two_total_sizes_big = ""
                         # two_total_sizes_small_rule = ""
                         # two_total_sizes_small = ""
-                        total_sizes_dict_rule["two_total_size_big"] = None
-                        total_sizes_dict["two_total_size_big"] = None
-                        total_sizes_dict_rule["two_total_size_small"] = None
-                        total_sizes_dict["two_total_size_small"] = None
+                        total_sizes_dict_rule["tnb_2"] = ""
+                        total_sizes_dict["tnb_2"] = ""
+                        total_sizes_dict_rule["tns_2"] = ""
+                        total_sizes_dict["tns_2"] = ""
                     # 第三节总分大小
                     try:
                         three_total_sizes = result['o']["ou1st"]["v"]
                         three_total_sizes_big_rule, three_total_sizes_big, three_total_sizes_small_rule, three_total_sizes_small = rangqiu_daxiao(
                             inner=three_total_sizes, pt=pt)
-                        total_sizes_dict_rule["three_total_size_big"] = three_total_sizes_big_rule
-                        total_sizes_dict["three_total_size_big"] = three_total_sizes_big
-                        total_sizes_dict_rule["three_total_size_small"] = three_total_sizes_small_rule
-                        total_sizes_dict["three_total_size_small"] = three_total_sizes_small
+                        total_sizes_dict_rule["tnb_3"] = three_total_sizes_big_rule
+                        total_sizes_dict["tnb_3"] = three_total_sizes_big
+                        total_sizes_dict_rule["tns_3"] = three_total_sizes_small_rule
+                        total_sizes_dict["tns_3"] = three_total_sizes_small
                     except:
                         # three_total_sizes_big_rule = ""
                         # three_total_sizes_big = ""
                         # three_total_sizes_small_rule = ""
                         # three_total_sizes_small = ""
-                        total_sizes_dict_rule["three_total_size_big"] = None
-                        total_sizes_dict["three_total_size_big"] = None
-                        total_sizes_dict_rule["three_total_size_small"] = None
-                        total_sizes_dict["three_total_size_small"] = None
+                        total_sizes_dict_rule["tnb_3"] = ""
+                        total_sizes_dict["tnb_3"] = ""
+                        total_sizes_dict_rule["tns_3"] = ""
+                        total_sizes_dict["tns_3"] = ""
                     # 第四节总分大小
                     try:
                         four_total_sizes = result['o']["ou1st"]["v"]
                         four_total_sizes_big_rule, four_total_sizes_big, four_total_sizes_small_rule, four_total_sizes_small = rangqiu_daxiao(
                             inner=four_total_sizes, pt=pt)
-                        total_sizes_dict_rule["four_total_size_big"] = four_total_sizes_big_rule
-                        total_sizes_dict["four_total_size_big"] = four_total_sizes_big
-                        total_sizes_dict_rule["four_total_size_small"] = four_total_sizes_small_rule
-                        total_sizes_dict["four_total_size_small"] = four_total_sizes_small
+                        total_sizes_dict_rule["tnb_4"] = four_total_sizes_big_rule
+                        total_sizes_dict["tnb_4"] = four_total_sizes_big
+                        total_sizes_dict_rule["tns_4"] = four_total_sizes_small_rule
+                        total_sizes_dict["tns_4"] = four_total_sizes_small
                     except:
                         # four_total_sizes_big_rule = ""
                         # four_total_sizes_big = ""
                         # four_total_sizes_small_rule = ""
                         # four_total_sizes_small = ""
-                        total_sizes_dict_rule["four_total_size_big"] = None
-                        total_sizes_dict["four_total_size_big"] = None
-                        total_sizes_dict_rule["four_total_size_small"] = None
-                        total_sizes_dict["four_total_size_small"] = None
+                        total_sizes_dict_rule["tnb_4"] = ""
+                        total_sizes_dict["tnb_4"] = ""
+                        total_sizes_dict_rule["tns_4"] = ""
+                        total_sizes_dict["tns_4"] = ""
 
                     # ----------------------------------------总分单双分割线------------------------------------------------------------------
                     # 全场 总分单双
@@ -384,104 +384,100 @@ class LanqiuSpider(scrapy.Spider):
                         odd_evens = result['o']["oe"]["v"]
                         # # 全场 总分单, 全场 总分双
                         # odd_even_odd, odd_even_even = danshaung_fun(inner=odd_evens)
-                        odd_evens_dict["two_sides_single"] = odd_evens[1]
-                        odd_evens_dict_rule['two_sides_single'] = '单'
-                        odd_evens_dict["two_sides_double"] = odd_evens[3]
-                        odd_evens_dict_rule['two_sides_double'] = '双'
+                        odd_evens_dict["tss"] = odd_evens[1]
+                        odd_evens_dict_rule['tss'] = '单'
+                        odd_evens_dict["tsd"] = odd_evens[3]
+                        odd_evens_dict_rule['tsd'] = '双'
                     except:
                         # odd_even_odd = ""
                         # odd_even_even = ""
-                        odd_evens_dict["two_sides_single"] = None
-                        odd_evens_dict_rule['two_sides_single'] = '单'
-                        odd_evens_dict["two_sides_double"] = None
-                        odd_evens_dict_rule['two_sides_double'] = '双'
+                        odd_evens_dict["tss"] = ""
+                        odd_evens_dict_rule['tss'] = '单'
+                        odd_evens_dict["tsd"] = ""
+                        odd_evens_dict_rule['tsd'] = '双'
                     # 上半场全场 总分单双
-
                     try:
                         half_odd_evens = result['o']["oe1st"]["v"]
                         # 上半场 总分单, 上半场 总分双
                         # half_odd_even_odd,half_odd_even_even = danshaung_fun(inner=half_odd_evens)
-                        odd_evens_dict["two_sides_single"] = half_odd_evens[1]
-                        odd_evens_dict_rule['two_sides_single'] = '单'
-                        odd_evens_dict["two_sides_double"] = half_odd_evens[3]
-                        odd_evens_dict_rule['two_sides_double'] = '双'
+                        odd_evens_dict["tss_h"] = half_odd_evens[1]
+                        odd_evens_dict_rule['tss_h'] = '单'
+                        odd_evens_dict["tsd_h"] = half_odd_evens[3]
+                        odd_evens_dict_rule['tsd_h'] = '双'
                     except:
                         # half_odd_even_odd = ""
                         # half_odd_even_even = ""
-                        odd_evens_dict["half_two_sides_single"] = None
-                        odd_evens_dict_rule['half_two_sides_single'] = '单'
-                        odd_evens_dict["half_two_sides_double"] = None
-                        odd_evens_dict_rule['half_two_sides_double'] = '双'
+                        odd_evens_dict["tss_h"] = ""
+                        odd_evens_dict_rule['tss_h'] = '单'
+                        odd_evens_dict["tsd_h"] = ""
+                        odd_evens_dict_rule['tsd_h'] = '双'
 
                     # 总分:单/双-第一节
                     try:
                         one_odd_evens = result['o']["oeq1"]["v"]
                         # one_odd_even_odd,one_odd_even_even = danshaung_fun(inner=one_odd_evens)
-                        odd_evens_dict["one_two_sides_single"] = one_odd_evens[1]
-                        odd_evens_dict_rule['one_two_sides_single'] = '单'
-                        odd_evens_dict["one_two_sides_double"] = one_odd_evens[3]
-                        odd_evens_dict_rule['one_two_sides_double'] = '双'
+                        odd_evens_dict["tss_1"] = one_odd_evens[1]
+                        odd_evens_dict_rule['tss_1'] = '单'
+                        odd_evens_dict["tsd_1"] = one_odd_evens[3]
+                        odd_evens_dict_rule['tsd_1'] = '双'
                     except:
                         # one_odd_even_odd = ""
                         # one_odd_even_even = ""
-                        odd_evens_dict["one_two_sides_single"] = None
-                        odd_evens_dict_rule['one_two_sides_single'] = '单'
-                        odd_evens_dict["one_two_sides_double"] = None
-                        odd_evens_dict_rule['one_two_sides_double'] = '双'
+                        odd_evens_dict["tss_1"] = ""
+                        odd_evens_dict_rule['tss_1'] = '单'
+                        odd_evens_dict["tsd_1"] = ""
+                        odd_evens_dict_rule['tsd_1'] = '双'
 
                     # 总分:单/双-第二节
                     try:
                         two_odd_evens = result['o']["oeq2"]["v"]
                         # two_odd_even_odd,two_odd_even_even = danshaung_fun(inner=two_odd_evens)
-                        odd_evens_dict["two_two_sides_single"] = two_odd_evens[1]
-                        odd_evens_dict_rule['two_two_sides_single'] = '单'
-                        odd_evens_dict["two_two_sides_double"] = two_odd_evens[3]
-                        odd_evens_dict_rule['two_two_sides_double'] = '双'
+                        odd_evens_dict["tss_2"] = two_odd_evens[1]
+                        odd_evens_dict_rule['tss_2'] = '单'
+                        odd_evens_dict["tsd_2"] = two_odd_evens[3]
+                        odd_evens_dict_rule['tsd_2'] = '双'
                     except:
                         # two_odd_even_odd = ""
                         # two_odd_even_even = ""
-                        odd_evens_dict["two_two_sides_single"] = None
-                        odd_evens_dict_rule['two_two_sides_single'] = '单'
-                        odd_evens_dict["two_two_sides_double"] = None
-                        odd_evens_dict_rule['two_two_sides_double'] = '双'
+                        odd_evens_dict["tss_2"] = ""
+                        odd_evens_dict_rule['tss_2'] = '单'
+                        odd_evens_dict["tsd_2"] = ""
+                        odd_evens_dict_rule['tsd_2'] = '双'
 
                     # 总分:单/双-第三节
                     try:
                         three_odd_evens = result['o']["oeq3"]["v"]
                         # three_odd_even_odd,three_odd_even_even = danshaung_fun(inner=three_odd_evens)
-                        odd_evens_dict["three_two_sides_single"] = three_odd_evens[1]
-                        odd_evens_dict_rule['three_two_sides_single'] = '单'
-                        odd_evens_dict["three_two_sides_double"] = three_odd_evens[3]
-                        odd_evens_dict_rule['three_two_sides_double'] = '双'
-
-
+                        odd_evens_dict["tss_3"] = three_odd_evens[1]
+                        odd_evens_dict_rule['tss_3'] = '单'
+                        odd_evens_dict["tsd_3"] = three_odd_evens[3]
+                        odd_evens_dict_rule['tsd_3'] = '双'
                     except:
                         # three_odd_even_odd = ""
                         # three_odd_even_even = ""
-                        odd_evens_dict["three_two_sides_single"] = None
-                        odd_evens_dict_rule['three_two_sides_single'] = '单'
-                        odd_evens_dict["three_two_sides_double"] = None
-                        odd_evens_dict_rule['three_two_sides_double'] = '双'
+                        odd_evens_dict["tss_3"] = ""
+                        odd_evens_dict_rule['tss_3'] = '单'
+                        odd_evens_dict["tsd_3"] = ""
+                        odd_evens_dict_rule['tsd_3'] = '双'
 
                     # 总分:单/双-第四节
                     try:
                         four_odd_evens = result['o']["oeq4"]["v"]
                         # four_odd_even_odd,four_odd_even_even = danshaung_fun(inner=four_odd_evens)
-                        odd_evens_dict["four_two_sides_single"] = four_odd_evens[1]
-                        odd_evens_dict_rule['four_two_sides_single'] = '单'
-                        odd_evens_dict["four_two_sides_double"] = four_odd_evens[3]
-                        odd_evens_dict_rule['four_two_sides_double'] = '双'
+                        odd_evens_dict["tss_4"] = four_odd_evens[1]
+                        odd_evens_dict_rule['tss_4'] = '单'
+                        odd_evens_dict["tsd_4"] = four_odd_evens[3]
+                        odd_evens_dict_rule['tsd_4'] = '双'
                     except:
                         # four_odd_even_odd = ""
                         # four_odd_even_even = ""
-                        odd_evens_dict["four_two_sides_single"] = None
-                        odd_evens_dict_rule['four_two_sides_single'] = '单'
-                        odd_evens_dict["four_two_sides_double"] = None
-                        odd_evens_dict_rule['four_two_sides_double'] = '双'
+                        odd_evens_dict["tss_4"] = ""
+                        odd_evens_dict_rule['tss_4'] = '单'
+                        odd_evens_dict["tsd_4"] = ""
+                        odd_evens_dict_rule['tsd_4'] = '双'
 
                     # ----------------------------------------球队得分最后一位数分割线---------------------------------------------------------
                     # 球队得分最后一位数 主队
-
                     try:
                         last_numbers = result["p-o"][0]['o']
                         last_home = {last_numbers[0][0]: last_numbers[0][2], last_numbers[1][0]: last_numbers[1][2],
@@ -515,13 +511,13 @@ class LanqiuSpider(scrapy.Spider):
                         capot_list = [capots[i] for i in range(len(capots)) if i % 2 == 1]
                         capot_home = capot_list[0]
                         capot_guest = capot_list[1]
-                        capots_dict["capot_home"] = capot_home
-                        capots_dict["capot_guest"] = capot_guest
+                        capots_dict["ch"] = capot_home
+                        capots_dict["cg"] = capot_guest
                     except:
                         # capot_home = ""
                         # capot_guest = ""
-                        capots_dict["capot_home"] = None
-                        capots_dict["capot_guest"] = None
+                        capots_dict["ch"] = ""
+                        capots_dict["cg"] = ""
 
                     # 上半场独赢
                     try:
@@ -529,13 +525,13 @@ class LanqiuSpider(scrapy.Spider):
                         half_capot_list = [half_capots[i] for i in range(len(half_capots)) if i % 2 == 1]
                         half_capot_home = half_capot_list[0]
                         half_capot_guest = half_capot_list[1]
-                        capots_dict["half_capot_home"] = half_capot_home
-                        capots_dict["half_capot_guest"] = half_capot_guest
+                        capots_dict["ch_h"] = half_capot_home
+                        capots_dict["cg_h"] = half_capot_guest
                     except:
                         # half_capot_home = ""
                         # half_capot_guest = ""
-                        capots_dict["half_capot_home"] = None
-                        capots_dict["half_capot_guest"] = None
+                        capots_dict["ch_h"] = ""
+                        capots_dict["cg_h"] = ""
 
                     # 第一节独赢
                     try:
@@ -543,13 +539,13 @@ class LanqiuSpider(scrapy.Spider):
                         one_capot_list = [one_capots[i] for i in range(len(one_capots)) if i % 2 == 1]
                         one_capot_home = one_capot_list[0]
                         one_capot_guest = one_capot_list[1]
-                        capots_dict["one_capot_home"] = one_capot_home
-                        capots_dict["one_capot_guest"] = one_capot_guest
+                        capots_dict["ch_1"] = one_capot_home
+                        capots_dict["cg_1"] = one_capot_guest
                     except:
                         # one_capot_home = ""
                         # one_capot_guest = ""
-                        capots_dict["one_capot_home"] = None
-                        capots_dict["one_capot_guest"] = None
+                        capots_dict["ch_1"] = ""
+                        capots_dict["cg_1"] = ""
 
                     # 第二节独赢
                     try:
@@ -557,13 +553,13 @@ class LanqiuSpider(scrapy.Spider):
                         two_capot_list = [two_capots[i] for i in range(len(two_capots)) if i % 2 == 1]
                         two_capot_home = two_capot_list[0]
                         two_capot_guest = two_capot_list[1]
-                        capots_dict["two_capot_home"] = two_capot_home
-                        capots_dict["two_capot_guest"] = two_capot_guest
+                        capots_dict["ch_2"] = two_capot_home
+                        capots_dict["cg_2"] = two_capot_guest
                     except:
                         # two_capot_home = ""
                         # two_capot_guest = ""
-                        capots_dict["two_capot_home"] = None
-                        capots_dict["two_capot_guest"] = None
+                        capots_dict["ch_2"] = ""
+                        capots_dict["cg_2"] = ""
 
                     # 第三节独赢
                     try:
@@ -571,13 +567,13 @@ class LanqiuSpider(scrapy.Spider):
                         three_capot_list = [three_capots[i] for i in range(len(three_capots)) if i % 2 == 1]
                         three_capot_home = three_capot_list[0]
                         three_capot_guest = three_capot_list[1]
-                        capots_dict["three_capot_home"] = three_capot_home
-                        capots_dict["three_capot_guest"] = three_capot_guest
+                        capots_dict["ch_3"] = three_capot_home
+                        capots_dict["cg_3"] = three_capot_guest
                     except:
                         # three_capot_home = ""
                         # three_capot_guest = ""
-                        capots_dict["three_capot_home"] = None
-                        capots_dict["three_capot_guest"] = None
+                        capots_dict["ch_3"] = ""
+                        capots_dict["cg_3"] = ""
 
                     # 第四节独赢
                     try:
@@ -585,13 +581,13 @@ class LanqiuSpider(scrapy.Spider):
                         four_capot_list = [four_capots[i] for i in range(len(four_capots)) if i % 2 == 1]
                         four_capot_home = four_capot_list[0]
                         four_capot_guest = four_capot_list[1]
-                        capots_dict["four_capot_home"] = four_capot_home
-                        capots_dict["four_capot_guest"] = four_capot_guest
+                        capots_dict["ch_4"] = four_capot_home
+                        capots_dict["cg_4"] = four_capot_guest
                     except:
                         # four_capot_home = ""
                         # four_capot_guest = ""
-                        capots_dict["four_capot_home"] = None
-                        capots_dict["four_capot_guest"] = None
+                        capots_dict["ch_4"] = ""
+                        capots_dict["cg_4"] = ""
 
                 # ---------------------------------------------------华丽分割线列表es[1]--------------------------------------------------
                 # 球队得分 全场主队 home
@@ -606,114 +602,114 @@ class LanqiuSpider(scrapy.Spider):
                             score_homes = score_home["o"]["ou"]['v']
                             score_home_big_rule, score_home_big, score_home_small_rule, score_home_small = rangqiu_daxiao(
                                 inner=score_homes)
-                            team_scores_dict_rule["score_home_big"] = score_home_big_rule
-                            team_scores_dict["score_home_big"] = score_home_big
-                            team_scores_dict_rule["score_home_small"] = score_home_small_rule
-                            team_scores_dict["score_home_small"] = score_home_small
+                            team_scores_dict_rule["tbhb"] = score_home_big_rule
+                            team_scores_dict["tbhb"] = score_home_big
+                            team_scores_dict_rule["tbhs"] = score_home_small_rule
+                            team_scores_dict["tbhs"] = score_home_small
                         except:
                             # score_home_small = ""
                             # score_home_small_rule = ""
                             # score_home_big_rule = ""
                             # score_home_big = ""
-                            team_scores_dict_rule["score_home_big"] = None
-                            team_scores_dict["score_home_big"] = None
-                            team_scores_dict_rule["score_home_small"] = None
-                            team_scores_dict["score_home_small"] = None
+                            team_scores_dict_rule["tbhb"] = ""
+                            team_scores_dict["tbhb"] = ""
+                            team_scores_dict_rule["tbhs"] = ""
+                            team_scores_dict["tbhs"] = ""
                         # 球队得分 上半场主队 home
                         try:
                             half_score_homes = score_home['o']['ou1st']['v']
                             # 球队得分 上半场主队 大条件
                             half_score_home_big_rule, half_score_home_big, half_score_home_small_rule, half_score_home_small = rangqiu_daxiao(
                                 inner=half_score_homes)
-                            team_scores_dict_rule["half_score_home_big"] = half_score_home_big_rule
-                            team_scores_dict["half_score_home_big"] = half_score_home_big
-                            team_scores_dict_rule["half_score_home_small"] = half_score_home_small_rule
-                            team_scores_dict["half_score_home_small"] = half_score_home_small
+                            team_scores_dict_rule["tbhb_h"] = half_score_home_big_rule
+                            team_scores_dict["tbhb_h"] = half_score_home_big
+                            team_scores_dict_rule["tbhs_h"] = half_score_home_small_rule
+                            team_scores_dict["tbhs_h"] = half_score_home_small
                         except:
                             # half_score_home_small = ""
                             # half_score_home_small_rule = ""
                             # half_score_home_big = ""
                             # half_score_home_big_rule = ""
-                            team_scores_dict_rule["half_score_home_big"] = None
-                            team_scores_dict["half_score_home_big"] = None
-                            team_scores_dict_rule["half_score_home_small"] = None
-                            team_scores_dict["half_score_home_small"] = None
+                            team_scores_dict_rule["tbhb_h"] = ""
+                            team_scores_dict["tbhb_h"] = ""
+                            team_scores_dict_rule["tbhs_h"] = ""
+                            team_scores_dict["tbhs_h"] = ""
 
                         # 球队得分:主队-大 / 小-第一节
                         try:
                             one_score_homes = score_home['o']["ouq1"]["v"]
                             one_score_home_big_rule, one_score_home_big, one_score_home_small_rule, one_score_home_small = rangqiu_daxiao(
                                 inner=one_score_homes)
-                            team_scores_dict_rule["one_score_home_big"] = one_score_home_big_rule
-                            team_scores_dict["one_score_home_big"] = one_score_home_big
-                            team_scores_dict_rule["one_score_home_small"] = one_score_home_small_rule
-                            team_scores_dict["one_score_home_small"] = one_score_home_small
+                            team_scores_dict_rule["tbhb_1"] = one_score_home_big_rule
+                            team_scores_dict["tbhb_1"] = one_score_home_big
+                            team_scores_dict_rule["tbhs_1"] = one_score_home_small_rule
+                            team_scores_dict["tbhs_1"] = one_score_home_small
                         except:
                             # one_score_home_small = ""
                             # one_score_home_small_rule = ""
                             # one_score_home_big = ""
                             # one_score_home_big_rule = ""
-                            team_scores_dict_rule["one_score_home_big"] = None
-                            team_scores_dict["one_score_home_big"] = None
-                            team_scores_dict_rule["one_score_home_small"] = None
-                            team_scores_dict["one_score_home_small"] = None
+                            team_scores_dict_rule["tbhb_1"] = ""
+                            team_scores_dict["tbhb_1"] = ""
+                            team_scores_dict_rule["tbhs_1"] = ""
+                            team_scores_dict["tbhs_1"] = ""
 
                         # 球队得分:主队-大 / 小-第一节
                         try:
                             two_score_homes = score_home['o']["ouq2"]["v"]
                             two_score_home_big_rule, two_score_home_big, two_score_home_small_rule, two_score_home_small = rangqiu_daxiao(
                                 inner=two_score_homes)
-                            team_scores_dict_rule["two_score_home_big"] = two_score_home_big_rule
-                            team_scores_dict["two_score_home_big"] = two_score_home_big
-                            team_scores_dict_rule["two_score_home_small"] = two_score_home_small_rule
-                            team_scores_dict["two_score_home_small"] = two_score_home_small
+                            team_scores_dict_rule["tbhb_2"] = two_score_home_big_rule
+                            team_scores_dict["tbhb_2"] = two_score_home_big
+                            team_scores_dict_rule["tbhs_2"] = two_score_home_small_rule
+                            team_scores_dict["tbhs_2"] = two_score_home_small
                         except:
                             # two_score_home_small = ""
                             # two_score_home_small_rule = ""
                             # two_score_home_big = ""
                             # two_score_home_big_rule = ""
-                            team_scores_dict_rule["two_score_home_big"] = None
-                            team_scores_dict["two_score_home_big"] = None
-                            team_scores_dict_rule["two_score_home_small"] = None
-                            team_scores_dict["two_score_home_small"] = None
+                            team_scores_dict_rule["tbhb_2"] = ""
+                            team_scores_dict["tbhb_2"] = ""
+                            team_scores_dict_rule["tbhs_2"] = ""
+                            team_scores_dict["tbhs_2"] = ""
 
                         # 球队得分:主队-大 / 小-第一节
                         try:
                             three_score_homes = score_home['o']["ouq3"]["v"]
                             three_score_home_big_rule, three_score_home_big, three_score_home_small_rule, three_score_home_small = rangqiu_daxiao(
                                 inner=three_score_homes)
-                            team_scores_dict_rule["three_score_home_big"] = three_score_home_big_rule
-                            team_scores_dict["three_score_home_big"] = three_score_home_big
-                            team_scores_dict_rule["three_score_home_small"] = three_score_home_small_rule
-                            team_scores_dict["three_score_home_small"] = three_score_home_small
+                            team_scores_dict_rule["tbhb_3"] = three_score_home_big_rule
+                            team_scores_dict["tbhb_3"] = three_score_home_big
+                            team_scores_dict_rule["tbhs_3"] = three_score_home_small_rule
+                            team_scores_dict["ybhs_3"] = three_score_home_small
                         except:
                             # three_score_home_small = ""
                             # three_score_home_small_rule = ""
                             # three_score_home_big = ""
                             # three_score_home_big_rule = ""
-                            team_scores_dict_rule["three_score_home_big"] = None
-                            team_scores_dict["three_score_home_big"] = None
-                            team_scores_dict_rule["three_score_home_small"] = None
-                            team_scores_dict["three_score_home_small"] = None
+                            team_scores_dict_rule["tbhb_3"] = ""
+                            team_scores_dict["tbhb_3"] = ""
+                            team_scores_dict_rule["tbhs_3"] = ""
+                            team_scores_dict["tbhs_3"] = ""
 
                         # 球队得分:主队-大 / 小-第四节
                         try:
                             four_score_homes = score_home['o']["ouq4"]["v"]
                             four_score_home_big_rule, four_score_home_big, four_score_home_small_rule, four_score_home_small = rangqiu_daxiao(
                                 inner=four_score_homes)
-                            team_scores_dict_rule["four_score_home_big"] = four_score_home_big_rule
-                            team_scores_dict["four_score_home_big"] = four_score_home_big
-                            team_scores_dict_rule["four_score_home_small"] = four_score_home_small_rule
-                            team_scores_dict["four_score_home_small"] = four_score_home_small
+                            team_scores_dict_rule["tbhb_4"] = four_score_home_big_rule
+                            team_scores_dict["tbhb_4"] = four_score_home_big
+                            team_scores_dict_rule["tbhs_4"] = four_score_home_small_rule
+                            team_scores_dict["tbhs_4"] = four_score_home_small
                         except:
                             # four_score_home_small = ""
                             # four_score_home_small_rule = ""
                             # four_score_home_big = ""
                             # four_score_home_big_rule = ""
-                            team_scores_dict_rule["four_score_home_big"] = None
-                            team_scores_dict["four_score_home_big"] = None
-                            team_scores_dict_rule["four_score_home_small"] = None
-                            team_scores_dict["four_score_home_small"] = None
+                            team_scores_dict_rule["tbhb_4"] = ""
+                            team_scores_dict["tbhb_4"] = ""
+                            team_scores_dict_rule["tbhs_4"] = ""
+                            team_scores_dict["tbhs_4"] = ""
 
                 # ---------------------------------------------------华丽分割线列表es[2]--------------------------------------------------
                 # 球队得分 客队 guest
@@ -728,99 +724,99 @@ class LanqiuSpider(scrapy.Spider):
                             score_guests = score_guest["o"]["ou"]['v']
                             score_guest_big_rule, score_guest_big, score_guest_small_rule, score_guest_small = rangqiu_daxiao(
                                 inner=score_guests)
-                            team_scores_dict_rule["score_guest_big"] = score_guest_big_rule
-                            team_scores_dict["score_guest_big"] = score_guest_big
-                            team_scores_dict_rule["score_guest_small"] = score_guest_small_rule
-                            team_scores_dict["score_guest_small"] = score_guest_small
+                            team_scores_dict_rule["tbgb"] = score_guest_big_rule
+                            team_scores_dict["tbgb"] = score_guest_big
+                            team_scores_dict_rule["tbgs"] = score_guest_small_rule
+                            team_scores_dict["tbgs"] = score_guest_small
                         except:
-                            # score_guest_small = None
-                            # score_guest_small_rule = None
-                            # score_guest_big = None
-                            # score_guest_big_rule = None
-                            team_scores_dict_rule["score_guest_big"] = None
-                            team_scores_dict["score_guest_big"] = None
-                            team_scores_dict_rule["score_guest_small"] = None
-                            team_scores_dict["score_guest_small"] = None
+                            # score_guest_small = ""
+                            # score_guest_small_rule = ""
+                            # score_guest_big = ""
+                            # score_guest_big_rule = ""
+                            team_scores_dict_rule["tbgb"] = ""
+                            team_scores_dict["tbgb"] = ""
+                            team_scores_dict_rule["tbgs"] = ""
+                            team_scores_dict["tbgs"] = ""
 
                         # 球队得分 上半场客队 guest
                         try:
                             half_score_guests = score_guest["o"]['ou1st']['v']
                             half_score_guest_big_rule, half_score_guest_big, half_score_guest_small_rule, half_score_guest_small = rangqiu_daxiao(
                                 inner=half_score_guests)
-                            team_scores_dict_rule["half_score_guest_big"] = half_score_guest_big_rule
-                            team_scores_dict["half_score_guest_big"] = half_score_guest_big
-                            team_scores_dict_rule["half_score_guest_small"] = half_score_guest_small_rule
-                            team_scores_dict["half_score_guest_small"] = half_score_guest_small
+                            team_scores_dict_rule["tbgb_h"] = half_score_guest_big_rule
+                            team_scores_dict["tbgb_h"] = half_score_guest_big
+                            team_scores_dict_rule["tbgs_h"] = half_score_guest_small_rule
+                            team_scores_dict["tbgs_h"] = half_score_guest_small
                         except:
-                            # half_score_guest_small = None
-                            # half_score_guest_small_rule = None
-                            # half_score_guest_big = None
-                            # half_score_guest_big_rule = None
-                            team_scores_dict_rule["half_score_guest_big"] = None
-                            team_scores_dict["half_score_guest_big"] = None
-                            team_scores_dict_rule["half_score_guest_small"] = None
-                            team_scores_dict["half_score_guest_small"] = None
+                            # half_score_guest_small = ""
+                            # half_score_guest_small_rule = ""
+                            # half_score_guest_big = ""
+                            # half_score_guest_big_rule = ""
+                            team_scores_dict_rule["tbgb_h"] = ""
+                            team_scores_dict["tbgb_h"] = ""
+                            team_scores_dict_rule["tbgs_h"] = ""
+                            team_scores_dict["tbgs_h"] = ""
                         # 球队得分第一节
                         try:
                             one_score_guests = score_guest["o"]['ouq1']['v']
                             one_score_guest_big_rule, one_score_guest_big, one_score_guest_small_rule, one_score_guest_small = rangqiu_daxiao(
                                 inner=one_score_guests)
-                            team_scores_dict_rule["one_score_guest_big"] = one_score_guest_big_rule
-                            team_scores_dict["one_score_guest_big"] = one_score_guest_big
-                            team_scores_dict_rule["one_score_guest_small"] = one_score_guest_small_rule
-                            team_scores_dict["one_score_guest_small"] = one_score_guest_small
+                            team_scores_dict_rule["tbgb_1"] = one_score_guest_big_rule
+                            team_scores_dict["tbgb_1"] = one_score_guest_big
+                            team_scores_dict_rule["tbgs_1"] = one_score_guest_small_rule
+                            team_scores_dict["tbgs_1"] = one_score_guest_small
                         except:
-                            # one_score_guest_small = None
-                            # one_score_guest_small_rule = None
-                            # one_score_guest_big = None
-                            # one_score_guest_big_rule = None
-                            team_scores_dict_rule["one_score_guest_big"] = None
-                            team_scores_dict["one_score_guest_big"] = None
-                            team_scores_dict_rule["one_score_guest_small"] = None
-                            team_scores_dict["one_score_guest_small"] = None
+                            # one_score_guest_small = ""
+                            # one_score_guest_small_rule = ""
+                            # one_score_guest_big = ""
+                            # one_score_guest_big_rule = ""
+                            team_scores_dict_rule["tbgb_1"] = ""
+                            team_scores_dict["tbgb_1"] = ""
+                            team_scores_dict_rule["tbgs_1"] = ""
+                            team_scores_dict["tbgs_1"] = ""
 
                         # 球队得分第二节
                         try:
                             two_score_guests = score_guest["o"]['ouq2']['v']
                             two_score_guest_big_rule, two_score_guest_big, two_score_guest_small_rule, two_score_guest_small = rangqiu_daxiao(
                                 inner=two_score_guests)
-                            team_scores_dict_rule["two_score_guest_big"] = two_score_guest_big_rule
-                            team_scores_dict["two_score_guest_big"] = two_score_guest_big
-                            team_scores_dict_rule["two_score_guest_small"] = two_score_guest_small_rule
-                            team_scores_dict["two_score_guest_small"] = two_score_guest_small
+                            team_scores_dict_rule["tbgb_2"] = two_score_guest_big_rule
+                            team_scores_dict["tbgb_2"] = two_score_guest_big
+                            team_scores_dict_rule["tbgs_2"] = two_score_guest_small_rule
+                            team_scores_dict["tbgs_2"] = two_score_guest_small
                         except:
-                            team_scores_dict_rule["two_score_guest_big"] = None
-                            team_scores_dict["two_score_guest_big"] = None
-                            team_scores_dict_rule["two_score_guest_small"] = None
-                            team_scores_dict["two_score_guest_small"] = None
+                            team_scores_dict_rule["tbgb_2"] = ""
+                            team_scores_dict["tbgb_2"] = ""
+                            team_scores_dict_rule["tbgs_2"] = ""
+                            team_scores_dict["tbgs_2"] = ""
                         # 球队得分第三节
                         try:
                             three_score_guests = score_guest["o"]['ouq3']['v']
                             three_score_guest_big_rule, three_score_guest_big, three_score_guest_small_rule, three_score_guest_small = rangqiu_daxiao(
                                 inner=three_score_guests)
-                            team_scores_dict_rule["three_score_guest_big"] = three_score_guest_big_rule
-                            team_scores_dict["three_score_guest_big"] = three_score_guest_big
-                            team_scores_dict_rule["three_score_guest_small"] = three_score_guest_small_rule
-                            team_scores_dict["three_score_guest_small"] = three_score_guest_small
+                            team_scores_dict_rule["tbgb_3"] = three_score_guest_big_rule
+                            team_scores_dict["tbgb_3"] = three_score_guest_big
+                            team_scores_dict_rule["tbgs_3"] = three_score_guest_small_rule
+                            team_scores_dict["tbgs_3"] = three_score_guest_small
                         except:
-                            team_scores_dict_rule["three_score_guest_big"] = None
-                            team_scores_dict["three_score_guest_big"] = None
-                            team_scores_dict_rule["three_score_guest_small"] = None
-                            team_scores_dict["three_score_guest_small"] = None
+                            team_scores_dict_rule["tbgb_3"] = ""
+                            team_scores_dict["tbgb_3"] = ""
+                            team_scores_dict_rule["tbgs_3"] = ""
+                            team_scores_dict["tbgs_3"] = ""
                         # 球队得分第四节
                         try:
                             four_score_guests = score_guest["o"]['ouq4']['v']
                             four_score_guest_big_rule, four_score_guest_big, four_score_guest_small_rule, four_score_guest_small = rangqiu_daxiao(
                                 inner=four_score_guests)
-                            team_scores_dict_rule["four_score_guest_big"] = four_score_guest_big_rule
-                            team_scores_dict["four_score_guest_big"] = four_score_guest_big
-                            team_scores_dict_rule["four_score_guest_small"] = four_score_guest_small_rule
-                            team_scores_dict["four_score_guest_small"] = four_score_guest_small
+                            team_scores_dict_rule["tbgb_4"] = four_score_guest_big_rule
+                            team_scores_dict["tbgb_4"] = four_score_guest_big
+                            team_scores_dict_rule["tbgs_4"] = four_score_guest_small_rule
+                            team_scores_dict["tbgs_4"] = four_score_guest_small
                         except:
-                            team_scores_dict_rule["four_score_guest_big"] = None
-                            team_scores_dict["four_score_guest_big"] = None
-                            team_scores_dict_rule["four_score_guest_small"] = None
-                            team_scores_dict["four_score_guest_small"] = None
+                            team_scores_dict_rule["tbgb_4"] = ""
+                            team_scores_dict["tbgb_4"] = ""
+                            team_scores_dict_rule["tbgs_4"] = ""
+                            team_scores_dict["tbgs_4"] = ""
 
             # 联赛id
             item['league_id'] = league_id

+ 0 - 71
hg3535/spiders/lq_jieshu.py

@@ -1,71 +0,0 @@
-# -*- coding: utf-8 -*-
-import datetime
-import re
-
-import scrapy
-
-from ..items import Lanjieguo
-
-
-class HgjieshuSpider(scrapy.Spider):
-    name = 'lq_jieshu'
-    to_day = datetime.datetime.now()
-    allowed_domains = ['hg3535z.com']
-    custom_settings = {
-        "ITEM_PIPELINES":{
-            'hg3535.pipeline.Lanjieshuqiupipeline': 300,
-        },
-        'LOG_LEVEL': 'DEBUG',
-        'LOG_FILE': "../hg3535/log/lq_jieshu_{}_{}_{}.log".format(to_day.year, to_day.month, to_day.day)
-    }
-    start_urls = ['https://hg3535z.com/zh-cn/info-centre/sportsbook-info/results/2/normal/1']
-
-    def parse(self, response):
-        if response.status == 200:
-            # 所有比赛对象
-            # tema = response.xpath('//div[@class="rt-event"]//span[@class="pt"]/text()')
-            # print(tema)
-            # 所有比赛队名
-            # tema_name = [i.extract() for i in tema]
-            # 获得所有比分对象
-            # tema_score = response.xpath('//div[contains(@class,"rt-qft")]')
-            tema_score = response.xpath('//div[@class="flex-wrap"]/../div[5]')
-            # print(tema_score)
-            # 获得所有比赛id对象
-            tema_id = response.xpath('//div[@class="flex-wrap"]/../div[1]/@id')
-            # str.replace()
-            # 所有比赛id列表
-            temaid_list = [i.extract().replace('e-', "") for i in tema_id]
-            temascore_list = []
-            for score in tema_score:
-                # 正则匹配规则
-                p1 = r"\d{1,3}-\d{1,3}"
-                pattern1 = re.compile(p1)
-                try:
-                    # 获取正则匹配结果
-                    c = pattern1.findall(score.extract())[0]
-                    temascore_list.append(c)
-                except:
-                    c = ""
-                    temascore_list.append(c)
-            # print(temaid_list)
-            # print(temascore_list)
-            # print(len(temaid_list))
-            # print(len(temascore_list))
-            # 赛事id,赛事比元组列表
-            tema_tupe = {(temaid_list[i], temascore_list[i]) for i in range(len(temaid_list))}
-            print(tema_tupe)
-            # # print(len(tema_tupe))
-            # for y in tema_tupe:
-            #     if y[1]:
-            #         item = Lanjieguo()
-            #         item['id_score'] = y
-            #         yield item
-
-            id_list = []
-            item = Lanjieguo()
-            for y in tema_tupe:
-                if y[1]:
-                    id_list.append(y[0])
-            item['id_score'] = id_list
-            yield item

Plik diff jest za duży
+ 5 - 2
hg3535/spiders/roll_bangqiu.py


+ 305 - 319
hg3535/spiders/roll_lanqiu.py

@@ -24,6 +24,7 @@ def rangqiu_daxiao(inner):
     concede_guest = [concedeguest[i] for i in range(len(concedeguest)) if i % 2 == 1]
     return concede_home_rule, concede_home, concede_guest_rule, concede_guest
 
+
 def danshaung_fun(inner):
     odd_even = [inner[i] for i in range(len(inner)) if i % 2 == 1]
     # 全场 总分单
@@ -65,7 +66,7 @@ class LanqiuSpider(scrapy.Spider):
                         url = 'https://odata.jiushan6688.com/odds6i/d/getamodds/zh-cn/eid/{}/iip/true/ubt/am/isp/false'.format(match_id)
                         yield Request(url=url, callback=self.parse_other, dont_filter=True)
 
-    def parse_other(self,response):
+    def parse_other(self, response):
         new_datas = json.loads(response.text).get('eg', "")
         item = Roll_Lanqiu()
         if new_datas:
@@ -98,269 +99,269 @@ class LanqiuSpider(scrapy.Spider):
             jijie = result['i'][12]
             # 球队得分
             qiudui = result['pci'].get('ctn', "")
-# ----------------------------------------让球分割线---------------------------------------------------------------------------
+            # ----------------------------------------让球分割线---------------------------------------------------------------------------
             concedes_dict = {}
             concedes_dict_rule = {}
             try:
                 concedes = result['o']["ah"]["v"]
                 # print(concedes)
                 # 主队让球条件,主队让球赔率,客队让球条件,客队让球赔率
-                concede_home_rule,concede_home,concede_guest_rule,concede_guest=rangqiu_daxiao(inner=concedes)
-                concedes_dict_rule['concede_home'] = concede_home_rule
-                concedes_dict['concede_home'] = concede_home
-                concedes_dict_rule['concede_guest'] = concede_guest_rule
-                concedes_dict['concede_guest'] = concede_guest
+                concede_home_rule, concede_home, concede_guest_rule, concede_guest = rangqiu_daxiao(inner=concedes)
+                concedes_dict_rule['coh'] = concede_home_rule
+                concedes_dict['coh'] = concede_home
+                concedes_dict_rule['cog'] = concede_guest_rule
+                concedes_dict['cog'] = concede_guest
             except:
-                concedes_dict_rule['concede_home'] = ""
-                concedes_dict['concede_home'] = ""
-                concedes_dict_rule['concede_guest'] = ""
-                concedes_dict['concede_guest'] = ""
+                concedes_dict_rule['coh'] = ""
+                concedes_dict['coh'] = ""
+                concedes_dict_rule['cog'] = ""
+                concedes_dict['cog'] = ""
             # print(concedes_dict)
             try:
                 half_concedes = result['o']["ah1st"]["v"]
                 # 上半场 主队让球条件
-                half_concede_home_rule, half_concede_home, half_concede_guest_rule, half_concede_guest=rangqiu_daxiao(inner=half_concedes)
-                concedes_dict_rule['half_concede_home'] = half_concede_home_rule
-                concedes_dict['half_concede_home'] = half_concede_home
-                concedes_dict_rule['half_concede_guest'] = half_concede_guest_rule
-                concedes_dict['half_concede_guest'] = half_concede_guest
+                half_concede_home_rule, half_concede_home, half_concede_guest_rule, half_concede_guest = rangqiu_daxiao(inner=half_concedes)
+                concedes_dict_rule['coh_h'] = half_concede_home_rule
+                concedes_dict['coh_h'] = half_concede_home
+                concedes_dict_rule['cog_h'] = half_concede_guest_rule
+                concedes_dict['cog_h'] = half_concede_guest
 
             except:
-                concedes_dict_rule['half_concede_home'] = ""
-                concedes_dict['half_concede_home'] = ""
-                concedes_dict_rule['half_concede_guest'] = ""
-                concedes_dict['half_concede_guest'] = ""
+                concedes_dict_rule['coh_h'] = ""
+                concedes_dict['coh_h'] = ""
+                concedes_dict_rule['cog_h'] = ""
+                concedes_dict['cog_h'] = ""
 
             # 第一节让球
             try:
                 one_concedes = result['o']["ahq1"]["v"]
-                one_concede_home_rule,one_concede_home,one_concede_guest_rule,one_concede_guest = rangqiu_daxiao(inner=one_concedes)
-                concedes_dict_rule['one_concede_home'] = one_concede_home_rule
-                concedes_dict['one_concede_home'] = one_concede_home
-                concedes_dict_rule['one_concede_guest'] = one_concede_guest_rule
-                concedes_dict['one_concede_guest'] = one_concede_guest
+                one_concede_home_rule, one_concede_home, one_concede_guest_rule, one_concede_guest = rangqiu_daxiao(inner=one_concedes)
+                concedes_dict_rule['coh_1'] = one_concede_home_rule
+                concedes_dict['coh_1'] = one_concede_home
+                concedes_dict_rule['cog_1'] = one_concede_guest_rule
+                concedes_dict['cog_1'] = one_concede_guest
 
             except:
-                concedes_dict_rule['one_concede_home'] = ""
-                concedes_dict['one_concede_home'] = ""
-                concedes_dict_rule['one_concede_guest'] = ""
-                concedes_dict['one_concede_guest'] = ""
+                concedes_dict_rule['coh_1'] = ""
+                concedes_dict['coh_1'] = ""
+                concedes_dict_rule['cog_1'] = ""
+                concedes_dict['cog_1'] = ""
             # 第二节让球
             try:
                 two_concedes = result['o']["ahq2"]["v"]
-                two_concede_home_rule,two_concede_home,two_concede_guest_rule,two_concede_guest = rangqiu_daxiao(inner=two_concedes)
-                concedes_dict_rule['two_concede_home'] = two_concede_home_rule
-                concedes_dict['two_concede_home'] = two_concede_home
-                concedes_dict_rule['two_concede_guest'] = two_concede_guest_rule
-                concedes_dict['two_concede_guest'] = two_concede_guest
+                two_concede_home_rule, two_concede_home, two_concede_guest_rule, two_concede_guest = rangqiu_daxiao(inner=two_concedes)
+                concedes_dict_rule['coh_2'] = two_concede_home_rule
+                concedes_dict['coh_2'] = two_concede_home
+                concedes_dict_rule['cog_2'] = two_concede_guest_rule
+                concedes_dict['cog_2'] = two_concede_guest
             except:
-                concedes_dict_rule['two_concede_home'] = ""
-                concedes_dict['two_concede_home'] = ""
-                concedes_dict_rule['two_concede_guest'] = ""
-                concedes_dict['two_concede_guest'] = ""
+                concedes_dict_rule['coh_2'] = ""
+                concedes_dict['coh_2'] = ""
+                concedes_dict_rule['cog_2'] = ""
+                concedes_dict['cog_2'] = ""
             # 第三节让球
             try:
                 three_concedes = result['o']["ahq3"]["v"]
-                three_concede_home_rule,three_concede_home,three_concede_guest_rule,three_concede_guest = rangqiu_daxiao(inner=three_concedes)
-                concedes_dict_rule['three_concede_home'] = three_concede_home_rule
-                concedes_dict['three_concede_home'] = three_concede_home
-                concedes_dict_rule['three_concede_guest'] = three_concede_guest_rule
-                concedes_dict['three_concede_guest'] = three_concede_guest
+                three_concede_home_rule, three_concede_home, three_concede_guest_rule, three_concede_guest = rangqiu_daxiao(inner=three_concedes)
+                concedes_dict_rule['coh_3'] = three_concede_home_rule
+                concedes_dict['coh_3'] = three_concede_home
+                concedes_dict_rule['cog_3'] = three_concede_guest_rule
+                concedes_dict['cog_3'] = three_concede_guest
 
             except:
-                concedes_dict_rule['three_concede_home'] = ""
-                concedes_dict['three_concede_home'] = ""
-                concedes_dict_rule['three_concede_guest'] = ""
-                concedes_dict['three_concede_guest'] = ""
+                concedes_dict_rule['coh_3'] = ""
+                concedes_dict['coh_3'] = ""
+                concedes_dict_rule['cog_3'] = ""
+                concedes_dict['cog_3'] = ""
             # 第四节让球
             try:
                 four_concedes = result['o']["ahq4"]["v"]
-                four_concede_home_rule,four_concede_home,four_concede_guest_rule,four_concede_guest = rangqiu_daxiao(inner=four_concedes)
-                concedes_dict_rule['four_concede_home'] = four_concede_home_rule
-                concedes_dict['four_concede_home'] = four_concede_home
-                concedes_dict_rule['four_concede_guest'] = four_concede_guest_rule
-                concedes_dict['four_concede_guest'] = four_concede_guest
+                four_concede_home_rule, four_concede_home, four_concede_guest_rule, four_concede_guest = rangqiu_daxiao(inner=four_concedes)
+                concedes_dict_rule['coh_4'] = four_concede_home_rule
+                concedes_dict['coh_4'] = four_concede_home
+                concedes_dict_rule['cog_4'] = four_concede_guest_rule
+                concedes_dict['cog_4'] = four_concede_guest
 
             except:
-                concedes_dict_rule['four_concede_home'] = ""
-                concedes_dict['four_concede_home'] = ""
-                concedes_dict_rule['four_concede_guest'] = ""
-                concedes_dict['four_concede_guest'] = ""
-# ----------------------------------------总分大小分割线 - ---------------------------------------------------------------
+                concedes_dict_rule['coh_4'] = ""
+                concedes_dict['coh_4'] = ""
+                concedes_dict_rule['cog_4'] = ""
+                concedes_dict['cog_4'] = ""
+            # ----------------------------------------总分大小分割线 - ---------------------------------------------------------------
             # 全场总分大小
             total_sizes_dict = {}
             total_sizes_dict_rule = {}
             try:
                 total_sizes = result['o']["ou"]["v"]
-                total_sizes_big_rule,total_sizes_big,total_sizes_small_rule,total_sizes_small = rangqiu_daxiao(inner=total_sizes)
-                total_sizes_dict_rule["total_sizes_big"] = total_sizes_big_rule
-                total_sizes_dict["total_sizes_big"] = total_sizes_big
-                total_sizes_dict_rule["total_sizes_small"] = total_sizes_small_rule
-                total_sizes_dict["total_sizes_small"] = total_sizes_small
+                total_sizes_big_rule, total_sizes_big, total_sizes_small_rule, total_sizes_small = rangqiu_daxiao(inner=total_sizes)
+                total_sizes_dict_rule["tnb"] = total_sizes_big_rule
+                total_sizes_dict["tnb"] = total_sizes_big
+                total_sizes_dict_rule["tns"] = total_sizes_small_rule
+                total_sizes_dict["tns"] = total_sizes_small
             except:
-                total_sizes_dict_rule["total_sizes_big"] = ""
-                total_sizes_dict["total_sizes_big"] = ""
-                total_sizes_dict_rule["total_sizes_small"] = ""
-                total_sizes_dict["total_sizes_small"] = ""
+                total_sizes_dict_rule["tnb"] = ""
+                total_sizes_dict["tnb"] = ""
+                total_sizes_dict_rule["tns"] = ""
+                total_sizes_dict["tns"] = ""
             # 上半场总分大小
             try:
                 half_total_sizes = result['o']["ou1st"]["v"]
-                half_total_sizes_big_rule,half_total_sizes_big,half_total_sizes_small_rule,half_total_sizes_small = rangqiu_daxiao(inner=half_total_sizes)
-                total_sizes_dict_rule["half_total_sizes_big"] = half_total_sizes_big_rule
-                total_sizes_dict["half_total_sizes_big"] = half_total_sizes_big
-                total_sizes_dict_rule["half_total_sizes_small"] = half_total_sizes_small_rule
-                total_sizes_dict["half_total_sizes_small"] = half_total_sizes_small
+                half_total_sizes_big_rule, half_total_sizes_big, half_total_sizes_small_rule, half_total_sizes_small = rangqiu_daxiao(
+                    inner=half_total_sizes)
+                total_sizes_dict_rule["tnb_h"] = half_total_sizes_big_rule
+                total_sizes_dict["tnb_h"] = half_total_sizes_big
+                total_sizes_dict_rule["tns_h"] = half_total_sizes_small_rule
+                total_sizes_dict["tns_h"] = half_total_sizes_small
             except:
-                total_sizes_dict_rule["half_total_sizes_big"] = ""
-                total_sizes_dict["half_total_sizes_big"] = ""
-                total_sizes_dict_rule["half_total_sizes_small"] = ""
-                total_sizes_dict["half_total_sizes_small"] = ""
+                total_sizes_dict_rule["tnb_h"] = ""
+                total_sizes_dict["tnb_h"] = ""
+                total_sizes_dict_rule["tns_h"] = ""
+                total_sizes_dict["tns_h"] = ""
             # 第一节总分大小
             try:
                 one_total_sizes = result['o']["ou1st"]["v"]
-                one_total_sizes_big_rule,one_total_sizes_big,one_total_sizes_small_rule,one_total_sizes_small = rangqiu_daxiao(inner=one_total_sizes)
-                total_sizes_dict_rule["one_total_sizes_big"] = one_total_sizes_big_rule
-                total_sizes_dict["one_total_sizes_big"] = one_total_sizes_big
-                total_sizes_dict_rule["one_total_sizes_small"] = one_total_sizes_small_rule
-                total_sizes_dict["one_total_sizes_small"] = one_total_sizes_small
+                one_total_sizes_big_rule, one_total_sizes_big, one_total_sizes_small_rule, one_total_sizes_small = rangqiu_daxiao(
+                    inner=one_total_sizes)
+                total_sizes_dict_rule["tnb_1"] = one_total_sizes_big_rule
+                total_sizes_dict["tnb_1"] = one_total_sizes_big
+                total_sizes_dict_rule["tns_1"] = one_total_sizes_small_rule
+                total_sizes_dict["tns_1"] = one_total_sizes_small
             except:
-                total_sizes_dict_rule["one_total_sizes_big"] = ""
-                total_sizes_dict["one_total_sizes_big"] = ""
-                total_sizes_dict_rule["one_total_sizes_small"] = ""
-                total_sizes_dict["one_total_sizes_small"] = ""
+                total_sizes_dict_rule["tnb_1"] = ""
+                total_sizes_dict["tnb_1"] = ""
+                total_sizes_dict_rule["tns_1"] = ""
+                total_sizes_dict["tns_1"] = ""
             # 第二节场总分大小
             try:
                 two_total_sizes = result['o']["ou2st"]["v"]
-                two_total_sizes_big_rule,two_total_sizes_big,two_total_sizes_small_rule,two_total_sizes_small = rangqiu_daxiao(inner=two_total_sizes)
-                total_sizes_dict_rule["two_total_sizes_big"] = two_total_sizes_big_rule
-                total_sizes_dict["two_total_sizes_big"] = two_total_sizes_big
-                total_sizes_dict_rule["two_total_sizes_small"] = two_total_sizes_small_rule
-                total_sizes_dict["two_total_sizes_small"] = two_total_sizes_small
+                two_total_sizes_big_rule, two_total_sizes_big, two_total_sizes_small_rule, two_total_sizes_small = rangqiu_daxiao(
+                    inner=two_total_sizes)
+                total_sizes_dict_rule["tnb_2"] = two_total_sizes_big_rule
+                total_sizes_dict["tnb_2"] = two_total_sizes_big
+                total_sizes_dict_rule["tns_2"] = two_total_sizes_small_rule
+                total_sizes_dict["tns_2"] = two_total_sizes_small
             except:
-                total_sizes_dict_rule["two_total_sizes_big"] = ""
-                total_sizes_dict["two_total_sizes_big"] = ""
-                total_sizes_dict_rule["two_total_sizes_small"] = ""
-                total_sizes_dict["two_total_sizes_small"] = ""
+                total_sizes_dict_rule["tnb_2"] = ""
+                total_sizes_dict["tnb_2"] = ""
+                total_sizes_dict_rule["tns_2"] = ""
+                total_sizes_dict["tns_2"] = ""
             # 第三节总分大小
             try:
                 three_total_sizes = result['o']["ou3st"]["v"]
-                three_total_sizes_big_rule,three_total_sizes_big,three_total_sizes_small_rule,three_total_sizes_small = rangqiu_daxiao(inner=three_total_sizes)
-                total_sizes_dict_rule["three_total_sizes_big"] = three_total_sizes_big_rule
-                total_sizes_dict["three_total_sizes_big"] = three_total_sizes_big
-                total_sizes_dict_rule["three_total_sizes_small"] = three_total_sizes_small_rule
-                total_sizes_dict["three_total_sizes_small"] = three_total_sizes_small
+                three_total_sizes_big_rule, three_total_sizes_big, three_total_sizes_small_rule, three_total_sizes_small = rangqiu_daxiao(
+                    inner=three_total_sizes)
+                total_sizes_dict_rule["tnb_3"] = three_total_sizes_big_rule
+                total_sizes_dict["tnb_3"] = three_total_sizes_big
+                total_sizes_dict_rule["tns_3"] = three_total_sizes_small_rule
+                total_sizes_dict["tns_3"] = three_total_sizes_small
             except:
-                total_sizes_dict_rule["three_total_sizes_big"] = ""
-                total_sizes_dict["three_total_sizes_big"] = ""
-                total_sizes_dict_rule["three_total_sizes_small"] = ""
-                total_sizes_dict["three_total_sizes_small"] = ""
+                total_sizes_dict_rule["tnb_3"] = ""
+                total_sizes_dict["tnb_3"] = ""
+                total_sizes_dict_rule["tns_3"] = ""
+                total_sizes_dict["tns_3"] = ""
             # 第四节总分大小
             try:
                 four_total_sizes = result['o']["ou4st"]["v"]
-                four_total_sizes_big_rule,four_total_sizes_big,four_total_sizes_small_rule,four_total_sizes_small = rangqiu_daxiao(inner=four_total_sizes)
-                total_sizes_dict_rule["four_total_sizes_big"] = four_total_sizes_big_rule
-                total_sizes_dict["four_total_sizes_big"] = four_total_sizes_big
-                total_sizes_dict_rule["four_total_sizes_small"] = four_total_sizes_small_rule
-                total_sizes_dict["four_total_sizes_small"] = four_total_sizes_small
+                four_total_sizes_big_rule, four_total_sizes_big, four_total_sizes_small_rule, four_total_sizes_small = rangqiu_daxiao(
+                    inner=four_total_sizes)
+                total_sizes_dict_rule["tnb_4"] = four_total_sizes_big_rule
+                total_sizes_dict["tnb_4"] = four_total_sizes_big
+                total_sizes_dict_rule["tns_4"] = four_total_sizes_small_rule
+                total_sizes_dict["tns_4"] = four_total_sizes_small
             except:
-                total_sizes_dict_rule["four_total_sizes_big"] = ""
-                total_sizes_dict["four_total_sizes_big"] = ""
-                total_sizes_dict_rule["four_total_sizes_small"] = ""
-                total_sizes_dict["four_total_sizes_small"] = ""
+                total_sizes_dict_rule["tnb_4"] = ""
+                total_sizes_dict["tnb_4"] = ""
+                total_sizes_dict_rule["tns_4"] = ""
+                total_sizes_dict["tns_4"] = ""
 
-# ----------------------------------------总分单双分割线------------------------------------------------------------------
+            # ----------------------------------------总分单双分割线------------------------------------------------------------------
             # 全场 总分单双
             odd_evens_dict = {}
             odd_evens_dict_rule = {}
             try:
                 odd_evens = result['o']["oe"]["v"]
                 # 全场 总分单, 全场 总分双
-                odd_evens_dict["two_sides_single"] = odd_evens[1]
-                odd_evens_dict_rule['two_sides_single'] = '单'
-                odd_evens_dict["two_sides_double"] = odd_evens[3]
-                odd_evens_dict_rule['two_sides_double'] = '双'
+                odd_evens_dict["tss"] = odd_evens[1]
+                odd_evens_dict_rule['tss'] = '单'
+                odd_evens_dict["tsd"] = odd_evens[3]
+                odd_evens_dict_rule['tsd'] = '双'
             except:
-                odd_evens_dict["two_sides_single"] = ""
-                odd_evens_dict_rule['two_sides_single'] = '单'
-                odd_evens_dict["two_sides_double"] = ""
-                odd_evens_dict_rule['two_sides_double'] = '双'
+                odd_evens_dict["tss"] = ""
+                odd_evens_dict_rule['tss'] = '单'
+                odd_evens_dict["tsd"] = ""
+                odd_evens_dict_rule['tsd'] = '双'
             # 上半场全场 总分单双
 
             try:
                 half_odd_evens = result['o']["oe1st"]["v"]
                 # 上半场 总分单, 上半场 总分双
-                odd_evens_dict["half_two_sides_single"] = half_odd_evens[1]
-                odd_evens_dict_rule['half_two_sides_single'] = '单'
-                odd_evens_dict["half_two_sides_double"] = half_odd_evens[3]
-                odd_evens_dict_rule['half_two_sides_double'] = '双'
+                odd_evens_dict["tss_h"] = half_odd_evens[1]
+                odd_evens_dict_rule['tss_h'] = '单'
+                odd_evens_dict["tsd_h"] = half_odd_evens[3]
+                odd_evens_dict_rule['tsd_h'] = '双'
             except:
                 # half_odd_even_odd = ""
                 # half_odd_even_even = ""
-                odd_evens_dict["half_two_sides_single"] = ""
-                odd_evens_dict_rule['half_two_sides_single'] = '单'
-                odd_evens_dict["half_two_sides_double"] = ""
-                odd_evens_dict_rule['half_two_sides_double'] = '双'
+                odd_evens_dict["tss_h"] = ""
+                odd_evens_dict_rule['tss_h'] = '单'
+                odd_evens_dict["tsd_h"] = ""
+                odd_evens_dict_rule['tsd_h'] = '双'
 
             # 总分:单/双-第一节
             try:
                 one_odd_evens = result['o']["oeq1"]["v"]
-                odd_evens_dict["one_two_sides_single"] = one_odd_evens[1]
-                odd_evens_dict_rule['one_two_sides_single'] = '单'
-                odd_evens_dict["one_two_sides_double"] = one_odd_evens[3]
-                odd_evens_dict_rule['one_two_sides_double'] = '双'
+                odd_evens_dict["tss_1"] = one_odd_evens[1]
+                odd_evens_dict_rule['tss_1'] = '单'
+                odd_evens_dict["tsd_1"] = one_odd_evens[3]
+                odd_evens_dict_rule['tsd_1'] = '双'
             except:
-                odd_evens_dict["one_two_sides_single"] = ""
-                odd_evens_dict_rule['one_two_sides_single'] = '单'
-                odd_evens_dict["one_two_sides_double"] = ""
-                odd_evens_dict_rule['one_two_sides_double'] = '双'
-
+                odd_evens_dict["tss_1"] = ""
+                odd_evens_dict_rule['tss_1'] = '单'
+                odd_evens_dict["tsd_1"] = ""
+                odd_evens_dict_rule['tsd_1'] = '双'
 
             # 总分:单/双-第二节
             try:
                 two_odd_evens = result['o']["oeq2"]["v"]
-                odd_evens_dict["two_two_sides_single"] = two_odd_evens[1]
-                odd_evens_dict_rule['two_two_sides_single'] = '单'
-                odd_evens_dict["two_two_sides_double"] = two_odd_evens[3]
-                odd_evens_dict_rule['two_two_sides_double'] = '双'
+                odd_evens_dict["tss_2"] = two_odd_evens[1]
+                odd_evens_dict_rule['tss_2'] = '单'
+                odd_evens_dict["tsd_2"] = two_odd_evens[3]
+                odd_evens_dict_rule['tsd_2'] = '双'
             except:
                 # two_odd_even_odd = ""
                 # two_odd_even_even = ""
-                odd_evens_dict["two_two_sides_single"] = ""
-                odd_evens_dict_rule['two_two_sides_single'] = '单'
-                odd_evens_dict["two_two_sides_double"] = ""
-                odd_evens_dict_rule['two_two_sides_double'] = '双'
+                odd_evens_dict["tss_2"] = ""
+                odd_evens_dict_rule['tss_2'] = '单'
+                odd_evens_dict["tsd_2"] = ""
+                odd_evens_dict_rule['tsd_2'] = '双'
 
             # 总分:单/双-第三节
             try:
                 three_odd_evens = result['o']["oeq3"]["v"]
-                odd_evens_dict["three_two_sides_single"] = three_odd_evens[1]
-                odd_evens_dict_rule['three_two_sides_single'] = '单'
-                odd_evens_dict["three_two_sides_double"] = three_odd_evens[3]
-                odd_evens_dict_rule['three_two_sides_double'] = '双'
-
-
+                odd_evens_dict["tss_3"] = three_odd_evens[1]
+                odd_evens_dict_rule['tss_3'] = '单'
+                odd_evens_dict["tsd_3"] = three_odd_evens[3]
+                odd_evens_dict_rule['tsd_3'] = '双'
             except:
-                odd_evens_dict["three_two_sides_single"] = ""
-                odd_evens_dict_rule['three_two_sides_single'] = '单'
-                odd_evens_dict["three_two_sides_double"] = ""
-                odd_evens_dict_rule['three_two_sides_double'] = '双'
-
-
+                odd_evens_dict["tss_3"] = ""
+                odd_evens_dict_rule['tss_3'] = '单'
+                odd_evens_dict["tsd_3"] = ""
+                odd_evens_dict_rule['tsd_3'] = '双'
 
             # 总分:单/双-第四节
             try:
                 four_odd_evens = result['o']["oeq4"]["v"]
-                odd_evens_dict["four_two_sides_single"] = four_odd_evens[1]
-                odd_evens_dict_rule['four_two_sides_single'] = '单'
-                odd_evens_dict["four_two_sides_double"] = four_odd_evens[3]
-                odd_evens_dict_rule['four_two_sides_double'] = '双'
+                odd_evens_dict["tss_4"] = four_odd_evens[1]
+                odd_evens_dict_rule['tss_4'] = '单'
+                odd_evens_dict["tsd_4"] = four_odd_evens[3]
+                odd_evens_dict_rule['tsd_4'] = '双'
             except:
-                odd_evens_dict["four_two_sides_single"] = ""
-                odd_evens_dict_rule['four_two_sides_single'] = '单'
-                odd_evens_dict["four_two_sides_double"] = ""
-                odd_evens_dict_rule['four_two_sides_double'] = '双'
+                odd_evens_dict["tss_4"] = ""
+                odd_evens_dict_rule['tss_4'] = '单'
+                odd_evens_dict["tsd_4"] = ""
+                odd_evens_dict_rule['tsd_4'] = '双'
 
-# ----------------------------------------球队得分最后一位数分割线---------------------------------------------------------
+            # ----------------------------------------球队得分最后一位数分割线---------------------------------------------------------
             # 球队得分最后一位数 主队
             last_numbers_dict = {}
             try:
@@ -380,7 +381,7 @@ class LanqiuSpider(scrapy.Spider):
             except:
                 last_guest = {}
             last_numbers_dict["last_guest"] = last_guest
-# ------------------------------------------------------独赢分割线---------------------------------------------------------
+            # ------------------------------------------------------独赢分割线---------------------------------------------------------
             capots_dict = {}
             # 独赢
             try:
@@ -388,11 +389,11 @@ class LanqiuSpider(scrapy.Spider):
                 capot_list = [capots[i] for i in range(len(capots)) if i % 2 == 1]
                 capot_home = capot_list[0]
                 capot_guest = capot_list[1]
-                capots_dict["capot_home"] = capot_home
-                capots_dict["capot_guest"] = capot_guest
+                capots_dict["ch"] = capot_home
+                capots_dict["cg"] = capot_guest
             except:
-                capots_dict["capot_home"] = ""
-                capots_dict["capot_guest"] = ""
+                capots_dict["ch"] = ""
+                capots_dict["cg"] = ""
 
             # 上半场独赢
             try:
@@ -400,11 +401,11 @@ class LanqiuSpider(scrapy.Spider):
                 half_capot_list = [half_capots[i] for i in range(len(half_capots)) if i % 2 == 1]
                 half_capot_home = half_capot_list[0]
                 half_capot_guest = half_capot_list[1]
-                capots_dict["half_capot_home"] = half_capot_home
-                capots_dict["half_capot_guest"] = half_capot_guest
+                capots_dict["ch_h"] = half_capot_home
+                capots_dict["cg_h"] = half_capot_guest
             except:
-                capots_dict["half_capot_home"] = ""
-                capots_dict["half_capot_guest"] = ""
+                capots_dict["ch_h"] = ""
+                capots_dict["cg_h"] = ""
 
             # 第一节独赢
             try:
@@ -412,11 +413,11 @@ class LanqiuSpider(scrapy.Spider):
                 one_capot_list = [one_capots[i] for i in range(len(one_capots)) if i % 2 == 1]
                 one_capot_home = one_capot_list[0]
                 one_capot_guest = one_capot_list[1]
-                capots_dict["one_capot_home"] = one_capot_home
-                capots_dict["one_capot_guest"] = one_capot_guest
+                capots_dict["ch_1"] = one_capot_home
+                capots_dict["cg_1"] = one_capot_guest
             except:
-                capots_dict["one_capot_home"] = ""
-                capots_dict["one_capot_guest"] = ""
+                capots_dict["ch_1"] = ""
+                capots_dict["cg_1"] = ""
 
             # 第二节独赢
             try:
@@ -424,11 +425,11 @@ class LanqiuSpider(scrapy.Spider):
                 two_capot_list = [two_capots[i] for i in range(len(two_capots)) if i % 2 == 1]
                 two_capot_home = two_capot_list[0]
                 two_capot_guest = two_capot_list[1]
-                capots_dict["two_capot_home"] = two_capot_home
-                capots_dict["two_capot_guest"] = two_capot_guest
+                capots_dict["ch_2"] = two_capot_home
+                capots_dict["cg_2"] = two_capot_guest
             except:
-                capots_dict["two_capot_home"] = ""
-                capots_dict["two_capot_guest"] = ""
+                capots_dict["ch_2"] = ""
+                capots_dict["cg_2"] = ""
 
             # 第三节独赢
             try:
@@ -436,11 +437,11 @@ class LanqiuSpider(scrapy.Spider):
                 three_capot_list = [three_capots[i] for i in range(len(three_capots)) if i % 2 == 1]
                 three_capot_home = three_capot_list[0]
                 three_capot_guest = three_capot_list[1]
-                capots_dict["three_capot_home"] = three_capot_home
-                capots_dict["three_capot_guest"] = three_capot_guest
+                capots_dict["ch_3"] = three_capot_home
+                capots_dict["cg_3"] = three_capot_guest
             except:
-                capots_dict["three_capot_home"] = ""
-                capots_dict["three_capot_guest"] = ""
+                capots_dict["ch_3"] = ""
+                capots_dict["cg_3"] = ""
 
             # 第四节独赢
             try:
@@ -448,14 +449,14 @@ class LanqiuSpider(scrapy.Spider):
                 four_capot_list = [four_capots[i] for i in range(len(four_capots)) if i % 2 == 1]
                 four_capot_home = four_capot_list[0]
                 four_capot_guest = four_capot_list[1]
-                capots_dict["four_capot_home"] = four_capot_home
-                capots_dict["four_capot_guest"] = four_capot_guest
+                capots_dict["ch_4"] = four_capot_home
+                capots_dict["cg_4"] = four_capot_guest
             except:
-                capots_dict["four_capot_home"] = ""
-                capots_dict["four_capot_guest"] = ""
+                capots_dict["ch_4"] = ""
+                capots_dict["cg_4"] = ""
 
-# ---------------------------------------------------华丽分割线列表es[1]--------------------------------------------------
-            # 球队得分 全场主队 home
+            # ---------------------------------------------------华丽分割线列表es[1]--------------------------------------------------
+            # 球队得分大/小 全场主队 home
             team_scores_dict = {}
             team_scores_dict_rule = {}
             try:
@@ -465,89 +466,93 @@ class LanqiuSpider(scrapy.Spider):
             if score_home:
                 try:
                     score_homes = score_home["o"]["ou"]['v']
-                    score_home_big_rule,score_home_big,score_home_small_rule,score_home_small = rangqiu_daxiao(inner=score_homes)
-                    team_scores_dict_rule["score_home_big"] = score_home_big_rule
-                    team_scores_dict["score_home_big"] = score_home_big
-                    team_scores_dict_rule["score_home_small"] = score_home_small_rule
-                    team_scores_dict["score_home_small"] = score_home_small
+                    score_home_big_rule, score_home_big, score_home_small_rule, score_home_small = rangqiu_daxiao(inner=score_homes)
+                    team_scores_dict_rule["tbhb"] = score_home_big_rule
+                    team_scores_dict["tbhb"] = score_home_big
+                    team_scores_dict_rule["tbhs"] = score_home_small_rule
+                    team_scores_dict["tbhs"] = score_home_small
                 except:
-                    team_scores_dict_rule["score_home_big"] = ""
-                    team_scores_dict["score_home_big"] = ""
-                    team_scores_dict_rule["score_home_small"] = ""
-                    team_scores_dict["score_home_small"] = ""
+                    team_scores_dict_rule["tbhb"] = ""
+                    team_scores_dict["tbhb"] = ""
+                    team_scores_dict_rule["tbhs"] = ""
+                    team_scores_dict["tbhs"] = ""
                 # 球队得分 上半场主队 home
                 try:
                     half_score_homes = score_home['o']['ou1st']['v']
                     # 球队得分 上半场主队 大条件
-                    half_score_home_big_rule,half_score_home_big,half_score_home_small_rule,half_score_home_small = rangqiu_daxiao(inner=half_score_homes)
-                    team_scores_dict_rule["half_score_home_big"] = half_score_home_big_rule
-                    team_scores_dict["half_score_home_big"] = half_score_home_big
-                    team_scores_dict_rule["half_score_home_small"] = half_score_home_small_rule
-                    team_scores_dict["half_score_home_small"] = half_score_home_small
+                    half_score_home_big_rule, half_score_home_big, half_score_home_small_rule, half_score_home_small = rangqiu_daxiao(
+                        inner=half_score_homes)
+                    team_scores_dict_rule["tbhb_h"] = half_score_home_big_rule
+                    team_scores_dict["tbhb_h"] = half_score_home_big
+                    team_scores_dict_rule["tbhs_h"] = half_score_home_small_rule
+                    team_scores_dict["tbhs_h"] = half_score_home_small
                 except:
-                    team_scores_dict_rule["half_score_home_big"] = ""
-                    team_scores_dict["half_score_home_big"] = ""
-                    team_scores_dict_rule["half_score_home_small"] = ""
-                    team_scores_dict["half_score_home_small"] = ""
+                    team_scores_dict_rule["tbhb_h"] = ""
+                    team_scores_dict["tbhb_h"] = ""
+                    team_scores_dict_rule["tbhs_h"] = ""
+                    team_scores_dict["tbhs_h"] = ""
 
                 # 球队得分:主队-大 / 小-第一节
                 try:
                     one_score_homes = score_home['o']["ouq1"]["v"]
-                    one_score_home_big_rule,one_score_home_big,one_score_home_small_rule,one_score_home_small = rangqiu_daxiao(inner=one_score_homes)
-                    team_scores_dict_rule["one_score_home_big"] = one_score_home_big_rule
-                    team_scores_dict["one_score_home_big"] = one_score_home_big
-                    team_scores_dict_rule["one_score_home_small"] = one_score_home_small_rule
-                    team_scores_dict["one_score_home_small"] = one_score_home_small
+                    one_score_home_big_rule, one_score_home_big, one_score_home_small_rule, one_score_home_small = rangqiu_daxiao(
+                        inner=one_score_homes)
+                    team_scores_dict_rule["tbhb_1"] = one_score_home_big_rule
+                    team_scores_dict["tbhb_1"] = one_score_home_big
+                    team_scores_dict_rule["tbhs_1"] = one_score_home_small_rule
+                    team_scores_dict["tbhs_1"] = one_score_home_small
                 except:
-                    team_scores_dict_rule["one_score_home_big"] = ""
-                    team_scores_dict["one_score_home_big"] = ""
-                    team_scores_dict_rule["one_score_home_small"] = ""
-                    team_scores_dict["one_score_home_small"] = ""
+                    team_scores_dict_rule["tbhb_1"] = ""
+                    team_scores_dict["tbhb_1"] = ""
+                    team_scores_dict_rule["tbhs_1"] = ""
+                    team_scores_dict["tbhs_1"] = ""
 
                 # 球队得分:主队-大 / 小-第二节
                 try:
                     two_score_homes = score_home['o']["ouq2"]["v"]
-                    two_score_home_big_rule,two_score_home_big,two_score_home_small_rule,two_score_home_small = rangqiu_daxiao(inner=two_score_homes)
-                    team_scores_dict_rule["two_score_home_big"] = two_score_home_big_rule
-                    team_scores_dict["two_score_home_big"] = two_score_home_big
-                    team_scores_dict_rule["two_score_home_small"] = two_score_home_small_rule
-                    team_scores_dict["two_score_home_small"] = two_score_home_small
+                    two_score_home_big_rule, two_score_home_big, two_score_home_small_rule, two_score_home_small = rangqiu_daxiao(
+                        inner=two_score_homes)
+                    team_scores_dict_rule["tbhb_2"] = two_score_home_big_rule
+                    team_scores_dict["tbhb_2"] = two_score_home_big
+                    team_scores_dict_rule["tbhs_2"] = two_score_home_small_rule
+                    team_scores_dict["tbhs_2"] = two_score_home_small
                 except:
-                    team_scores_dict_rule["two_score_home_big"] = ""
-                    team_scores_dict["two_score_home_big"] = ""
-                    team_scores_dict_rule["two_score_home_small"] = ""
-                    team_scores_dict["two_score_home_small"] = ""
+                    team_scores_dict_rule["tbhb_2"] = ""
+                    team_scores_dict["tbhb_2"] = ""
+                    team_scores_dict_rule["tbhs_2"] = ""
+                    team_scores_dict["tbhs_2"] = ""
 
                 # 球队得分:主队-大 / 小-第三节
                 try:
                     three_score_homes = score_home['o']["ouq3"]["v"]
-                    three_score_home_big_rule,three_score_home_big,three_score_home_small_rule,three_score_home_small = rangqiu_daxiao(inner=three_score_homes)
-                    team_scores_dict_rule["three_score_home_big"] = three_score_home_big_rule
-                    team_scores_dict["three_score_home_big"] = three_score_home_big
-                    team_scores_dict_rule["three_score_home_small"] = three_score_home_small_rule
-                    team_scores_dict["three_score_home_small"] = three_score_home_small
+                    three_score_home_big_rule, three_score_home_big, three_score_home_small_rule, three_score_home_small = rangqiu_daxiao(
+                        inner=three_score_homes)
+                    team_scores_dict_rule["tbhb_3"] = three_score_home_big_rule
+                    team_scores_dict["tbhb_3"] = three_score_home_big
+                    team_scores_dict_rule["tbhs_3"] = three_score_home_small_rule
+                    team_scores_dict["tbhs_3"] = three_score_home_small
                 except:
-                    team_scores_dict_rule["three_score_home_big"] = ""
-                    team_scores_dict["three_score_home_big"] = ""
-                    team_scores_dict_rule["three_score_home_small"] = ""
-                    team_scores_dict["three_score_home_small"] = ""
+                    team_scores_dict_rule["tbhb_3"] = ""
+                    team_scores_dict["tbhb_3"] = ""
+                    team_scores_dict_rule["tbhs_3"] = ""
+                    team_scores_dict["tbhs_3"] = ""
 
                 # 球队得分:主队-大 / 小-第四节
                 try:
                     four_score_homes = score_home['o']["ouq4"]["v"]
-                    four_score_home_big_rule,four_score_home_big,four_score_home_small_rule,four_score_home_small = rangqiu_daxiao(inner=four_score_homes)
-                    team_scores_dict_rule["four_score_home_big"] = four_score_home_big_rule
-                    team_scores_dict["four_score_home_big"] = four_score_home_big
-                    team_scores_dict_rule["four_score_home_small"] = four_score_home_small_rule
-                    team_scores_dict["four_score_home_small"] = four_score_home_small
+                    four_score_home_big_rule, four_score_home_big, four_score_home_small_rule, four_score_home_small = rangqiu_daxiao(
+                        inner=four_score_homes)
+                    team_scores_dict_rule["tbhb_4"] = four_score_home_big_rule
+                    team_scores_dict["tbhb_4"] = four_score_home_big
+                    team_scores_dict_rule["tbhs_4"] = four_score_home_small_rule
+                    team_scores_dict["tbhs_4"] = four_score_home_small
                 except:
-                    team_scores_dict_rule["four_score_home_big"] = ""
-                    team_scores_dict["four_score_home_big"] = ""
-                    team_scores_dict_rule["four_score_home_small"] = ""
-                    team_scores_dict["four_score_home_small"] = ""
-
+                    team_scores_dict_rule["tbhs_4"] = ""
+                    team_scores_dict["tbhb_4"] = ""
+                    team_scores_dict_rule["tbhs_4"] = ""
+                    team_scores_dict["tbhs_4"] = ""
 
-# ---------------------------------------------------华丽分割线列表es[2]--------------------------------------------------
+            # ---------------------------------------------------华丽分割线列表es[2]--------------------------------------------------
             # 球队得分 客队 guest
             try:
                 score_guest = new_data[2]
@@ -557,87 +562,88 @@ class LanqiuSpider(scrapy.Spider):
                 try:
                     # 球队得分: 大 / 小
                     score_guests = score_guest["o"]["ou"]['v']
-                    score_guest_big_rule,score_guest_big,score_guest_small_rule,score_guest_small = rangqiu_daxiao(inner=score_guests)
-                    team_scores_dict_rule["score_guest_big"] = score_guest_big_rule
-                    team_scores_dict["score_guest_big"] = score_guest_big
-                    team_scores_dict_rule["score_guest_small"] = score_guest_small_rule
-                    team_scores_dict["score_guest_small"] = score_guest_small
+                    score_guest_big_rule, score_guest_big, score_guest_small_rule, score_guest_small = rangqiu_daxiao(inner=score_guests)
+                    team_scores_dict_rule["tbgb"] = score_guest_big_rule
+                    team_scores_dict["tbgb"] = score_guest_big
+                    team_scores_dict_rule["tbgs"] = score_guest_small_rule
+                    team_scores_dict["tbgs"] = score_guest_small
                 except:
-                    team_scores_dict_rule["score_guest_big"] = ""
-                    team_scores_dict["score_guest_big"] = ""
-                    team_scores_dict_rule["score_guest_small"] = ""
-                    team_scores_dict["score_guest_small"] = ""
+                    team_scores_dict_rule["tbgb"] = ""
+                    team_scores_dict["tbgb"] = ""
+                    team_scores_dict_rule["tbgs"] = ""
+                    team_scores_dict["tbgs"] = ""
 
                 # 球队得分 上半场客队 guest
                 try:
                     half_score_guests = score_guest["o"]['ou1st']['v']
-                    half_score_guest_big_rule,half_score_guest_big,half_score_guest_small_rule,half_score_guest_small = rangqiu_daxiao(inner=half_score_guests)
-                    team_scores_dict_rule["half_score_guest_big"] = half_score_guest_big_rule
-                    team_scores_dict["half_score_guest_big"] = half_score_guest_big
-                    team_scores_dict_rule["half_score_guest_small"] = half_score_guest_small_rule
-                    team_scores_dict["half_score_guest_small"] = half_score_guest_small
+                    half_score_guest_big_rule, half_score_guest_big, half_score_guest_small_rule, half_score_guest_small = rangqiu_daxiao(
+                        inner=half_score_guests)
+                    team_scores_dict_rule["tbgb_h"] = half_score_guest_big_rule
+                    team_scores_dict["tbgb_h"] = half_score_guest_big
+                    team_scores_dict_rule["tbgs_h"] = half_score_guest_small_rule
+                    team_scores_dict["tbgs_h"] = half_score_guest_small
                 except:
-                    team_scores_dict_rule["half_score_guest_big"] = ""
-                    team_scores_dict["half_score_guest_big"] = ""
-                    team_scores_dict_rule["half_score_guest_small"] = ""
-                    team_scores_dict["half_score_guest_small"] = ""
+                    team_scores_dict_rule["tbgb_h"] = ""
+                    team_scores_dict["tbgb_h"] = ""
+                    team_scores_dict_rule["tbgs_h"] = ""
+                    team_scores_dict["tbgs_h"] = ""
                 # 球队得分第一节
                 try:
                     one_score_guests = score_guest["o"]['ouq1']['v']
                     one_score_guest_big_rule, one_score_guest_big, one_score_guest_small_rule, one_score_guest_small = rangqiu_daxiao(
                         inner=one_score_guests)
-                    team_scores_dict_rule["one_score_guest_big"] = one_score_guest_big_rule
-                    team_scores_dict["one_score_guest_big"] = one_score_guest_big
-                    team_scores_dict_rule["one_score_guest_small"] = one_score_guest_small_rule
-                    team_scores_dict["one_score_guest_small"] = one_score_guest_small
+                    team_scores_dict_rule["tbgb_1"] = one_score_guest_big_rule
+                    team_scores_dict["tbgb_1"] = one_score_guest_big
+                    team_scores_dict_rule["tbgs_1"] = one_score_guest_small_rule
+                    team_scores_dict["tbgs_1"] = one_score_guest_small
                 except:
-                    team_scores_dict_rule["one_score_guest_big"] = ""
-                    team_scores_dict["one_score_guest_big"] = ""
-                    team_scores_dict_rule["one_score_guest_small"] = ""
-                    team_scores_dict["one_score_guest_small"] = ""
+                    team_scores_dict_rule["tbgb_1"] = ""
+                    team_scores_dict["tbgb_1"] = ""
+                    team_scores_dict_rule["tbgs_1"] = ""
+                    team_scores_dict["tbgs_1"] = ""
 
                 # 球队得分第二节
                 try:
                     two_score_guests = score_guest["o"]['ouq2']['v']
                     two_score_guest_big_rule, two_score_guest_big, two_score_guest_small_rule, two_score_guest_small = rangqiu_daxiao(
                         inner=two_score_guests)
-                    team_scores_dict_rule["two_score_guest_big"] = two_score_guest_big_rule
-                    team_scores_dict["two_score_guest_big"] = two_score_guest_big
-                    team_scores_dict_rule["two_score_guest_small"] = two_score_guest_small_rule
-                    team_scores_dict["two_score_guest_small"] = two_score_guest_small
+                    team_scores_dict_rule["tbgb_2"] = two_score_guest_big_rule
+                    team_scores_dict["tbgb_2"] = two_score_guest_big
+                    team_scores_dict_rule["tbgs_2"] = two_score_guest_small_rule
+                    team_scores_dict["tbgs_2"] = two_score_guest_small
                 except:
-                    team_scores_dict_rule["two_score_guest_big"] = ""
-                    team_scores_dict["two_score_guest_big"] = ""
-                    team_scores_dict_rule["two_score_guest_small"] = ""
-                    team_scores_dict["two_score_guest_small"] = ""
+                    team_scores_dict_rule["tbgb_2"] = ""
+                    team_scores_dict["tbgb_2"] = ""
+                    team_scores_dict_rule["tbgs_2"] = ""
+                    team_scores_dict["tbgs_2"] = ""
                 # 球队得分第三节
                 try:
                     three_score_guests = score_guest["o"]['ouq3']['v']
                     three_score_guest_big_rule, three_score_guest_big, three_score_guest_small_rule, three_score_guest_small = rangqiu_daxiao(
                         inner=three_score_guests)
-                    team_scores_dict_rule["three_score_guest_big"] = three_score_guest_big_rule
-                    team_scores_dict["three_score_guest_big"] = three_score_guest_big
-                    team_scores_dict_rule["three_score_guest_small"] = three_score_guest_small_rule
-                    team_scores_dict["three_score_guest_small"] = three_score_guest_small
+                    team_scores_dict_rule["tbgb_3"] = three_score_guest_big_rule
+                    team_scores_dict["tbgb_3"] = three_score_guest_big
+                    team_scores_dict_rule["tbgs_3"] = three_score_guest_small_rule
+                    team_scores_dict["tbgs_3"] = three_score_guest_small
                 except:
-                    team_scores_dict_rule["three_score_guest_big"] = ""
-                    team_scores_dict["three_score_guest_big"] = ""
-                    team_scores_dict_rule["three_score_guest_small"] = ""
-                    team_scores_dict["three_score_guest_small"] = ""
+                    team_scores_dict_rule["tbgb_3"] = ""
+                    team_scores_dict["tbgb_3"] = ""
+                    team_scores_dict_rule["tbgs_3"] = ""
+                    team_scores_dict["tbgs_3"] = ""
                 # 球队得分第四节
                 try:
                     four_score_guests = score_guest["o"]['ouq4']['v']
                     four_score_guest_big_rule, four_score_guest_big, four_score_guest_small_rule, four_score_guest_small = rangqiu_daxiao(
                         inner=four_score_guests)
-                    team_scores_dict_rule["four_score_guest_big"] = four_score_guest_big_rule
-                    team_scores_dict["four_score_guest_big"] = four_score_guest_big
-                    team_scores_dict_rule["four_score_guest_small"] = four_score_guest_small_rule
-                    team_scores_dict["four_score_guest_small"] = four_score_guest_small
+                    team_scores_dict_rule["tbgb_4"] = four_score_guest_big_rule
+                    team_scores_dict["tbgb_4"] = four_score_guest_big
+                    team_scores_dict_rule["tbgs_4"] = four_score_guest_small_rule
+                    team_scores_dict["tbgs_4"] = four_score_guest_small
                 except:
-                    team_scores_dict_rule["four_score_guest_big"] = ""
-                    team_scores_dict["four_score_guest_big"] = ""
-                    team_scores_dict_rule["four_score_guest_small"] = ""
-                    team_scores_dict["four_score_guest_small"] = ""
+                    team_scores_dict_rule["tbgb_4"] = ""
+                    team_scores_dict["tbgb_4"] = ""
+                    team_scores_dict_rule["tbgs_4"] = ""
+                    team_scores_dict["tbgs_4"] = ""
 
             # 联赛id
             item['league_id'] = league_id
@@ -677,23 +683,3 @@ class LanqiuSpider(scrapy.Spider):
             item['team_score'] = team_scores_dict
             item['team_score_rule'] = team_scores_dict_rule
             yield item
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

+ 71 - 69
hg3535/spiders/roll_wangqiu.py

@@ -113,21 +113,21 @@ class WangqiuSpider(scrapy.Spider):
                 # jijie = result['i'][12]
                 # 球队得分
                 qiudui = result['pci'].get('ctn', "")
-                # ----------------------------------------让分割线---------------------------------------------------------------------------
+                # ----------------------------------------让分割线---------------------------------------------------------------------------
                 concedes_dict = {}
                 concedes_dict_rule = {}
                 try:
                     # 滚球让盘
                     concedes = result['o']["ah"]["v"]
-                    concedes_dict_rule['dishes_home'] = concedes[1]
-                    concedes_dict['dishes_home'] = concedes[5]
-                    concedes_dict_rule['dishes_guest'] = concedes[3]
-                    concedes_dict['dishes_guest'] = concedes[7]
+                    concedes_dict_rule['ldh'] = concedes[1]  # 主队
+                    concedes_dict['ldh'] = concedes[5]
+                    concedes_dict_rule['ldg'] = concedes[3]  # 客队
+                    concedes_dict['ldg'] = concedes[7]
                 except:
-                    concedes_dict_rule['dishes_home'] = ""
-                    concedes_dict['dishes_home'] = ""
-                    concedes_dict_rule['dishes_guest'] = ""
-                    concedes_dict['dishes_guest'] = ""
+                    concedes_dict_rule['ldh'] = ""
+                    concedes_dict['ldh'] = ""
+                    concedes_dict_rule['ldg'] = ""
+                    concedes_dict['ldg'] = ""
                 # print(concedes_dict)
 
                 # ----------------------------------------第一节让球分割线----------------------------------------------------------------
@@ -165,29 +165,29 @@ class WangqiuSpider(scrapy.Spider):
                 try:
                     # 滚球独赢
                     kemps = result['o']["ml"]["v"]
-                    kemps_dict['kemp_home'] = kemps[1]
-                    kemps_dict['kemp_guest'] = kemps[3]
+                    kemps_dict['ch'] = kemps[1]  # 主队
+                    kemps_dict['cg'] = kemps[3]  # 客队
 
                 except:
-                    kemps_dict['kemp_home'] = ""
-                    kemps_dict['kemp_guest'] = ""
+                    kemps_dict['ch'] = ""
+                    kemps_dict['cg'] = ""
                 # 第一盘 冠军  第一盘独赢 滚球是独赢
                 try:
                     kemps = result['o']["mls1"]["v"]
-                    kemps_dict['one_kemp_home'] = kemps[1]
-                    kemps_dict['one_kemp_guest'] = kemps[3]
+                    kemps_dict['ch_1'] = kemps[1]
+                    kemps_dict['cg_1'] = kemps[3]
 
                 except:
-                    kemps_dict['one_kemp_home'] = ""
-                    kemps_dict['one_kemp_guest'] = ""
+                    kemps_dict['ch_1'] = ""
+                    kemps_dict['cg_1'] = ""
 
                 try:  # 第二盘 独赢
                     kemps = result['o']["mls2"]["v"]
-                    kemps_dict['two_kemp_home'] = kemps[1]
-                    kemps_dict['two_kemp_guest'] = kemps[3]
+                    kemps_dict['ch_2'] = kemps[1]
+                    kemps_dict['cg_2'] = kemps[3]
                 except:
-                    kemps_dict['two_kemp_home'] = ""
-                    kemps_dict["two_kemp_guest"] = ""
+                    kemps_dict['ch_2'] = ""
+                    kemps_dict["cg_2"] = ""
 
                 # ---------------------------------------------------让局---------------------------------------------------------------
 
@@ -195,69 +195,69 @@ class WangqiuSpider(scrapy.Spider):
                 bureaus_dict_rule = {}
                 try:
                     bureaus = result['o']["ahfts"]["v"]
-                    bureaus_dict_rule['concede_home'] = bureaus[1]
-                    bureaus_dict['concede_home'] = bureaus[5]
-                    bureaus_dict_rule['concede_guest'] = bureaus[3]
-                    bureaus_dict['concede_guest'] = bureaus[7]
+                    bureaus_dict_rule['lbh'] = bureaus[1]  # 主队
+                    bureaus_dict['lbh'] = bureaus[5]
+                    bureaus_dict_rule['lbg'] = bureaus[3]  # 客队
+                    bureaus_dict['lbg'] = bureaus[7]
                 except:
-                    bureaus_dict_rule['concede_home'] = ""
-                    bureaus_dict['concede_home'] = ""
-                    bureaus_dict_rule['concede_guest'] = ""
-                    bureaus_dict['concede_guest'] = ""
+                    bureaus_dict_rule['lbh'] = ""
+                    bureaus_dict['lbh'] = ""
+                    bureaus_dict_rule['lbg'] = ""
+                    bureaus_dict['lbg'] = ""
 
                 # -----------------------------------------------------总局数 第一盘:大/小------------------------------------------------
                 total_number_dict = {}
                 total_number_dict_rule = {}
                 try:  # 总局数 滚球大小
                     total_numbers = result['o']["oufts"]["v"]
-                    total_number_dict_rule['total_number_big'] = total_numbers[1]
-                    total_number_dict['total_number_big'] = total_numbers[5]
-                    total_number_dict_rule['total_number_small'] = total_numbers[3]
-                    total_number_dict['total_number_small'] = total_numbers[7]
+                    total_number_dict_rule['tnb'] = total_numbers[1]
+                    total_number_dict['tnb'] = total_numbers[5]
+                    total_number_dict_rule['tns'] = total_numbers[3]
+                    total_number_dict['tns'] = total_numbers[7]
                 except:
-                    total_number_dict_rule['total_number_big'] = ""
-                    total_number_dict['total_number_big'] = ""
-                    total_number_dict_rule['total_number_small'] = ""
-                    total_number_dict['total_number_small'] = ""
+                    total_number_dict_rule['tnb'] = ""
+                    total_number_dict['tnb'] = ""
+                    total_number_dict_rule['tns'] = ""
+                    total_number_dict['tns'] = ""
 
                 # 第一节盘
                 try:
                     one_total_sizes = result['o']["ous1"]["v"]
-                    total_number_dict_rule["one_total_number_big"] = one_total_sizes[1]
-                    total_number_dict["one_total_number_big"] = one_total_sizes[5]
-                    total_number_dict_rule["one_total_number_small"] = one_total_sizes[3]
-                    total_number_dict["one_total_number_small"] = one_total_sizes[7]
+                    total_number_dict_rule["tnb_1"] = one_total_sizes[1]
+                    total_number_dict["tnb_1"] = one_total_sizes[5]
+                    total_number_dict_rule["tns_1"] = one_total_sizes[3]
+                    total_number_dict["tns_1"] = one_total_sizes[7]
                 except:
-                    total_number_dict_rule["one_total_number_big"] = ""
-                    total_number_dict["one_total_number_big"] = ""
-                    total_number_dict_rule["one_total_number_small"] = ""
-                    total_number_dict["one_total_number_small"] = ""
+                    total_number_dict_rule["tnb_1"] = ""
+                    total_number_dict["tnb_1"] = ""
+                    total_number_dict_rule["tns_1"] = ""
+                    total_number_dict["tns_1"] = ""
 
                 # 第二节盘
                 try:
                     two_total_sizes = result['o']["ous2"]["v"]
-                    total_number_dict_rule["two_total_number_big"] = two_total_sizes[1]
-                    total_number_dict["two_total_number_big"] = two_total_sizes[5]
-                    total_number_dict_rule["two_total_number_small"] = two_total_sizes[3]
-                    total_number_dict["two_total_number_small"] = two_total_sizes[7]
+                    total_number_dict_rule["tnb_2"] = two_total_sizes[1]
+                    total_number_dict["tnb_2"] = two_total_sizes[5]
+                    total_number_dict_rule["tns_2"] = two_total_sizes[3]
+                    total_number_dict["tns_2"] = two_total_sizes[7]
                 except:
-                    total_number_dict_rule["two_total_number_big"] = ""
-                    total_number_dict["two_total_number_big"] = ""
-                    total_number_dict_rule["two_total_number_small"] = ""
-                    total_number_dict["two_total_number_small"] = ""
+                    total_number_dict_rule["tnb_2"] = ""
+                    total_number_dict["tnb_2"] = ""
+                    total_number_dict_rule["tns_2"] = ""
+                    total_number_dict["tns_2"] = ""
 
                 # 第三节盘
                 try:
                     three_total_sizes = result['o']["ous3"]["v"]
-                    total_number_dict_rule["three_total_number_big"] = three_total_sizes[1]
-                    total_number_dict["three_total_number_big"] = three_total_sizes[5]
-                    total_number_dict_rule["three_total_number_small"] = three_total_sizes[3]
-                    total_number_dict["three_total_number_small"] = three_total_sizes[7]
+                    total_number_dict_rule["tnb_3"] = three_total_sizes[1]
+                    total_number_dict["tnb_3"] = three_total_sizes[5]
+                    total_number_dict_rule["tns_3"] = three_total_sizes[3]
+                    total_number_dict["tns_3"] = three_total_sizes[7]
                 except:
-                    total_number_dict_rule["three_total_number_big"] = ""
-                    total_number_dict["three_total_number_big"] = ""
-                    total_number_dict_rule["three_total_number_small"] = ""
-                    total_number_dict["three_total_number_small"] = ""
+                    total_number_dict_rule["tnb_3"] = ""
+                    total_number_dict["tnb_3"] = ""
+                    total_number_dict_rule["tns_3"] = ""
+                    total_number_dict["tns_3"] = ""
 
                 # ------------------------------------------------------总局数:单/双-----------------------------------------------------
                 odd_evens_dict = {}
@@ -265,16 +265,16 @@ class WangqiuSpider(scrapy.Spider):
                 try:
                     odd_evens = result['o']["oefts"]["v"]
                     # 上半场 主队让球条件
-                    odd_evens_dict['two_sides_single'] = odd_evens[1]  # 之前是odd_even_odd
-                    odd_evens_dict_rule['two_sides_single'] = "单"
-                    odd_evens_dict['two_sides_double'] = odd_evens[3]
-                    odd_evens_dict_rule['two_sides_double'] = "双"
+                    odd_evens_dict['tss'] = odd_evens[1]  # 之前是odd_even_odd
+                    odd_evens_dict_rule['tss'] = "单"
+                    odd_evens_dict['tsd'] = odd_evens[3]
+                    odd_evens_dict_rule['tsd'] = "双"
 
                 except:
-                    odd_evens_dict['two_sides_single'] = ""
-                    odd_evens_dict['two_sides_double'] = ""
-                    odd_evens_dict_rule['two_sides_double'] = ""
-                    odd_evens_dict_rule['two_sides_single'] = ""
+                    odd_evens_dict['tss'] = ""
+                    odd_evens_dict['tsd'] = ""
+                    odd_evens_dict_rule['tsd'] = ""
+                    odd_evens_dict_rule['tss'] = ""
 
                 # 盘,局,点
                 sq_dict = {}
@@ -304,6 +304,8 @@ class WangqiuSpider(scrapy.Spider):
                             score_dict['four_score'] = str(cp['h']) + '-' + str(cp['a'])
                         elif cp['p'] == 's5':
                             score_dict['five_score'] = str(cp['h']) + '-' + str(cp['a'])
+                        elif cp['p'] == 'ftg':
+                            score_dict['total_inning'] = int(cp['h']) + int(cp['a'])
                         cp.pop('e')
                         cp.pop('adv')
                         cp['cp'] = s

+ 104 - 108
hg3535/spiders/roll_zuqiu.py

@@ -188,35 +188,33 @@ class ZuqiuSpider(scrapy.Spider):
                     try:
                         total_goals = data['o']['tg']['v']
                         new_total_goals = [total_goals[i] for i in range(len(total_goals)) if i % 2 is 1]
-                        total_goal["total_goal_zero"] = round(float(new_total_goals[0]) - 1, 2)
-                        total_goal["total_goal_two"] = round(float(new_total_goals[1]) - 1, 2)
-                        total_goal["total_goal_four"] = round(float(new_total_goals[2]) - 1, 2)
-                        total_goal["total_goal_seven"] = round(float(new_total_goals[3]) - 1, 2)
+                        total_goal["tg0"] = round(float(new_total_goals[0]) - 1, 2)
+                        total_goal["tg1"] = round(float(new_total_goals[1]) - 1, 2)
+                        total_goal["tg2"] = round(float(new_total_goals[2]) - 1, 2)
+                        total_goal["tg3"] = round(float(new_total_goals[3]) - 1, 2)
                     except:
-                        total_goal["total_goal_zero"] = ""
-                        total_goal["total_goal_two"] = ""
-                        total_goal["total_goal_four"] = ""
-                        total_goal["total_goal_seven"] = ""
+                        total_goal["tg0"] = ""
+                        total_goal["tg1"] = ""
+                        total_goal["tg2"] = ""
+                        total_goal["tg3"] = ""
 
 # 总进球上半场 half_total_goal-------------------------------------------------------------------------------------------
                     try:
                         half_total_goals = data['o']['tg1st']['v']
                         new_half_total_goals = [half_total_goals[i] for i in range(len(half_total_goals)) if i % 2 is 1]
-                        total_goal["half_total_goal_zero"] = round(float(new_half_total_goals[0]) - 1, 2)
-                        total_goal["half_total_goal_one"] = round(float(new_half_total_goals[1]) - 1, 2)
-                        total_goal["half_total_goal_two"] = round(float(new_half_total_goals[2]) - 1, 2)
-                        total_goal["half_total_goal_three"] = round(float(new_half_total_goals[3]) - 1, 2)
+                        total_goal["tg0_h"] = round(float(new_half_total_goals[0]) - 1, 2)
+                        total_goal["tg1_h"] = round(float(new_half_total_goals[1]) - 1, 2)
+                        total_goal["tg2_h"] = round(float(new_half_total_goals[2]) - 1, 2)
+                        total_goal["tg3_h"] = round(float(new_half_total_goals[3]) - 1, 2)
                     except:
-                        total_goal["half_total_goal_zero"] = ""
-                        total_goal["half_total_goal_one"] = ""
-                        total_goal["half_total_goal_two"] = ""
-                        total_goal["half_total_goal_three"] = ""
+                        total_goal["tg0_h"] = ""
+                        total_goal["tg1_h"] = ""
+                        total_goal["tg2_h"] = ""
+                        total_goal["tg3_h"] = ""
 
 # 早盘 半场/全场---------------------------------------------------------------------------------------------------------
                     half_full = {}
-                    new_lists = ["half_full_home_home", "half_full_home_dogfall", "half_full_home_guest",
-                                 "half_full_dogfall_home", "half_full_dogfall_dogfall", "half_full_dogfall_guest",
-                                 "half_full_guest_home", "half_full_guest_dogfall", "half_full_guest_guest"]
+                    new_lists = ["hfhh", "hfhd", "hfhg", "hfdh", "hfdd", "hfdg", "hfgh", "hfgd", "hfgg"]
                     # 早盘 半场/全场
                     try:
                         half_fulls = data['o']['hf']['v']
@@ -232,8 +230,8 @@ class ZuqiuSpider(scrapy.Spider):
                     try:
                         first_balls = data['o']['ttslast']['v']
                         first_ball = [first_balls[i] for i in range(len(first_balls)) if i % 2 is 1]
-                        first_last_ball['first_ball_home'] = round(float(first_ball[0]) - 1, 2)
-                        first_last_ball['first_ball_guest'] = round(float(first_ball[1]) - 1, 2)
+                        first_last_ball['flbfh'] = round(float(first_ball[0]) - 1, 2)
+                        first_last_ball['flbfg'] = round(float(first_ball[1]) - 1, 2)
                     except:
                         pass
 
@@ -242,9 +240,9 @@ class ZuqiuSpider(scrapy.Spider):
                     try:
                         last_balls = data['o']['tts1st']['v']
                         last_ball = [last_balls[i] for i in range(len(last_balls)) if i % 2 is 1]
-                        first_last_ball['last_ball_home'] = round(float(last_ball[0]) - 1, 2)
-                        first_last_ball['last_ball_guest'] = round(float(last_ball[1]) - 1, 2)
-                        first_last_ball['not_ball'] = round(float(last_ball[2]) - 1, 2)
+                        first_last_ball['flblh'] = round(float(last_ball[0]) - 1, 2)
+                        first_last_ball['flblg'] = round(float(last_ball[1]) - 1, 2)
+                        first_last_ball['flbn'] = round(float(last_ball[2]) - 1, 2)
                     except:
                         pass
 
@@ -296,16 +294,9 @@ class ZuqiuSpider(scrapy.Spider):
 # 波胆------------------------------------------------------------------------------------------------------------------
                     try:
                         bodans = data['o']['cs']['v']
-                        one_list = ["bodanhome_one_zero", "bodanhome_two_zero", "bodanhome_two_one",
-                                    "bodanhome_three_zero", "bodanhome_three_one", "bodanhome_three_two",
-                                    "bodanhome_four_zero", "bodanhome_four_one", "bodanhome_four_two",
-                                    "bodanhome_four_three"]
-                        two_list = ["bodanguest_one_zero", "bodanguest_two_zero", "bodanguest_two_one",
-                                    "bodanguest_three_zero", "bodanguest_three_one", "bodanguest_three_two",
-                                    "bodanguest_four_zero", "bodanguest_four_one", "bodanguest_four_two",
-                                    "bodanguest_four_three"]
-                        three_list = ["bodandogfall_zero_zero", "bodandogfall_one_one", "bodandogfall_two_two",
-                                      "bodandogfall_three_three", "bodandogfall_four_four"]
+                        one_list = ["b10", "b20", "b21", "b30", "b31", "b32", "b40", "b41", "b42", "b43"]
+                        two_list = ["b01", "b02", "b12", "b03", "b13", "b23", "b04", "b14", "b24", "b34"]
+                        three_list = ["b00", "b11", "b22", "b33", "b44"]
                         new_bodans = [bodans[i] for i in range(len(bodans)) if i % 2 is 1]
                         new_bodan = new_bodans[0:20]
                         # 主队bodan_home
@@ -327,13 +318,9 @@ class ZuqiuSpider(scrapy.Spider):
                     try:
                         half_bodans = data['o']['cs1st']['v']
                         new_half_bodans = [half_bodans[i] for i in range(len(half_bodans)) if i % 2 is 1]
-                        new_one = ["halfbodanhome_one_zero", "halfbodanhome_two_zero", "halfbodanhome_two_one",
-                                   "halfbodanhome_three_zero", "halfbodanhome_three_one", "halfbodanhome_three_two"]
-                        new_two = ["halfbodanguest_one_zero", "halfbodanguest_two_zero", "halfbodanguest_two_one",
-                                   "halfbodanguest_three_zero", "halfbodanguest_three_one", "halfbodanguest_three_two"]
-                        new_three = ["halfbodandogfall_zero_zero", "halfbodandogfall_one_one",
-                                     "halfbodandogfall_two_two",
-                                     "halfbodandogfall_three_three"]
+                        new_one = ["b10_h", "b20_h", "b21_h", "b30_h", "b31_h", "b32_h"]
+                        new_two = ["b01_h", "b02_h", "b12_h", "b03_h", "b13_h", "b23_h"]
+                        new_three = ["b00_h", "b11_h", "b22_h", "b33_h"]
                         halfbodan = new_half_bodans[0:12]
                         half_bodan_home = [halfbodan[i] for i in range(len(halfbodan)) if i % 2 is 0]
                         # 队1
@@ -355,90 +342,99 @@ class ZuqiuSpider(scrapy.Spider):
                     try:
                         home_data = data['o']['ou']['v']
 
+                        # # 球队进球 大条件
+                        # home_size_big_rule = home_data[1]
+                        # full_dict_rule['home_tema_ball_big'] = home_size_big_rule
+                        # # 球队进球大赔率
+                        # home_size_big = home_data[5]
+                        # full_dict['home_tema_ball_big'] = home_size_big
+                        # # 球队进球小条件
+                        # home_size_small_rule = home_data[3]
+                        # full_dict_rule['home_tema_ball_small'] = home_size_small_rule
+                        # # 球队进球小赔率
+                        # home_size_small = home_data[7]
+                        # full_dict['home_tema_ball_small'] = home_size_small
                         # 球队进球 大条件
-                        home_size_big_rule = home_data[1]
-                        full_dict_rule['home_tema_ball_big'] = home_size_big_rule
-
-                        # 球队进球大赔率
-                        home_size_big = home_data[5]
-                        full_dict['home_tema_ball_big'] = home_size_big
-
+                        full_dict_rule['tbhb'] = home_data[1]
                         # 球队进球小条件
-                        home_size_small_rule = home_data[3]
-                        full_dict_rule['home_tema_ball_small'] = home_size_small_rule
-
+                        full_dict_rule['tbhs'] = home_data[3]
+                        # 球队进球大赔率
+                        full_dict['tbhb'] = home_data[5]
                         # 球队进球小赔率
-                        home_size_small = home_data[7]
-                        full_dict['home_tema_ball_small'] = home_size_small
+                        full_dict['tbhs'] = home_data[7]
                     except:
-                        full_dict['home_tema_ball_small'] = ""
-                        full_dict_rule['home_tema_ball_small'] = ""
-
-                        full_dict['home_tema_ball_big'] = ""
-                        full_dict_rule['home_tema_ball_big'] = ""
+                        full_dict['tbhs'] = ""
+                        full_dict_rule['tbhs'] = ""
+                        full_dict['tbhb'] = ""
+                        full_dict_rule['tbhb'] = ""
                     try:
                         half_home_data = data['o']['ou1st']['v']
-
-                        half_home_size_big_rule = half_home_data[1]
-                        half_dict_rule['half_home_tema_ball_big'] = half_home_size_big_rule
-
-                        half_home_size_big = half_home_data[5]
-                        half_dict['half_home_tema_ball_big'] = half_home_size_big
-
-                        half_home_size_small_rule = half_home_data[3]
-                        half_dict_rule['half_home_tema_ball_small'] = half_home_size_small_rule
-
-                        half_home_size_small = half_home_data[7]
-                        half_dict['half_home_tema_ball_small'] = half_home_size_small
+                        # half_home_size_big_rule = half_home_data[1]
+                        # half_dict_rule['half_home_tema_ball_big'] = half_home_size_big_rule
+                        # half_home_size_big = half_home_data[5]
+                        # half_dict['half_home_tema_ball_big'] = half_home_size_big
+                        # half_home_size_small_rule = half_home_data[3]
+                        # half_dict_rule['half_home_tema_ball_small'] = half_home_size_small_rule
+                        # half_home_size_small = half_home_data[7]
+                        # half_dict['half_home_tema_ball_small'] = half_home_size_small
+                        half_dict_rule['tbhb_h'] = half_home_data[1]
+                        half_dict_rule['tbhs_h'] = half_home_data[3]
+                        half_dict['tbhb_h'] = half_home_data[5]
+                        half_dict['tbhs_h'] = half_home_data[7]
 
                     except:
-                        half_dict_rule['half_home_tema_ball_big'] = ""
-                        half_dict['half_home_tema_ball_big'] = ""
-
-                        half_dict_rule['half_home_tema_ball_small'] = ""
-                        half_dict['half_home_tema_ball_small'] = ""
+                        half_dict_rule['tbhb_h'] = ""
+                        half_dict['tbhb_h'] = ""
+                        half_dict_rule['tbhs_h'] = ""
+                        half_dict['tbhs_h'] = ""
 
                 if new_data == 13:
                     try:
                         guest_data = data['o']['ou']['v']
-
-                        guest_size_big_rule = guest_data[1]
-                        full_dict_rule['guest_tema_ball_big'] = guest_size_big_rule
-
-                        guest_size_big = guest_data[5]
-                        full_dict['guest_tema_ball_big'] = guest_size_big
-
-                        guest_size_small_rule = guest_data[3]
-                        full_dict_rule['guest_tema_ball_small'] = guest_size_small_rule
-
-                        guest_size_small = guest_data[7]
-                        full_dict['guest_tema_ball_small'] = guest_size_small
+                        #
+                        # guest_size_big_rule = guest_data[1]
+                        # full_dict_rule['guest_tema_ball_big'] = guest_size_big_rule
+                        #
+                        # guest_size_big = guest_data[5]
+                        # full_dict['guest_tema_ball_big'] = guest_size_big
+                        #
+                        # guest_size_small_rule = guest_data[3]
+                        # full_dict_rule['guest_tema_ball_small'] = guest_size_small_rule
+                        #
+                        # guest_size_small = guest_data[7]
+                        # full_dict['guest_tema_ball_small'] = guest_size_small
+                        full_dict_rule['tbgb'] = guest_data[1]
+                        full_dict_rule['tbgs'] = guest_data[3]
+                        full_dict['tbgb'] = guest_data[5]
+                        full_dict['tbgs'] = guest_data[7]
                     except:
-                        full_dict_rule['guest_tema_ball_big'] = ""
-                        full_dict['guest_tema_ball_big'] = ""
-
-                        full_dict_rule['guest_tema_ball_small'] = ""
-                        full_dict['guest_tema_ball_small'] = ''
+                        full_dict_rule['tbgb'] = ""
+                        full_dict['tbgb'] = ""
+                        full_dict_rule['tbgs'] = ""
+                        full_dict['tbgs'] = ''
                     try:
                         half_guest_data = data['o']['ou1st']['v']
 
-                        half_guest_size_big_rule = half_guest_data[1]
-                        half_dict_rule['half_guest_tema_ball_big'] = half_guest_size_big_rule
-
-                        half_guest_size_big = half_guest_data[5]
-                        half_dict['half_guest_tema_ball_big'] = half_guest_size_big
-
-                        half_guest_size_small_rule = half_guest_data[3]
-                        half_dict_rule['half_guest_tema_ball_small'] = half_guest_size_small_rule
-
-                        half_guest_size_small = half_guest_data[7]
-                        half_dict['half_guest_tema_ball_small'] = half_guest_size_small
+                        # half_guest_size_big_rule = half_guest_data[1]
+                        # half_dict_rule['half_guest_tema_ball_big'] = half_guest_size_big_rule
+                        #
+                        # half_guest_size_big = half_guest_data[5]
+                        # half_dict['half_guest_tema_ball_big'] = half_guest_size_big
+                        #
+                        # half_guest_size_small_rule = half_guest_data[3]
+                        # half_dict_rule['half_guest_tema_ball_small'] = half_guest_size_small_rule
+                        #
+                        # half_guest_size_small = half_guest_data[7]
+                        # half_dict['half_guest_tema_ball_small'] = half_guest_size_small
+                        half_dict_rule['tbgb_h'] = half_guest_data[1]
+                        half_dict_rule['tbgs_h'] = half_guest_data[3]
+                        half_dict['tbgb_h'] = half_guest_data[5]
+                        half_dict['tbgs_h'] = half_guest_data[7]
                     except:
-                        half_dict_rule['half_guest_tema_ball_big'] = ""
-                        half_dict['half_guest_tema_ball_big'] = ""
-
-                        half_dict_rule['half_guest_tema_ball_small'] = ""
-                        half_dict['half_guest_tema_ball_small'] = ""
+                        half_dict_rule['tbgb_h'] = ""
+                        half_dict['tbgb_h'] = ""
+                        half_dict_rule['tbgs_h'] = ""
+                        half_dict['tbgs_h'] = ""
             item['league_id'] = league_id
             item['league_name'] = league_name
             item['game_id'] = game_id

+ 65 - 65
hg3535/spiders/wangqiu.py

@@ -25,7 +25,7 @@ class LanqiuSpider(scrapy.Spider):
     def start_requests(self):
         # newall_lists = ['am', 'ftht1x2', 'oe', 'tg', 'htft', 'cs', 'fglg', 'or']
         for y in range(1, 4):
-            # url = 'https://hg3535z.com/odds2/d/getodds?sid=3&pt=' + str(y) + '&ubt=am&pn=0&sb=2&dc=null&pid=0'
+            # url = 'https://hg3535z.com/odds2/d/getodds?sid=3&pt='+str(y)+'&ubt=am&pn=0&sb=2&dc=null&pid=0'
             url = 'https://odata.jiushan6688.com/odds6i/d/getodds/zh-cn/sid/3/pt/' + str(
                 y) + '/ubt/am/pn/0/sb/2/dc/null/pid/0'
             yield scrapy.Request(url=url, callback=self.parse, meta={'pt': y}, dont_filter=True)
@@ -46,7 +46,7 @@ class LanqiuSpider(scrapy.Spider):
                     for new_result in new_results:
                         game_id = str(new_result['i'][16])
                         if pt == 1:
-                            # url = "https://hg3535z.com/odds2/d/getamodds?eid=" + game_id + "&iip=false&ubt=am&isp=false"
+                            #     url = "https://hg3535z.com/odds2/d/getamodds?eid=" + game_id + "&iip=false&ubt=am&isp=false"
                             url = "https://odata.jiushan6688.com/odds6i/d/getamodds/zh-cn/eid/" + game_id + "/iip/false/ubt/am/isp/false"
                             yield Request(url=url, callback=self.parse_each, meta={'pt': pt}, dont_filter=True)
                         if pt == 2:
@@ -102,38 +102,38 @@ class LanqiuSpider(scrapy.Spider):
                 concedes_dict_rule = {}
                 try:
                     concedes = result['o']["ah"]["v"]
-                    concedes_dict_rule['dishes_home'] = concedes[1]
-                    concedes_dict_rule['dishes_guest'] = concedes[3]
+                    concedes_dict_rule['ldh'] = concedes[1]  # 主队
+                    concedes_dict_rule['ldg'] = concedes[3]  # 客队
                     if pt is 3:
-                        concedes_dict['dishes_home'] = float(concedes[5]) - 1
-                        concedes_dict['dishes_guest'] = float(concedes[7]) - 1
+                        concedes_dict['ldh'] = float(concedes[5]) - 1
+                        concedes_dict['ldg'] = float(concedes[7]) - 1
                     else:
-                        concedes_dict['dishes_guest'] = concedes[7]
-                        concedes_dict['dishes_home'] = float(concedes[5])
+                        concedes_dict['ldg'] = concedes[7]
+                        concedes_dict['ldh'] = float(concedes[5])
                 except:
-                    concedes_dict_rule['dishes_home'] = ""
-                    concedes_dict['dishes_home'] = ""
-                    concedes_dict_rule['dishes_guest'] = ""
-                    concedes_dict['dishes_guest'] = ""
+                    concedes_dict_rule['ldh'] = ""
+                    concedes_dict['ldh'] = ""
+                    concedes_dict_rule['ldg'] = ""
+                    concedes_dict['ldg'] = ""
                 # ---------------------------------------------------冠军----------------------------------------------------------------
                 kemps_dict = {}
                 try:
                     kemps = result['o']["ml"]["v"]
-                    kemps_dict['kemp_home'] = kemps[1]
-                    kemps_dict['kemp_guest'] = kemps[3]
+                    kemps_dict['ch'] = kemps[1]  # 主队
+                    kemps_dict['cg'] = kemps[3]  # 客队
 
                 except:
-                    kemps_dict['kemp_home'] = ""
-                    kemps_dict['kemp_guest'] = ""
+                    kemps_dict['ch'] = ""
+                    kemps_dict['cg'] = ""
                 # 第一盘 冠军
                 try:
                     kemps = result['o']["mls1"]["v"]
-                    kemps_dict['one_kemp_home'] = kemps[1]
-                    kemps_dict['one_kemp_guest'] = kemps[3]
+                    kemps_dict['ch_1'] = kemps[1]
+                    kemps_dict['cg_1'] = kemps[3]
 
                 except:
-                    kemps_dict['one_kemp_home'] = ""
-                    kemps_dict['one_kemp_guest'] = ""
+                    kemps_dict['ch_1'] = ""
+                    kemps_dict['cg_1'] = ""
 
                 # ---------------------------------------------------让局---------------------------------------------------------------
 
@@ -141,19 +141,19 @@ class LanqiuSpider(scrapy.Spider):
                 bureaus_dict_rule = {}
                 try:
                     bureaus = result['o']["ahfts"]["v"]
-                    bureaus_dict_rule['concede_home'] = bureaus[1]
-                    bureaus_dict_rule['concede_guest'] = bureaus[3]
+                    bureaus_dict_rule['lbh'] = bureaus[1]  # 主队
+                    bureaus_dict_rule['lbg'] = bureaus[3]  # 客队
                     if pt is 3:
-                        bureaus_dict['concede_home'] = float(bureaus[5]) - 1
-                        bureaus_dict['concede_guest'] = float(bureaus[7]) - 1
+                        bureaus_dict['lbh'] = float(bureaus[5]) - 1
+                        bureaus_dict['lbg'] = float(bureaus[7]) - 1
                     else:
-                        bureaus_dict['concede_home'] = bureaus[5]
-                        bureaus_dict['concede_guest'] = bureaus[7]
+                        bureaus_dict['lbh'] = bureaus[5]
+                        bureaus_dict['lbg'] = bureaus[7]
                 except:
-                    bureaus_dict_rule['concede_home'] = ""
-                    bureaus_dict['concede_home'] = ""
-                    bureaus_dict_rule['concede_guest'] = ""
-                    bureaus_dict['concede_guest'] = ""
+                    bureaus_dict_rule['lbh'] = ""
+                    bureaus_dict['lbh'] = ""
+                    bureaus_dict_rule['lbg'] = ""
+                    bureaus_dict['lbg'] = ""
 
                 # -----------------------------------------------------总局数:大/小------------------------------------------------------
                 # 总局数大小第一盘 未采集
@@ -161,37 +161,37 @@ class LanqiuSpider(scrapy.Spider):
                 total_number_dict_rule = {}
                 try:
                     total_numbers = result['o']["oufts"]["v"]
-                    total_number_dict_rule['total_number_big'] = total_numbers[1]
-                    total_number_dict_rule['total_number_small'] = total_numbers[3]
+                    total_number_dict_rule['tnb'] = total_numbers[1]
+                    total_number_dict_rule['tns'] = total_numbers[3]
                     if pt is 3:
-                        total_number_dict['total_number_big'] = float(total_numbers[5]) - 1
-                        total_number_dict['total_number_small'] = float(total_numbers[7]) - 1
+                        total_number_dict['tnb'] = float(total_numbers[5]) - 1
+                        total_number_dict['tns'] = float(total_numbers[7]) - 1
                     else:
-                        total_number_dict['total_number_big'] = total_numbers[5]
-                        total_number_dict['total_number_small'] = total_numbers[7]
+                        total_number_dict['tnb'] = total_numbers[5]
+                        total_number_dict['tns'] = total_numbers[7]
                 except:
-                    total_number_dict_rule['total_number_big'] = ""
-                    total_number_dict['total_number_big'] = ""
-                    total_number_dict_rule['total_number_small'] = ""
-                    total_number_dict['total_number_small'] = ""
+                    total_number_dict_rule['tnb'] = ""
+                    total_number_dict['tnb'] = ""
+                    total_number_dict_rule['tns'] = ""
+                    total_number_dict['tns'] = ""
                 # 第一节盘
-                # try:
-                #     one_total_sizes = result['o']["ous1"]["v"]
-                #     total_number_dict_rule["one_total_number_big"] = one_total_sizes[1]
-                #     total_number_dict["one_total_number_big"] = one_total_sizes[5]
-                #     total_number_dict_rule["one_total_number_small"] = one_total_sizes[3]
-                #     total_number_dict["one_total_number_small"] = one_total_sizes[7]
-                #     if pt is 3:
-                #         total_number_dict['total_number_big'] = float(one_total_sizes[5]) - 1
-                #         total_number_dict['total_number_small'] = float(one_total_sizes[7]) - 1
-                #     else:
-                #         total_number_dict['total_number_big'] = one_total_sizes[5]
-                #         total_number_dict['total_number_small'] = one_total_sizes[7]
-                # except:
-                #     total_number_dict_rule["one_total_number_big"] = ""
-                #     total_number_dict["one_total_number_big"] = ""
-                #     total_number_dict_rule["one_total_number_small"] = ""
-                #     total_number_dict["one_total_number_small"] = ""
+                try:
+                    one_total_sizes = result['o']["ous1"]["v"]
+                    total_number_dict_rule["tnb_1"] = one_total_sizes[1]
+                    total_number_dict["tnb_1"] = one_total_sizes[5]
+                    total_number_dict_rule["tns_1"] = one_total_sizes[3]
+                    total_number_dict["tns_1"] = one_total_sizes[7]
+                    if pt is 3:
+                        total_number_dict['tnb_1'] = float(one_total_sizes[5]) - 1
+                        total_number_dict['tns_1'] = float(one_total_sizes[7]) - 1
+                    else:
+                        total_number_dict['tnb_1'] = one_total_sizes[5]
+                        total_number_dict['tns_1'] = one_total_sizes[7]
+                except:
+                    total_number_dict_rule["tnb_1"] = ""
+                    total_number_dict["tnb_1"] = ""
+                    total_number_dict_rule["tns_1"] = ""
+                    total_number_dict["tns_1"] = ""
 
                 # ------------------------------------------------------总局数:单/双-----------------------------------------------------
                 odd_evens_dict = {}
@@ -199,16 +199,16 @@ class LanqiuSpider(scrapy.Spider):
                 try:
                     odd_evens = result['o']["oefts"]["v"]
                     # 上半场 主队让球条件
-                    odd_evens_dict['two_sides_single'] = odd_evens[1]
-                    odd_evens_dict_rule['two_sides_single'] = "单"
-                    odd_evens_dict['two_sides_double'] = odd_evens[3]
-                    odd_evens_dict_rule['two_sides_double'] = "双"
+                    odd_evens_dict['tss'] = odd_evens[1]
+                    odd_evens_dict_rule['tss'] = "单"
+                    odd_evens_dict['tsb'] = odd_evens[3]
+                    odd_evens_dict_rule['tsb'] = "双"
 
                 except:
-                    odd_evens_dict['two_sides_single'] = ""
-                    odd_evens_dict['two_sides_double'] = ""
-                    odd_evens_dict_rule['two_sides_single'] = ""
-                    odd_evens_dict_rule['two_sides_double'] = ""
+                    odd_evens_dict['tss'] = ""
+                    odd_evens_dict['tsb'] = ""
+                    odd_evens_dict_rule['tss'] = ""
+                    odd_evens_dict_rule['tsb'] = ""
 
                 # 联赛id
                 item['league_id'] = league_id

+ 0 - 58
hg3535/spiders/wq_jieshu.py

@@ -1,58 +0,0 @@
-# -*- coding: utf-8 -*-
-import datetime
-import re
-
-import scrapy
-
-from ..items import Wangjieguo
-
-
-class HgjieshuSpider(scrapy.Spider):
-    name = 'wq_jieshu'
-    to_day = datetime.datetime.now()
-    allowed_domains = ['hg3535z.com']
-    custom_settings = {
-        "ITEM_PIPELINES":{
-            'hg3535.pipeline.Wangjieshuqiupipeline': 300,
-        },
-        'LOG_LEVEL': 'DEBUG',
-        'LOG_FILE': "../hg3535/log/wq_jieshu_{}_{}_{}.log".format(to_day.year, to_day.month, to_day.day)
-    }
-    start_urls = ['https://hg3535z.com/zh-cn/info-centre/sportsbook-info/results/3/normal/1', 'https://hg3535z.com/zh-cn/info-centre/sportsbook-info/results/3/normal/1']
-
-    def parse(self, response):
-        if response.status == 200:
-            # 所有比赛对象
-            # tema = response.xpath('//div[@class="rt-event"]//span[@class="pt"]/text()')
-            # print(tema)
-            # 所有比赛队名
-            # tema_name = [i.extract() for i in tema]
-            # 获得所有比分对象
-            # tema_score = response.xpath('//div[contains(@class,"rt-set")]')
-            tema_score = response.xpath('//div[@class="flex-wrap"]/../div[5]')
-            # 获得所有比赛id对象
-            tema_id = response.xpath('//div[@class="flex-wrap"]/../div[1]/@id')
-            # str.replace()
-            # 所有比赛id列表
-            temaid_list = [i.extract().replace('e-', "") for i in tema_id]
-            temascore_list = []
-            for score in tema_score:
-                # 正则匹配规则
-                p1 = r"\d{1,3}-\d{1,3}"
-                pattern1 = re.compile(p1)
-                try:
-                    # 获取正则匹配结果
-                    c = pattern1.findall(score.extract())[0]
-                    temascore_list.append(c)
-                except:
-                    c = ""
-                    temascore_list.append(c)
-            # 赛事id,赛事比元组列表
-            tema_tupe = {(temaid_list[i], temascore_list[i]) for i in range(len(temaid_list))}
-            id_list = []
-            item = Wangjieguo()
-            for y in tema_tupe:
-                if y[1]:
-                    id_list.append(y[0])
-            item['id_score'] = id_list
-            yield item

+ 2 - 2
hg3535/spiders/wqbodan.py

@@ -18,8 +18,8 @@ class WgbodanSpider(scrapy.Spider):
         "ITEM_PIPELINES": {
             'hg3535.pipeline.Wqbodanpipeline': 300,
         },
-        'LOG_LEVEL': 'DEBUG',
-        'LOG_FILE': "../hg3535/log/wqbodan_{}_{}_{}.log".format(to_day.year, to_day.month, to_day.day)
+        # 'LOG_LEVEL': 'DEBUG',
+        # 'LOG_FILE': "../hg3535/log/wqbodan_{}_{}_{}.log".format(to_day.year, to_day.month, to_day.day)
     }
 
     def start_requests(self):

+ 0 - 61
hg3535/spiders/zq_jieshu.py

@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-# import re
-import datetime
-import re
-
-import scrapy
-
-from ..items import Zujieguo
-
-
-class HgjieshuSpider(scrapy.Spider):
-    name = 'zq_jieshu'
-    to_day = datetime.datetime.now()
-    allowed_domains = ['hg3535z.com']
-    custom_settings = {
-        "ITEM_PIPELINES":{
-            'hg3535.pipeline.Zujieshuqiupipeline': 300,
-        },
-        # 'LOG_LEVEL': 'DEBUG',
-        # 'LOG_FILE': "../hg3535/log/zq_jieshu_{}_{}_{}.log".format(to_day.year, to_day.month, to_day.day)
-    }
-    start_urls = ['https://hg3535z.com/zh-cn/info-centre/sportsbook-info/results/1/normal/1']
-
-    def parse(self, response):
-        if response.status == 200:
-            # 所有比赛对象
-            # tema = response.xpath('//div[@class="rt-event"]//span[@class="pt"]/text()')
-            # print(tema)
-            # 所有比赛队名
-            # tema_name = [i.extract() for i in tema]
-            # 获得所有比分对象
-            # tema_score = response.xpath('//div[contains(@class,"rt-ft ")]')
-            tema_score = response.xpath('//div[@class="flex-wrap"]/../div[5]')
-            # print(tema_score)
-            # 获得所有比赛id对象
-            tema_id = response.xpath('//div[@class="flex-wrap"]/../div[1]/@id')
-            # str.replace()
-            # 所有比赛id列表
-            temaid_list = [i.extract().replace('e-', "") for i in tema_id]
-            temascore_list = []
-            for score in tema_score:
-                # 正则匹配规则
-                p1 = r"\d{1,3}-\d{1,3}"
-                pattern1 = re.compile(p1)
-                try:
-                    # 获取正则匹配结果
-                    c = pattern1.findall(score.extract())[0]
-                    temascore_list.append(c)
-                except:
-                    c = ""
-                    temascore_list.append(c)
-            # 赛事id,赛事比元组列表
-            tema_tupe = {(temaid_list[i], temascore_list[i]) for i in range(len(temaid_list))}
-            print(tema_tupe)
-            id_list = []
-            item = Zujieguo()
-            for y in tema_tupe:
-                if y[1]:
-                    id_list.append(y[0])
-            item['id_score'] = id_list
-            yield item

+ 84 - 101
hg3535/spiders/zuqiu.py

@@ -4,7 +4,7 @@ import json
 
 import scrapy
 from scrapy.http import Request
-from .. items import Zuqiu
+from ..items import Zuqiu
 import datetime
 
 
@@ -14,7 +14,7 @@ class ZuqiuSpider(scrapy.Spider):
     # print(to_day.year, to_day)
     allowed_domains = ['hg3535z.com']
     custom_settings = {
-        "ITEM_PIPELINES":{
+        "ITEM_PIPELINES": {
             'hg3535.pipeline.zuqiu.Zuqiupipeline': 300,
         },
         # 'LOG_LEVEL': 'DEBUG',
@@ -32,7 +32,7 @@ class ZuqiuSpider(scrapy.Spider):
                 y = str(y)
                 i = str(i)
                 # yield y
-                url = "https://odata.jiushan6688.com/odds6i/d/getodds/zh-cn/sid/1/pt/"+y+"/ubt/am/pn/"+i+"/sb/2/dc/null/pid/0"
+                url = "https://odata.jiushan6688.com/odds6i/d/getodds/zh-cn/sid/1/pt/" + y + "/ubt/am/pn/" + i + "/sb/2/dc/null/pid/0"
                 yield scrapy.Request(url=url, callback=self.parse, dont_filter=True, meta={'pt': y})
 
     def parse(self, response):
@@ -50,16 +50,16 @@ class ZuqiuSpider(scrapy.Spider):
                     new_results = result['es']
                     for new_result in new_results:
                         game_id = str(new_result['i'][16])
-                        pass
                         if pt == "3":
-                            url = "https://odata.jiushan6688.com/odds6i/d/getamodds/zh-cn/eid/"+str(game_id)+"/iip/false/ubt/am/isp/true"
+                            url = "https://odata.jiushan6688.com/odds6i/d/getamodds/zh-cn/eid/" + str(game_id) + "/iip/false/ubt/am/isp/true"
                             yield Request(url=url, callback=self.parse_each, dont_filter=True, meta={'pt': pt})
                         if pt == "2":
-                            url = "https://odata.jiushan6688.com/odds6i/d/getamodds/zh-cn/eid/"+str(game_id)+"/iip/false/ubt/am/isp/false"
+                            url = "https://odata.jiushan6688.com/odds6i/d/getamodds/zh-cn/eid/" + str(game_id) + "/iip/false/ubt/am/isp/false"
                             yield Request(url=url, callback=self.parse_each, dont_filter=True, meta={'pt': pt})
                         if pt == "1":
-                            url = "https://odata.jiushan6688.com/odds6i/d/getamodds/zh-cn/eid/"+str(game_id)+"/iip/false/ubt/am/isp/false"
+                            url = "https://odata.jiushan6688.com/odds6i/d/getamodds/zh-cn/eid/" + str(game_id) + "/iip/false/ubt/am/isp/false"
                             yield Request(url=url, callback=self.parse_each, dont_filter=True, meta={'pt': pt})
+
     #
     def parse_each(self, response):
         if response.status == 200:
@@ -124,7 +124,7 @@ class ZuqiuSpider(scrapy.Spider):
                             concede_guest_rule = [concede_guests[i] for i in range(len(concede_guests)) if
                                                   i % 2 == 0]
                             if pt is 3:
-                                concede_guest = [round(float(concede_guests[i]) -1, 2) for i in range(len(concede_guests)) if i % 2 is 1]
+                                concede_guest = [round(float(concede_guests[i]) - 1, 2) for i in range(len(concede_guests)) if i % 2 is 1]
                                 concede_home = [round(float(concede_homes[i]) - 1, 2) for i in range(len(concede_homes)) if i % 2 is 1]
                             else:
                                 concede_guest = [concede_guests[i] for i in range(len(concede_guests)) if i % 2 is 1]
@@ -149,8 +149,10 @@ class ZuqiuSpider(scrapy.Spider):
                             half_concede_guest_rule = [half_concede_guests[i] for i in
                                                        range(len(half_concede_guests)) if i % 2 == 0]
                             if pt is 3:
-                                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]
-                                half_concede_guest = [round(float(half_concede_guests[i]) - 1, 2) for i in range(len(half_concede_guests)) if i % 2 is 1]
+                                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]
+                                half_concede_guest = [round(float(half_concede_guests[i]) - 1, 2) for i in range(len(half_concede_guests)) if
+                                                      i % 2 is 1]
                             else:
                                 half_concede_home = [new_half_concede_homes[i] for i in range(len(new_half_concede_homes)) if i % 2 is 1]
                                 half_concede_guest = [half_concede_guests[i] for i in range(len(half_concede_guests)) if i % 2 is 1]
@@ -217,35 +219,33 @@ class ZuqiuSpider(scrapy.Spider):
                         try:
                             total_goals = data['o']['tg']['v']
                             new_total_goals = [total_goals[i] for i in range(len(total_goals)) if i % 2 is 1]
-                            total_goal["total_goal_zero"] = round(float(new_total_goals[0]) - 1, 2)
-                            total_goal["total_goal_two"] = round(float(new_total_goals[1]) - 1, 2)
-                            total_goal["total_goal_four"] = round(float(new_total_goals[2]) - 1, 2)
-                            total_goal["total_goal_seven"] = round(float(new_total_goals[3]) - 1, 2)
+                            total_goal["tg0"] = round(float(new_total_goals[0]) - 1, 2)
+                            total_goal["tg1"] = round(float(new_total_goals[1]) - 1, 2)
+                            total_goal["tg2"] = round(float(new_total_goals[2]) - 1, 2)
+                            total_goal["tg3"] = round(float(new_total_goals[3]) - 1, 2)
                         except:
-                            total_goal["total_goal_zero"] = ""
-                            total_goal["total_goal_two"] = ""
-                            total_goal["total_goal_four"] = ""
-                            total_goal["total_goal_seven"] = ""
+                            total_goal["tg0"] = ""
+                            total_goal["tg1"] = ""
+                            total_goal["tg2"] = ""
+                            total_goal["tg3"] = ""
 
 # 总进球上半场 half_total_goal-------------------------------------------------------------------------------------------
                         try:
                             half_total_goals = data['o']['tg1st']['v']
                             new_half_total_goals = [half_total_goals[i] for i in range(len(half_total_goals)) if i % 2 is 1]
-                            total_goal["half_total_goal_zero"] = round(float(new_half_total_goals[0]) - 1, 2)
-                            total_goal["half_total_goal_one"] = round(float(new_half_total_goals[1]) - 1, 2)
-                            total_goal["half_total_goal_two"] = round(float(new_half_total_goals[2]) - 1, 2)
-                            total_goal["half_total_goal_three"] = round(float(new_half_total_goals[3]) - 1, 2)
+                            total_goal["tg0_h"] = round(float(new_half_total_goals[0]) - 1, 2)
+                            total_goal["tg1_h"] = round(float(new_half_total_goals[1]) - 1, 2)
+                            total_goal["tg2_h"] = round(float(new_half_total_goals[2]) - 1, 2)
+                            total_goal["tg3_h"] = round(float(new_half_total_goals[3]) - 1, 2)
                         except:
-                            total_goal["half_total_goal_zero"] = ""
-                            total_goal["half_total_goal_one"] = ""
-                            total_goal["half_total_goal_two"] = ""
-                            total_goal["half_total_goal_three"] = ""
+                            total_goal["tg0_h"] = ""
+                            total_goal["tg1_h"] = ""
+                            total_goal["tg2_h"] = ""
+                            total_goal["tg3_h"] = ""
 
 # 早盘 半场/全场---------------------------------------------------------------------------------------------------------
                         half_full = {}
-                        new_lists = ["half_full_home_home", "half_full_home_dogfall", "half_full_home_guest",
-                                     "half_full_dogfall_home", "half_full_dogfall_dogfall", "half_full_dogfall_guest",
-                                     "half_full_guest_home", "half_full_guest_dogfall", "half_full_guest_guest"]
+                        new_lists = ["hfhh", "hfhd", "hfhg", "hfdh", "hfdd", "hfdg", "hfgh", "hfgd", "hfgg"]
                         # 早盘 半场/全场
                         try:
                             half_fulls = data['o']['hf']['v']
@@ -261,8 +261,8 @@ class ZuqiuSpider(scrapy.Spider):
                         try:
                             first_balls = data['o']['ttslast']['v']
                             first_ball = [first_balls[i] for i in range(len(first_balls)) if i % 2 is 1]
-                            first_last_ball['first_ball_home'] = round(float(first_ball[0]) - 1, 2)
-                            first_last_ball['first_ball_guest'] = round(float(first_ball[1]) - 1, 2)
+                            first_last_ball['flbfh'] = round(float(first_ball[0]) - 1, 2)
+                            first_last_ball['flbfg'] = round(float(first_ball[1]) - 1, 2)
                         except:
                             pass
 
@@ -271,9 +271,9 @@ class ZuqiuSpider(scrapy.Spider):
                         try:
                             last_balls = data['o']['tts1st']['v']
                             last_ball = [last_balls[i] for i in range(len(last_balls)) if i % 2 is 1]
-                            first_last_ball['last_ball_home'] = round(float(last_ball[0]) - 1, 2)
-                            first_last_ball['last_ball_guest'] = round(float(last_ball[1]) - 1, 2)
-                            first_last_ball['not_ball'] = round(float(last_ball[2]) - 1, 2)
+                            first_last_ball['flblh'] = round(float(last_ball[0]) - 1, 2)
+                            first_last_ball['flblg'] = round(float(last_ball[1]) - 1, 2)
+                            first_last_ball['flbn'] = round(float(last_ball[2]) - 1, 2)
                         except:
                             pass
 
@@ -302,7 +302,7 @@ class ZuqiuSpider(scrapy.Spider):
                             half_capot_guest = ""
                             half_capot_dogfall = ""
 
-    # 全场入球:单/双 odd_even------------------------------------------------------------------------------------------------
+# 全场入球:单/双 odd_even------------------------------------------------------------------------------------------------
                         try:
                             odd_evens = data['o']['oe']['v']
                             new_odd_evens = [odd_evens[i] for i in range(len(odd_evens)) if i % 2 is 1]
@@ -330,19 +330,12 @@ class ZuqiuSpider(scrapy.Spider):
                             half_odd_even_even = ""
 
                         bodan_data = {}
-    # 波胆------------------------------------------------------------------------------------------------------------------
+# 波胆------------------------------------------------------------------------------------------------------------------
                         try:
                             bodans = data['o']['cs']['v']
-                            one_list = ["bodanhome_one_zero", "bodanhome_two_zero", "bodanhome_two_one",
-                                        "bodanhome_three_zero", "bodanhome_three_one", "bodanhome_three_two",
-                                        "bodanhome_four_zero", "bodanhome_four_one", "bodanhome_four_two",
-                                        "bodanhome_four_three"]
-                            two_list = ["bodanguest_one_zero", "bodanguest_two_zero", "bodanguest_two_one",
-                                        "bodanguest_three_zero", "bodanguest_three_one", "bodanguest_three_two",
-                                        "bodanguest_four_zero", "bodanguest_four_one", "bodanguest_four_two",
-                                        "bodanguest_four_three"]
-                            three_list = ["bodandogfall_zero_zero", "bodandogfall_one_one", "bodandogfall_two_two",
-                                          "bodandogfall_three_three", "bodandogfall_four_four"]
+                            one_list = ["b10", "b20", "b21", "b30", "b31", "b32", "b40", "b41", "b42", "b43"]
+                            two_list = ["b01", "b02", "b12", "b03", "b13", "b23", "b04", "b14", "b24", "b34"]
+                            three_list = ["b00", "b11", "b22", "b33", "b44"]
                             new_bodans = [bodans[i] for i in range(len(bodans)) if i % 2 is 1]
                             new_bodan = new_bodans[0:20]
                             # 主队bodan_home
@@ -357,20 +350,16 @@ class ZuqiuSpider(scrapy.Spider):
                             for a, b in enumerate(three_list):
                                 bodan_data[b] = round(float(bodan_dogfall[a]) - 1, 2)
                             # 其他bodan_other
-                            bodan_data['bodanother'] = round(float(new_bodans[-1]) - 1, 2)
+                            bodan_data['bo'] = round(float(new_bodans[-1]) - 1, 2)
                         except:
                             pass
 
                         try:
                             half_bodans = data['o']['cs1st']['v']
                             new_half_bodans = [half_bodans[i] for i in range(len(half_bodans)) if i % 2 is 1]
-                            new_one = ["halfbodanhome_one_zero", "halfbodanhome_two_zero", "halfbodanhome_two_one",
-                                       "halfbodanhome_three_zero", "halfbodanhome_three_one", "halfbodanhome_three_two"]
-                            new_two = ["halfbodanguest_one_zero", "halfbodanguest_two_zero", "halfbodanguest_two_one",
-                                       "halfbodanguest_three_zero", "halfbodanguest_three_one", "halfbodanguest_three_two"]
-                            new_three = ["halfbodandogfall_zero_zero", "halfbodandogfall_one_one",
-                                         "halfbodandogfall_two_two",
-                                         "halfbodandogfall_three_three"]
+                            new_one = ["b10_h", "b20_h", "b21_h", "b30_h", "b31_h", "b32_h"]
+                            new_two = ["b01_h", "b02_h", "b12_h", "b03_h", "b13_h", "b23_h"]
+                            new_three = ["b00_h", "b11_h", "b22_h", "b33_h"]
                             halfbodan = new_half_bodans[0:12]
                             half_bodan_home = [halfbodan[i] for i in range(len(halfbodan)) if i % 2 is 0]
                             # 队1
@@ -385,85 +374,83 @@ class ZuqiuSpider(scrapy.Spider):
                             for a, b in enumerate(new_three):
                                 bodan_data[b] = round(float(half_bodan_dogfall[a]) - 1, 2)
                             # 其他
-                            bodan_data['halfbodanother'] = round(float(new_half_bodans[-1]) - 1, 2)
+                            bodan_data['bo_h'] = round(float(new_half_bodans[-1]) - 1, 2)
                         except:
                             pass
                     if new_data is 12:
                         try:
                             home_data = data['o']['ou']['v']
                             # 球队进球 大条件
-                            full_dict_rule['home_tema_ball_big'] = home_data[1]
+                            full_dict_rule['tbhb'] = home_data[1]
                             # 球队进球小条件
-                            full_dict_rule['home_tema_ball_small'] = home_data[3]
+                            full_dict_rule['tbhs'] = home_data[3]
 
                             if pt is 3:
                                 # 球队进球大赔率
-                                full_dict['home_tema_ball_big'] = round(float(home_data[5]) - 1, 2)
+                                full_dict['tbhb'] = round(float(home_data[5]) - 1, 2)
                                 # 球队进球小赔率
-                                full_dict['home_tema_ball_small'] = round(float(home_data[7]) - 1, 2)
+                                full_dict['tbhs'] = round(float(home_data[7]) - 1, 2)
                             else:
                                 # 球队进球大赔率
-                                full_dict['home_tema_ball_big'] = home_data[5]
+                                full_dict['tbhb'] = home_data[5]
                                 # 球队进球小赔率
-                                full_dict['home_tema_ball_small'] = home_data[7]
+                                full_dict['tbhs'] = home_data[7]
                         except:
-                            full_dict['home_tema_ball_small'] = ""
-                            full_dict_rule['home_tema_ball_small'] = ""
-                            full_dict['home_tema_ball_big'] = ""
-                            full_dict_rule['home_tema_ball_big'] = ""
+                            full_dict['tbhs'] = ""
+                            full_dict_rule['tbhs'] = ""
+                            full_dict['tbhb'] = ""
+                            full_dict_rule['tbhb'] = ""
                         try:
                             half_home_data = data['o']['ou1st']['v']
-                            half_dict_rule['half_home_tema_ball_big'] = half_home_data[1]
-                            half_dict_rule['half_home_tema_ball_small'] = half_home_data[3]
+                            half_dict_rule['tbhb_h'] = half_home_data[1]
+                            half_dict_rule['tbhs_h'] = half_home_data[3]
 
                             if pt is 3:
-                                half_dict['half_home_tema_ball_big'] = round(float(half_home_data[5]) - 1, 2)
-                                half_dict['half_home_tema_ball_small'] = round(float(half_home_data[7]) - 1, 2)
+                                half_dict['tbhb_h'] = round(float(half_home_data[5]) - 1, 2)
+                                half_dict['tbhs_h'] = round(float(half_home_data[7]) - 1, 2)
                             else:
-                                half_home_size_big = half_home_data[5]
-                                half_dict['half_home_tema_ball_big'] = half_home_size_big
-                                half_home_size_small = half_home_data[7]
-                                half_dict['half_home_tema_ball_small'] = half_home_size_small
+                                half_dict['tbhb_h'] = half_home_data[5]
+                                half_dict['tbhs_h'] = half_home_data[7]
 
                         except:
-                            half_dict_rule['half_home_tema_ball_big'] = ""
-                            half_dict['half_home_tema_ball_big'] = ""
-                            half_dict_rule['half_home_tema_ball_small'] = ""
-                            half_dict['half_home_tema_ball_small'] = ""
+                            half_dict_rule['tbhb_h'] = ""
+                            half_dict['tbhb_h'] = ""
+                            half_dict_rule['tbhs_h'] = ""
+                            half_dict['tbhs_h'] = ""
 
                     if new_data is 13:
                         try:
                             guest_data = data['o']['ou']['v']
-                            full_dict_rule['guest_tema_ball_big'] = guest_data[1]
-                            full_dict_rule['guest_tema_ball_small'] = guest_data[3]
+                            full_dict_rule['tbgb'] = guest_data[1]
+                            full_dict_rule['tbgs'] = guest_data[3]
 
                             if pt is 3:
-                                full_dict['guest_tema_ball_big'] = round(float(guest_data[5]) - 1, 2)
-                                full_dict['guest_tema_ball_small'] = round(float(guest_data[7]) - 1, 2)
+                                full_dict['tbgb'] = round(float(guest_data[5]) - 1, 2)
+                                full_dict['tbgs'] = round(float(guest_data[7]) - 1, 2)
                             else:
-                                full_dict['guest_tema_ball_big'] = guest_data[5]
-                                full_dict['guest_tema_ball_small'] = guest_data[7]
+                                full_dict['tbgb'] = guest_data[5]
+                                full_dict['tbgs'] = guest_data[7]
                         except:
-                            full_dict_rule['guest_tema_ball_big'] = ""
-                            full_dict['guest_tema_ball_big'] = ""
-                            full_dict_rule['guest_tema_ball_small'] = ""
-                            full_dict['guest_tema_ball_small'] = ''
+                            full_dict_rule['tbgb'] = ""
+                            full_dict['tbgb'] = ""
+                            full_dict_rule['tbgs'] = ""
+                            full_dict['tbgs'] = ''
                         try:
                             half_guest_data = data['o']['ou1st']['v']
-                            half_dict_rule['half_guest_tema_ball_big'] = half_guest_data[1]
-                            half_dict_rule['half_guest_tema_ball_small'] = half_guest_data[3]
+                            half_dict_rule['tbgb_h'] = half_guest_data[1]
+                            half_dict_rule['tbgs_h'] = half_guest_data[3]
                             if pt is 3:
-                                half_dict['half_guest_tema_ball_big'] = round(float(half_guest_data[5]) - 1, 2)
-                                half_dict['half_guest_tema_ball_small'] = round(float(half_guest_data[7]) - 1, 2)
+                                half_dict['tbgb_h'] = round(float(half_guest_data[5]) - 1, 2)
+                                half_dict['tbgs_h'] = round(float(half_guest_data[7]) - 1, 2)
                             else:
-                                half_dict['half_guest_tema_ball_big'] = half_guest_data[5]
-                                half_dict['half_guest_tema_ball_small'] = half_guest_data[7]
+                                half_dict['tbgb_h'] = half_guest_data[5]
+                                half_dict['tbgs_h'] = half_guest_data[7]
                         except:
-                            half_dict_rule['half_guest_tema_ball_big'] = ""
-                            half_dict['half_guest_tema_ball_big'] = ""
+                            half_dict_rule['tbgb_h'] = ""
+                            half_dict['tbgb_h'] = ""
 
-                            half_dict_rule['half_guest_tema_ball_small'] = ""
-                            half_dict['half_guest_tema_ball_small'] = ""
+                            half_dict_rule['tbgs_h'] = ""
+                            half_dict['tbgs_h'] = ""
 
                 item['league_id'] = league_id
                 item['league_name'] = league_name
@@ -523,7 +510,3 @@ class ZuqiuSpider(scrapy.Spider):
                 item['half_data_rule'] = half_dict_rule
                 item['zuqiu'] = zuqiu
                 yield item
-
-
-
-

+ 1 - 1
hg3535/utils/helper.py

@@ -9,7 +9,7 @@ class Helper(object):
     def async_post(url, params):
         try:
             fs_session = FuturesSession()
-            data = fs_session.post(url, data={"data": json.dumps(params), "token": "02S0wW15643928255d3ebd790ce04"}, timeout=30).result()
+            data = fs_session.post(url, data={"data": json.dumps(params), "token": "JlUo1415650051585d481566c10c9"}, timeout=30).result()
             if data:
                 return data.content.decode('utf-8')
         except requests.exceptions.RequestException as e:

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików