Bladeren bron

live pocket auto spider poc

derrickx 1 jaar geleden
bovenliggende
commit
412c7be912

+ 0 - 0
.gitignore


+ 8 - 0
.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

+ 12 - 0
.idea/awesome-python.iml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="jdk" jdkName="awesome-python" jdkType="Python SDK" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+  <component name="PyDocumentationSettings">
+    <option name="format" value="PLAIN" />
+    <option name="myDocStringFormat" value="Plain" />
+  </component>
+</module>

+ 6 - 0
.idea/inspectionProfiles/profiles_settings.xml

@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="USE_PROJECT_PROFILE" value="false" />
+    <version value="1.0" />
+  </settings>
+</component>

+ 7 - 0
.idea/misc.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Black">
+    <option name="sdkName" value="Python 3.12" />
+  </component>
+  <component name="ProjectRootManager" version="2" project-jdk-name="awesome-python" project-jdk-type="Python SDK" />
+</project>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/awesome-python.iml" filepath="$PROJECT_DIR$/.idea/awesome-python.iml" />
+    </modules>
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>

+ 27 - 0
livepocket/buy_poc.py

@@ -0,0 +1,27 @@
+import time
+
+import requests
+
+
+def by_poc():
+    url = 'https://t.livepocket.jp/purchase/verify?event_id=307764'
+
+    response = requests.get(url, allow_redirects=False)
+
+    if response.status_code == 302:
+        redirect_url = response.headers['Location']
+        print("Redirect URL:", redirect_url)
+        # 使用新的重定向URL再次发起请求
+        new_response = requests.get(redirect_url)
+        if new_response.status_code == 200:
+            content = new_response.text
+            print(content)
+        else:
+            print('Failed to fetch the redirected page. Status code:', new_response.status_code)
+    else:
+        print('Initial request did not result in a redirect. Status code:', response.status_code)
+
+
+if __name__ == '__main__':
+    by_poc()
+

+ 29 - 4
livepocket/operator_poc.py

@@ -1,9 +1,12 @@
+import lxml
 import json
 import random
+import re
 import time
 from urllib import parse
 
 import requests
+from lxml import html
 
 
 def operator_poc():
@@ -21,17 +24,17 @@ def operator_poc():
                }
 
     # 通过字典方式定义请求body
-    form_data = {"login": 'misaki1115@huatcn.com',
+    form_data = {"login": 'n7094@huatcn.com',
                  "password": 'panyue666',
                  "auto_login": "on",
-                 "login_password": "misaki1115@huatcn.com&panyue666"
+                 "login_password": "n7094@huatcn.com&panyue666"
                  }
 
     data = parse.urlencode(form_data)
 
     # 代理IP池
     proxy_list = [
-        'qivabpof:jzdm5l9t489x@161.123.209.22:6522',
+        '185.199.228.220:7300',
     ]
 
     # 随机从ip池中选出一个ip
@@ -45,7 +48,29 @@ def operator_poc():
 
     content = requests.post(url=login_url, headers=headers, data=data).text
     login_resp = json.loads(content)
-    print(login_resp['result']['token'])
+    print(f"token: {login_resp['result']['token']}")
+    # print(login_resp)
+
+    # 跳转到抢券
+    target_url = 'https://t.livepocket.jp/e/4gbm0'
+    response = requests.get(target_url)
+    if response.status_code == 200:
+        html_string = response.content.decode('utf8')
+        # print(f'{html_string}')
+        start_index = html_string.find('https://t.livepocket.jp/purchase/verify?event_id=')
+        if start_index != -1:
+            end_index = html_string.find("'", start_index)
+            if end_index != -1:
+                event_id = html_string[start_index + len('https://t.livepocket.jp/purchase/verify?event_id='):end_index]
+                print(f'event_id: {event_id}')
+            else:
+                print('End index not found.')
+        else:
+            print('Substring not found.')
+    else:
+        print('Failed to fetch the page. Status code:', response.status_code)
+
+    # reserved_session_id 6位随机整数
 
 
 # 返回一个随机的请求头 headers

+ 2 - 1
livepocket/spider_poc.py

@@ -7,7 +7,8 @@ Accept-Encoding: gzip, deflate, br, zstd
 Accept-Language:zh-CN,zh;q=0.9
 Content-Length:461
 Content-Type: application/x-www-form-urlencoded
-Cookie:     wovn_selected_lang=ja; WAPID=XLBei5ZvYBksDKTokDu1PXny5twDKy1A6OT; wap_last_event=showWidgetPage; gig_bootstrap_3_wjIpH3nL65A1AaEM_-LysfRz9EdasNvwIjNCUI0aS7w9r2R5GZAm9lxV-haLvibh=login-gigya_ver4; wovn_uuid=fm3zo4tq8; PHPSESSID=9tvgvdq3ttue20ohrk9sl9ipk6; gig_canary=false; gig_canary_ver=15877-3-28565445; gig_bootstrap_3_PAVzTjgwldnEpt6toqsN0ODZWgIvjn_eHZSfRU3KIKt01XsTuQlU4qFWd343KSyN=login-gigya_ver4; ci_session=m3D46TKjnG6C4994wuYvhVeH3AMOm%2FiJEnXoTJ0DQBDMo78isfkNbQGS4SvX6VD2n%2F9f%2FccsLrdICWpWTGVN9AtsxEvuuHZS33Xgso1LLE%2B2omthf5TB9P7EzC0yyNuS%2BCJ1ORNywVSw99qMF0iocdkcQbXc7cEC2qTtmxAFuXKaUCaJV8IGDuEEplK9nXTpoYSZpT87YSDXVFsPw6Cc7cuWcPqaZ2kSslk%2BREspnTD6T%2BRxDDUpGqJ8pleotkO051Q7Z6PpCSLAszLQYy0rurpALI8YswNUF%2FE6ZOwWBmknulYn5f0WcHJc7I2IZ3%2F4TBSJz6PARUExhGpfpwYX5W2k7fww9jX5zXzPWiYeCyrPy9rNtTfni6RmvU2IHiBM712M1Sxi6r1hj5TIWL6FQI3m6nMRhvBd5lEsRG%2FzZqmY6oNhu7xQuJI0g7r5yjtaGmX4Yy5s63HPPnzNSgqnOw%3D%3D
+Cookie:     wovn_selected_lang=ja; WAPID=XLBei5ZvYBksDKTokDu1PXny5twDKy1A6OT; wap_last_event=showWidgetPage; gig_bootstrap_3_wjIpH3nL65A1AaEM_-LysfRz9EdasNvwIjNCUI0aS7w9r2R5GZAm9lxV-haLvibh=login-gigya_ver4; wovn_uuid=fm3zo4tq8; PHPSESSID=9tvgvdq3ttue20ohrk9sl9ipk6; gig_canary=false; gig_canary_ver=15877-3-28565445; gig_bootstrap_3_PAVzTjgwldnEpt6toqsN0ODZWgIvjn_eHZSfRU3KIKt01XsTuQlU4qFWd343KSyN=login-gigya_ver4;
+ci_session=m3D46TKjnG6C4994wuYvhVeH3AMOm%2FiJEnXoTJ0DQBDMo78isfkNbQGS4SvX6VD2n%2F9f%2FccsLrdICWpWTGVN9AtsxEvuuHZS33Xgso1LLE%2B2omthf5TB9P7EzC0yyNuS%2BCJ1ORNywVSw99qMF0iocdkcQbXc7cEC2qTtmxAFuXKaUCaJV8IGDuEEplK9nXTpoYSZpT87YSDXVFsPw6Cc7cuWcPqaZ2kSslk%2BREspnTD6T%2BRxDDUpGqJ8pleotkO051Q7Z6PpCSLAszLQYy0rurpALI8YswNUF%2FE6ZOwWBmknulYn5f0WcHJc7I2IZ3%2F4TBSJz6PARUExhGpfpwYX5W2k7fww9jX5zXzPWiYeCyrPy9rNtTfni6RmvU2IHiBM712M1Sxi6r1hj5TIWL6FQI3m6nMRhvBd5lEsRG%2FzZqmY6oNhu7xQuJI0g7r5yjtaGmX4Yy5s63HPPnzNSgqnOw%3D%3D
 
 Origin: https://t.livepocket.jp
 Dnt: 1