derrickx 1 жил өмнө
parent
commit
adbad35042

+ 24 - 6
livepocket/buy_poc.py

@@ -49,13 +49,31 @@ def test_poc():
 
 
 def by_poc():
-    url = 'https://t.livepocket.jp/purchase/verify?event_id=307764'
+    url = 'https://t.livepocket.jp/purchase/verify?event_id=307219'
 
-    headers = {'Content-Type': 'application/x-www-form-urlencoded;',
-               'Accept-Encoding': 'gzip, deflate, br, zstd',
-               'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
-               'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
-               }
+    headers = {
+        'Accept-Encoding': 'gzip, deflate, br, zstd',
+        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
+        'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
+        'Accept-Language': 'zh-CN,zh;q=0.9',
+        'Cache-Control': 'no-cache',
+        'Cookie': 'ci_session=TB9aP0ffcS6uK2rhcUxhb1uF8ZUaWY7oqwDg3OpGk2zZmFYAihTkYadqnniR%2FoQ7g8KCK7RXdNJ109aeJcryfm4UyOeyu3nQCiDIcLkzRgtYsb%2B%2B431iz1DaG4lM0NG0wcM5EQ0BJrbyNPiaD7CJNlp1HuPr20WnV3ml89zcpbtBHfF4x%2BjasqtD06l8Kn%2BO%2Filjg4y%2BUaAXnyLd%2FmrnAhDgteJV%2F44Awl1ZHw0cE6PvDQq1Fsw%2Be6Ym4HzWIvRvFTSGdUqhKaYMZIclfZJUUHHhhqfbJ59cJualWNx38LRgAonOEtYOBGxWv97LBGTJ0EQU0KxLxJGsBHOZKTQuQ%2FAAwaqCwDAuRcx1cOhXBUwQhS8LTqqJQOPLYJj4r5QF8KbrnnQ1S0kNMlxGx13fpifnnAvtoZ5HfCk9sGcGpvs3jJxaCjYGAry8Ljhl65CHgQEXC5xcp1SOwNeTW%2BZhrA%3D%3D',
+        'Dnt': '1',
+        'Pragma': 'no-cache',
+        'Priority': 'u=0, i',
+        'Sec-Ch-Ua': '"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"',
+        'Sec-Ch-Ua-Mobile': '?0',
+        'Sec-Ch-Ua-Platform': '"macOS"',
+        'Sec-Fetch-Dest': 'document',
+        'Sec-Fetch-Mode': 'navigate',
+        'Sec-Fetch-Site': 'none',
+        'Sec-Fetch-User': '?1',
+        'Upgrade-Insecure-Requests': '1',
+        'authority': 't.livepocket.jp',
+        'method': 'GET',
+        'path': '/api/purchased_tickets/total_list?limit=10&offset=0&past=false&event_id=307219&utoken=utoken',
+        'scheme': 'https',
+    }
 
     response = requests.get(url, allow_redirects=False, headers=headers)
 

+ 74 - 0
livepocket/step_buy.py

@@ -0,0 +1,74 @@
+"""
+购买券
+1、https://t.livepocket.jp/api/tickets/purchase?mytimestamp=1714488081955
+
+2、https://t.livepocket.jp/api/promoter_notification_settings/update?mytimestamp=1714488083447
+
+3、https://t.livepocket.jp/api/common/lists?dev=sp&mytimestamp=1714488092578
+
+4、https://t.livepocket.jp/api/purchases/show?order_id=56707983&mytimestamp=1714488092592
+
+"""
+import json
+import random
+import time
+
+import requests
+
+
+def step_buy():
+
+    step_timestamp = str(int(time.time()))
+    event_id = 312360
+    reserved_session_id = random.randint(10000, 60000)
+
+    headers = {
+        'Accept-Encoding': 'gzip, deflate, br, zstd',
+        'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36',
+        'Accept': 'application/json, text/javascript, */*; q=0.01',
+        'Accept-Language': 'zh-CN,zh;q=0.9',
+        'Cache-Control': 'no-cache',
+        'Content-Type': 'application/x-www-form-urlencoded',
+        'Dnt': '1',
+        'Pragma': 'no-cache',
+        'Priority': 'u=0, i',
+        'Referer': f'https://t.livepocket.jp/purchase/confirm?id={event_id}&reserved_session_id={reserved_session_id}&otoken=zIxMWI1OTU5NzFhMzBmMTc3NGIxNmMxMWJkNz',
+        'Sec-Ch-Ua': '"Chromium";v="124", "Google Chrome";v="124", "Not-A.Brand";v="99"',
+        'Sec-Ch-Ua-Mobile': '?0',
+        'Sec-Ch-Ua-Platform': '"macOS"',
+        'Sec-Fetch-Dest': 'empty',
+        'Sec-Fetch-Mode': 'cors',
+        'Sec-Fetch-Site': 'same-origin',
+        'Sec-Fetch-User': '?1',
+        'Upgrade-Insecure-Requests': '1',
+        'authority': 't.livepocket.jp',
+        'method': 'POST',
+        'path': f'/api/tickets/purchase?mytimestamp={step_timestamp}',
+        'scheme': 'https',
+        'X-Requested-With': 'XMLHttpRequest',
+    }
+
+    cookies = {'ci_session': 'reVDw%2B7KCPX3SsuHQOr%2B0aP9nKNl1sf47wgSj8Dx%2FUk5RRpLMh1obUZWaMaTtOVF3zbqwmdXbIk%2F4GH21BtEf2YiHIW8EYro8orIAsbAISFmtjHbDXVIFhqQBM00YbIzbwRtuwTsBcTXw6nAa2Gg%2FmXrmuLS5zMUNvKRlcoLcyH%2Blkd0RV42XEHodR1vou46hsAwJsXNnG50QKqz94388TQHvDHSXF89iH4dtwyrKn7roJsGI4unz%2F106l1Nujk29Zfb%2BGeSBdWqZGmc5CjhQMDgUjBdBq%2B3MAiCMj5WfG7g1FcTXM4c2WmzZXIc2PdDxWZC%2FQk2XrQBE1pw%2B2%2B1AnX1flHweFpxloPcaI65ZqKE1uhg2Lqmjor3Z2fBAGJD7tgnzos2xiBr3bAVXcyl6Nri9pNlCrO3vAF14gDae9xGWKgTdRdrTfRpsmIUTt%2BdJGJ41baLunrGs%2F96X1At4w%3D%3D'}
+
+    step1_url = 'https://t.livepocket.jp/api/tickets/purchase?mytimestamp=' + str(int(time.time()))
+
+    form1_data = {
+        'utoken': 'utoken',
+        'onetime_token_name': 'buy_ticket',
+        'onetime_token_value': 'onetime_token_value',
+        'url': f'https://t.livepocket.jp/purchase/confirm?id={event_id}&reserved_session_id={reserved_session_id}',
+        'reserve_session_id': f'{reserved_session_id}',
+        'payment_method': '0',
+        'event_id': f'{event_id}',
+        'payment_type': 'credit'
+    }
+
+    step1_session = requests.session()
+    step1_content = step1_session.post(url=step1_url, headers=headers, data=form1_data, cookies=cookies).text
+    step1_json = json.loads(step1_content)
+    print(f"step1_content:{step1_content}, error: {step1_json['errmsg']}")
+
+
+
+if __name__ == "__main__":
+    step_buy()