Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
894 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,26 @@ | ||
PYTHON := $(shell command -v python3) | ||
CLEAN_PATHS := $(PWD)/build $(PWD)/dist $(PWD)/*.egg-info | ||
WHL_PATH := $(wildcard dist/*.whl) | ||
|
||
.PHONY: clean | ||
clean: | ||
@-rm -rf $(CLEAN_PATHS) | ||
|
||
fmt: | ||
command -v black || $(PYTHON) -m pip install -r requirements.txt | ||
black ja3requests | ||
@command -v black || $(PYTHON) -m pip install -r requirements.txt | ||
$(shell black ja3requests) | ||
|
||
lint: | ||
command -v pylint || $(PYTHON) -m pip install -r requirements.txt | ||
pylint ja3requests | ||
@command -v pylint || $(PYTHON) -m pip install -r requirements.txt | ||
$(shell pylint ja3requests) | ||
|
||
.PHONY: dist | ||
dist: | ||
@if [ -f 'setup.py' ]; then $(PYTHON) setup.py sdist;fi | ||
|
||
package: | ||
if [ -f 'setup.py' ]; then $(PYTHON) setup.py sdist;fi | ||
.PHONY: build | ||
build: dist | ||
@if [ -f 'setup.py' ]; then $(PYTHON) setup.py bdist_wheel;fi | ||
|
||
package_whl: | ||
if [ -f 'setup.py' ]; then $(PYTHON) setup.py bdist_wheel;fi | ||
upload: | ||
@if [ -f '$(WHL_PATH)' ];then twine upload $(wildcard dist/*); else echo "File not existed.";fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
""" | ||
ja3Requests.base._connection | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Basic HTTP Connection | ||
""" | ||
|
||
|
||
class BaseHttpConnection: | ||
|
||
def __init__(self): | ||
|
||
self._scheme = "http" | ||
self._http_version = "HTTP/1.1" | ||
self._port = 80 | ||
self._source_address = None | ||
self._destination_address = None | ||
self._timeout = None | ||
self._proxy = None | ||
self._proxy_username = None | ||
self._proxy_password = None | ||
self._connection = None | ||
|
||
@property | ||
def scheme(self): | ||
return self._scheme | ||
|
||
@scheme.setter | ||
def scheme(self, attr): | ||
self._scheme = attr | ||
|
||
@property | ||
def http_version(self): | ||
return self._http_version | ||
|
||
@property | ||
def port(self): | ||
return self._port | ||
|
||
@port.setter | ||
def port(self, attr): | ||
self._port = attr | ||
|
||
@property | ||
def source_address(self): | ||
return self._source_address | ||
|
||
@source_address.setter | ||
def source_address(self, attr): | ||
self._source_address = attr | ||
|
||
@property | ||
def destination_address(self): | ||
return self._destination_address | ||
|
||
@destination_address.setter | ||
def destination_address(self, attr): | ||
self._destination_address = attr | ||
|
||
@property | ||
def timeout(self): | ||
return self._timeout | ||
|
||
@timeout.setter | ||
def timeout(self, attr): | ||
self._timeout = attr | ||
|
||
@property | ||
def proxy(self): | ||
return self._proxy | ||
|
||
@proxy.setter | ||
def proxy(self, attr): | ||
self._proxy = attr | ||
|
||
@property | ||
def proxy_username(self): | ||
return self._proxy_username | ||
|
||
@proxy_username.setter | ||
def proxy_username(self, attr): | ||
self._proxy_username = attr | ||
|
||
@property | ||
def proxy_password(self): | ||
return self._proxy_password | ||
|
||
@proxy_password.setter | ||
def proxy_password(self, attr): | ||
self._proxy_password = attr | ||
|
||
@property | ||
def connection(self): | ||
return self._connection | ||
|
||
@connection.setter | ||
def connection(self, attr): | ||
self._connection = attr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
""" | ||
ja3Requests.base._request | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Basic Request | ||
""" | ||
|
||
|
||
class BaseRequest: | ||
|
||
def __init__(self): | ||
|
||
self._method = None | ||
self._source = None | ||
self._url = None | ||
self._scheme = None | ||
self._port = None | ||
self._headers = None | ||
self._params = None | ||
self._data = None | ||
self._cookies = None | ||
self._files = None | ||
self._auth = None | ||
self._json = None | ||
self._timeout = None | ||
self._proxies = None | ||
|
||
@property | ||
def method(self): | ||
return self._method | ||
|
||
@method.setter | ||
def method(self, attr): | ||
self._method = attr | ||
|
||
@property | ||
def source(self): | ||
return self._source | ||
|
||
@source.setter | ||
def source(self, attr): | ||
self._source = attr | ||
|
||
@property | ||
def url(self): | ||
return self._url | ||
|
||
@url.setter | ||
def url(self, attr): | ||
self._url = attr | ||
|
||
@property | ||
def scheme(self): | ||
return self._scheme | ||
|
||
@scheme.setter | ||
def scheme(self, attr): | ||
self._scheme = attr | ||
|
||
@property | ||
def port(self): | ||
return self._port | ||
|
||
@port.setter | ||
def port(self, attr): | ||
self._port = attr | ||
|
||
@property | ||
def headers(self): | ||
return self._headers | ||
|
||
@headers.setter | ||
def headers(self, attr): | ||
self._headers = attr | ||
|
||
@property | ||
def params(self): | ||
return self._params | ||
|
||
@params.setter | ||
def params(self, attr): | ||
self._params = attr | ||
|
||
@property | ||
def data(self): | ||
return self._data | ||
|
||
@data.setter | ||
def data(self, attr): | ||
self._data = attr | ||
|
||
@property | ||
def cookies(self): | ||
return self._cookies | ||
|
||
@cookies.setter | ||
def cookies(self, attr): | ||
self._cookies = attr | ||
|
||
@property | ||
def files(self): | ||
return self._files | ||
|
||
@files.setter | ||
def files(self, attr): | ||
self._files = attr | ||
|
||
@property | ||
def auth(self): | ||
return self._auth | ||
|
||
@auth.setter | ||
def auth(self, attr): | ||
self._auth = attr | ||
|
||
@property | ||
def json(self): | ||
return self._json | ||
|
||
@json.setter | ||
def json(self, attr): | ||
self._json = attr | ||
|
||
@property | ||
def timeout(self): | ||
return self._timeout | ||
|
||
@timeout.setter | ||
def timeout(self, attr): | ||
self._timeout = attr | ||
|
||
@property | ||
def proxies(self): | ||
return self._proxies | ||
|
||
@proxies.setter | ||
def proxies(self, attr): | ||
self._proxies = attr | ||
|
||
def is_http(self): | ||
return self._scheme == "http" | ||
|
||
def is_https(self): | ||
return self._scheme == "https" |
Oops, something went wrong.