hyper-sdk 0.1.0__tar.gz → 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/PKG-INFO +3 -3
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/README.md +2 -2
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk/akamai/sec_cpt.py +5 -8
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk.egg-info/PKG-INFO +3 -3
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/pyproject.toml +1 -1
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/LICENSE +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk/__init__.py +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk/akamai/__init__.py +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk/akamai/pixel.py +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk/akamai/script_path.py +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk/akamai/stop_signal.py +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk/akamai_input.py +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk/incapsula/__init__.py +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk/incapsula/utmvc.py +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk/incapsula_input.py +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk/session.py +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk.egg-info/SOURCES.txt +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk.egg-info/dependency_links.txt +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk.egg-info/requires.txt +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/hyper_sdk.egg-info/top_level.txt +0 -0
- {hyper_sdk-0.1.0 → hyper_sdk-0.1.1}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hyper_sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Hyper Solutions Python SDK
|
|
5
5
|
Project-URL: homepage, https://github.com/Hyper-Solutions/hyper-sdk-py
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -84,7 +84,7 @@ The Akamai package provides functions for handling sec-cpt challenges:
|
|
|
84
84
|
|
|
85
85
|
- `SecCptChallenge.parse`: Parses a sec-cpt challenge from an HTML source.
|
|
86
86
|
- `generate_sec_cpt_payload`: Generates a sec-cpt payload using the provided sec-cpt cookie.
|
|
87
|
-
- `
|
|
87
|
+
- `sleep`: Sleeps for the duration specified in the sec-cpt challenge.
|
|
88
88
|
|
|
89
89
|
Example usage:
|
|
90
90
|
|
|
@@ -93,7 +93,7 @@ from hyper_sdk.akamai.sec_cpt import SecCptChallenge
|
|
|
93
93
|
|
|
94
94
|
challenge = SecCptChallenge.parse(html_source)
|
|
95
95
|
payload = challenge.generate_sec_cpt_payload(sec_cpt_cookie)
|
|
96
|
-
challenge.
|
|
96
|
+
challenge.sleep()
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
### Validating Cookies
|
|
@@ -65,7 +65,7 @@ The Akamai package provides functions for handling sec-cpt challenges:
|
|
|
65
65
|
|
|
66
66
|
- `SecCptChallenge.parse`: Parses a sec-cpt challenge from an HTML source.
|
|
67
67
|
- `generate_sec_cpt_payload`: Generates a sec-cpt payload using the provided sec-cpt cookie.
|
|
68
|
-
- `
|
|
68
|
+
- `sleep`: Sleeps for the duration specified in the sec-cpt challenge.
|
|
69
69
|
|
|
70
70
|
Example usage:
|
|
71
71
|
|
|
@@ -74,7 +74,7 @@ from hyper_sdk.akamai.sec_cpt import SecCptChallenge
|
|
|
74
74
|
|
|
75
75
|
challenge = SecCptChallenge.parse(html_source)
|
|
76
76
|
payload = challenge.generate_sec_cpt_payload(sec_cpt_cookie)
|
|
77
|
-
challenge.
|
|
77
|
+
challenge.sleep()
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
### Validating Cookies
|
|
@@ -3,6 +3,7 @@ import hashlib
|
|
|
3
3
|
import json
|
|
4
4
|
import os
|
|
5
5
|
import re
|
|
6
|
+
import time
|
|
6
7
|
from collections import OrderedDict
|
|
7
8
|
from typing import List
|
|
8
9
|
|
|
@@ -72,6 +73,8 @@ class SecCptChallenge:
|
|
|
72
73
|
|
|
73
74
|
def generate_sec_cpt_payload(self, sec_cpt_cookie: str) -> str:
|
|
74
75
|
sec, _, _ = sec_cpt_cookie.partition("~")
|
|
76
|
+
if sec == sec_cpt_cookie:
|
|
77
|
+
raise Exception("hyper-sdk: Malformed sec_cpt cookie.")
|
|
75
78
|
|
|
76
79
|
answers = self._generate_sec_cpt_answers(sec)
|
|
77
80
|
|
|
@@ -82,14 +85,8 @@ class SecCptChallenge:
|
|
|
82
85
|
|
|
83
86
|
return json.dumps(payload)
|
|
84
87
|
|
|
85
|
-
def
|
|
86
|
-
|
|
87
|
-
self.challenge_data = SecCptChallengeData(
|
|
88
|
-
challenge_data.get('token', ''),
|
|
89
|
-
challenge_data.get('timestamp', 0),
|
|
90
|
-
challenge_data.get('nonce', ''),
|
|
91
|
-
challenge_data.get('difficulty', 0)
|
|
92
|
-
)
|
|
88
|
+
def sleep(self):
|
|
89
|
+
time.sleep(self.duration)
|
|
93
90
|
|
|
94
91
|
def _generate_sec_cpt_answers(self, sec: str) -> List[str]:
|
|
95
92
|
answers = []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: hyper_sdk
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1
|
|
4
4
|
Summary: Hyper Solutions Python SDK
|
|
5
5
|
Project-URL: homepage, https://github.com/Hyper-Solutions/hyper-sdk-py
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
@@ -84,7 +84,7 @@ The Akamai package provides functions for handling sec-cpt challenges:
|
|
|
84
84
|
|
|
85
85
|
- `SecCptChallenge.parse`: Parses a sec-cpt challenge from an HTML source.
|
|
86
86
|
- `generate_sec_cpt_payload`: Generates a sec-cpt payload using the provided sec-cpt cookie.
|
|
87
|
-
- `
|
|
87
|
+
- `sleep`: Sleeps for the duration specified in the sec-cpt challenge.
|
|
88
88
|
|
|
89
89
|
Example usage:
|
|
90
90
|
|
|
@@ -93,7 +93,7 @@ from hyper_sdk.akamai.sec_cpt import SecCptChallenge
|
|
|
93
93
|
|
|
94
94
|
challenge = SecCptChallenge.parse(html_source)
|
|
95
95
|
payload = challenge.generate_sec_cpt_payload(sec_cpt_cookie)
|
|
96
|
-
challenge.
|
|
96
|
+
challenge.sleep()
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
### Validating Cookies
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|