Skip to content

Commit

Permalink
Merge pull request #33 from laluka/GabDug-fix/pkg_resources-errors
Browse files Browse the repository at this point in the history
Polish DuGab's work !
  • Loading branch information
laluka authored Mar 2, 2024
2 parents 530e397 + 951f75d commit 6dbf9e2
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ ENV \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1

RUN apt-get update && apt-get install -y curl
RUN apt-get update && apt-get install -y curl bat && \
ln -sf /usr/bin/batcat /usr/local/bin/bat

# Install dependencies first to leverage Docker layer caching.
RUN --mount=type=bind,source=requirements.txt,target=/tmp/requirements.txt \
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,23 @@ sudo apt install -y bat curl virtualenv python3
# Tool
virtualenv -p python3 .py3
source .py3/bin/activate
pip install .
bypass-url-parser -u http://thinkloveshare.com/juicy_403_endpoint/
PDM_BUILD_SCM_VERSION="$(git describe --abbrev=0)-dev" pip install .
bypass-url-parser -u https://thinkloveshare.com/juicy_403_endpoint/
cat /tmp/tmpRANDOM-bypass-url-parser/triaged-bypass.json | jq -r '.results[].request_curl_cmd'
cat /tmp/tmpRANDOM-bypass-url-parser/triaged-bypass.json | jq -r '.results[].response_data'

# To test that all supported versions can boot
for version in {8..13}; do
docker run --rm -it -v "$PWD":/host -w /host "python:3.$version" bash -c 'git config --global --add safe.directory /host && PDM_BUILD_SCM_VERSION="$(git describe --abbrev=0)-dev" pip install . && bup -u https://thinkloveshare.com/ -t 50 -m http_headers_scheme'
done
```
### DOCKER
```bash
docker run --rm -it ghcr.io/laluka/bypass-url-parser:latest --help
docker run --rm -it -v "$PWD:/host" -w /host ghcr.io/laluka/bypass-url-parser:latest bash -il
# Then bup -h, keep the docker open as the output is saved by default in /tmp
# Or specify the output to the current directory, and consult them later! :)
```
## More about supported arguments
Expand Down
38 changes: 19 additions & 19 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = [
{ name = "Gabriel Dugny", email = "[email protected]" },
]
dependencies = ["coloredlogs==15.0.1", "docopt==0.6.2"]
requires-python = ">=3.11"
requires-python = ">=3.8"
keywords = ["security"]
readme = "README.md"
license = { text = "AGPL-3.0-or-later" }
Expand All @@ -18,6 +18,9 @@ classifiers = [
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand Down
34 changes: 17 additions & 17 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ filelock==3.13.1 \
humanfriendly==10.0 \
--hash=sha256:1697e1a8a8f550fd43c2865cd84542fc175a61dcb779b6fee18cf6b6ccba1477 \
--hash=sha256:6b0b831ce8f15f7300721aa49829fc4e83921a9a301cc7f606be6686a2288ddc
identify==2.5.33 \
--hash=sha256:161558f9fe4559e1557e1bff323e8631f6a0e4837f7497767c1782832f16b62d \
--hash=sha256:d40ce5fcd762817627670da8a7d8d8e65f24342d14539c59488dc603bf662e34
identify==2.5.35 \
--hash=sha256:10a7ca245cfcd756a554a7288159f72ff105ad233c7c4b9c6f0f4d108f5f6791 \
--hash=sha256:c4de0081837b211594f8e877a6b4fad7ca32bbfc1a9307fdd61c28bfe923f13e
ipdb==0.13.9 \
--hash=sha256:951bd9a64731c444fd907a5ce268543020086a697f6be08f7cc2c9a752a278c5
ipython==8.21.0 \
--hash=sha256:1050a3ab8473488d7eee163796b02e511d0735cf43a04ba2a8348bd0f2eaf8a5 \
--hash=sha256:48fbc236fbe0e138b88773fa0437751f14c3645fb483f1d4c5dee58b37e5ce73
ipython==8.22.1 \
--hash=sha256:39c6f9efc079fb19bfb0f17eee903978fe9a290b1b82d68196c641cecb76ea22 \
--hash=sha256:869335e8cded62ffb6fac8928e5287a05433d6462e3ebaac25f4216474dd6bc4
isort==5.13.2 \
--hash=sha256:48fdfcb9face5d58a4f6dde2e72a1fb8dcaf8ab26f95ab49fab84c2ddefb0109 \
--hash=sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6
Expand Down Expand Up @@ -78,7 +78,7 @@ nodeenv==1.8.0 \
parso==0.8.3 \
--hash=sha256:8c07be290bb59f03588915921e29e8a50002acaf2cdc5fa0e0114f91709fafa0 \
--hash=sha256:c001d4636cd3aecdaf33cbb40aebb59b094be2a74c556778ef5576c175e19e75
pexpect==4.9.0; sys_platform != "win32" \
pexpect==4.9.0; sys_platform != "win32" and sys_platform != "emscripten" \
--hash=sha256:7236d1e080e4936be2dc3e326cec0af72acf9212a7e1d060210e70a47e253523 \
--hash=sha256:ee7d41123f3c9911050ea2c2dac107568dc43b2d3b0c7557a33212c398ead30f
platformdirs==4.2.0 \
Expand All @@ -90,7 +90,7 @@ pre-commit==3.2.2 \
prompt-toolkit==3.0.43 \
--hash=sha256:3527b7af26106cbc65a040bcc84839a3566ec1b051bb0bfe953631e704b0ff7d \
--hash=sha256:a11a29cb3bf0a28a387fe5122cdb649816a957cd9261dcedf8c9f1fef33eacf6
ptyprocess==0.7.0; sys_platform != "win32" \
ptyprocess==0.7.0; sys_platform != "win32" and sys_platform != "emscripten" \
--hash=sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35 \
--hash=sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220
pure-eval==0.2.2 \
Expand Down Expand Up @@ -125,9 +125,9 @@ pyyaml==6.0.1 \
rich==13.3.4 \
--hash=sha256:22b74cae0278fd5086ff44144d3813be1cedc9115bdfabbfefd86400cb88b20a \
--hash=sha256:b5d573e13605423ec80bdd0cd5f8541f7844a0e71a13f74cf454ccb2f490708b
setuptools==69.0.3 \
--hash=sha256:385eb4edd9c9d5c17540511303e39a147ce2fc04bc55289c322b9e5904fe2c05 \
--hash=sha256:be1af57fc409f93647f2e8e4573a142ed38724b8cdd389706a867bb4efcf1e78
setuptools==69.1.1 \
--hash=sha256:02fa291a0471b3a18b2b2481ed902af520c69e8ae0919c13da936542754b4c56 \
--hash=sha256:5c0806c7d9af348e6dd3777b4f4dbb42c7ad85b190104837488eab9a7c945cf8
six==1.16.0 \
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
Expand All @@ -143,12 +143,12 @@ traitlets==5.14.1 \
types-docopt==0.6.11.4 \
--hash=sha256:694fc67fc3b15733b65d3f07aa1eefc08212a0e2515dd39535ca81f45d3ac3e3 \
--hash=sha256:991a64c1569310c2240ae734fd2c10627abb8a4afaf3be5ac6f4eff9a601f31a
typing-extensions==4.9.0 \
--hash=sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783 \
--hash=sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd
virtualenv==20.25.0 \
--hash=sha256:4238949c5ffe6876362d9c0180fc6c3a824a7b12b80604eeb8085f2ed7460de3 \
--hash=sha256:bf51c0d9c7dd63ea8e44086fa1e4fb1093a31e963b86959257378aef020e1f1b
typing-extensions==4.10.0 \
--hash=sha256:69b1a937c3a517342112fb4c6df7e72fc39a38e7891a5730ed4985b5214b5475 \
--hash=sha256:b0abd7c89e8fb96f98db18d86106ff1d90ab692004eb746cf6eda2682f91b3cb
virtualenv==20.25.1 \
--hash=sha256:961c026ac520bac5f69acb8ea063e8a4f071bcc9457b9c1f28f6b085c511583a \
--hash=sha256:e08e13ecdca7a0bd53798f356d5831434afa5b07b93f0abdf0797b7a06ffe197
wcwidth==0.2.13 \
--hash=sha256:3da69048e4540d84af32131829ff948f1e022c1c6bdb8d6102117aac784f6859 \
--hash=sha256:72ea0c06399eb286d978fdedb6923a9eb47e1c486ce63e9b4e64fc18303972b5
5 changes: 3 additions & 2 deletions src/bypass_url_parser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1963,9 +1963,10 @@ def load_file_into_memory_list(filename: str, enc_format: str | None = None, cle
else:
# Absolute filename resolution of files located in project dir. Allow to call the tool from anywhere,
# even with a symbolic link
from pkg_resources import resource_filename
from importlib import resources
try:
absolute_filename = resource_filename(__name__, filename)
with resources.path(__name__, filename) as p:
absolute_filename = p
except Exception:
absolute_filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), filename)
if ext_logger and debug and absolute_filename != filename:
Expand Down

0 comments on commit 6dbf9e2

Please sign in to comment.