|
|
@@ -0,0 +1,63 @@
|
|
|
+import re
|
|
|
+
|
|
|
+import requests
|
|
|
+
|
|
|
+
|
|
|
+def poc_1():
|
|
|
+ net_url = 'https://t.livepocket.jp/purchase?type=new'
|
|
|
+ result = requests.Session()
|
|
|
+ header = {
|
|
|
+ 'Host': 't.livepocket.jp',
|
|
|
+ 'User-Agent': "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) "
|
|
|
+ "Chrome/69.0.3947.100 Safari/537.36",
|
|
|
+ 'Content-Type': 'application/x-www-form-urlencoded',
|
|
|
+ 'Referer': 'https://t.livepocket.jp/e/pp20240515',
|
|
|
+ }
|
|
|
+ my_session = 'IN7u3uuP5WcizQkmRzF%2F3OsLuNNQePnxNBvnlPgqT6FPz2BgyKT2KCJaMvdj8ZSa6wNp2xZIL6VoA7Mj0R2zECMZkOKJOLbsNwUdXwvcsROxjfCzibxEaj4nG%2Bq29dCEUdiWI2TgUsKSFGRZaOP0p37ktl%2B1wSMqMAk918Nkt7APIxpQtZ%2BoLwId4PMOkN3oOIwT3CvsuDbgPQHIuokZXcnNe8uOAUuZBLW4nKOdYimLcSw6oTMt85UXkwm4OyTdxYR3%2B8crA0OfQCyfHXqY%2Bj0t9R0mmNSusRXRDuDBmOCFR58vHVuuwZ0AXNHYoYB0sdm28VL9xgHHrzkvm2M9cpLEIVWUWBWGaZgtO3xp2d8L70%2BfAKwyv6JPGcGmGf9wUQzBltssBpMmYqSfkws1%2Bp8BOhmXOqfljSYbWcxxVVSw%2B2dtoxBXsTf793mD9sVYRsrr8YPGz4JPVGWGU0outg%3D%3D'
|
|
|
+ cookies = {
|
|
|
+ 'ci_session': f'{my_session}',
|
|
|
+ 'list_count': '{"success":true,"result":{"myticket_count":{"count":"0"},"today_event":{"total_count":0,"data_list":[]},"unread_count":5},"submit":true}',
|
|
|
+ 'sns_status': '{"success":true,"result":{"facebook":0,"twitter":0,"mixi":0,"line":0,"yahoo":0,"plusid":1,"google":0},"submit":true}',
|
|
|
+ 'display_init': '{"success":true,"result":{"purchased_tickets":{"total_count":0,"data_list":{"ticket_info":[]}},"lottery_tickets":{"total_count":0,"data_list":{"ticket_info":[]}},"order_limited_event_tickets":{"data_list":{"ticket_info":[]},"total_count":0},"event_order_limit":true},"submit":true}',
|
|
|
+ }
|
|
|
+
|
|
|
+ form_data = {
|
|
|
+ 'redirect_url': 'https://t.livepocket.jp/purchase/',
|
|
|
+ 'event_id': '309887',
|
|
|
+ 'event_cname': 'pp20240515',
|
|
|
+ 'ticket_type': 'lottery',
|
|
|
+ 'facebook_ticket_count': '0',
|
|
|
+ 'twitter_ticket_count': '0',
|
|
|
+ 'plusid_linkage_invalidation_flg': '0',
|
|
|
+ 'ticket_id_1510471': '1'
|
|
|
+ }
|
|
|
+
|
|
|
+ response = result.post(net_url, headers=header, cookies=cookies, data=form_data, allow_redirects=False)
|
|
|
+ print('response.headers: ', response.headers)
|
|
|
+ # location_url = response.headers['Location']
|
|
|
+ # region_string = location_url.split('?')[1]
|
|
|
+ # params = region_string.split('&')
|
|
|
+ # data = {
|
|
|
+ # 'id': params[0].split('=')[1],
|
|
|
+ # 'reserved_session_id': params[1].split('=')[1],
|
|
|
+ # 'otoken': params[2].split('=')[1]
|
|
|
+ # }
|
|
|
+ #
|
|
|
+ # return data
|
|
|
+
|
|
|
+
|
|
|
+def get_ticket_info():
|
|
|
+ url = 'https://t.livepocket.jp/e/pp20240515'
|
|
|
+ response = requests.get(url)
|
|
|
+ if response.status_code == 200:
|
|
|
+ html_string = response.text
|
|
|
+ match = re.search(r'id="js_order_limited_(\d+)"', html_string)
|
|
|
+ if match:
|
|
|
+ number_value = match.group(1)
|
|
|
+ print(number_value)
|
|
|
+ else:
|
|
|
+ print("未找到匹配的数值")
|
|
|
+
|
|
|
+
|
|
|
+if __name__ == '__main__':
|
|
|
+ get_ticket_info()
|