Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor #3

Merged
merged 5 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ruff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
- uses: chartboost/ruff-action@v1
with:
# Ruff version - sync with .pre-commit-config.yaml
version: 0.4.4
version: 0.4.5
args: check --fix --exit-non-zero-on-fix --show-fixes
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version - sync with .github/workflows/ruff.yaml
rev: v0.4.4
rev: v0.4.5
hooks:
# Run the linter.
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1 style="text-align: center;">Masquer</h1>
<h1 align="center">Masquer</h1>

<p align="center">
<a href="https://github.com/essteer/masquer/actions/workflows/test.yaml"><img src="https://github.com/essteer/masquer/actions/workflows/test.yaml/badge.svg"></a>
Expand Down
5 changes: 1 addition & 4 deletions src/masquer/utils/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@ def get_response(ua: bool, rf: bool, hd: bool) -> dict:
response_data: dict
useragent | referer | header data as requested
"""
response_data = dict()
# header data
if hd:
response_data = HEADER_DATA
else:
response_data = dict()

# referer
if rf:
referer = select_data(REFERERS, REFERER_WEIGHTS)
response_data["Referer"] = referer

# user-agent
if ua:
useragent = select_data(USERAGENTS, USERAGENT_WEIGHTS)
Expand Down
2 changes: 1 addition & 1 deletion update.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def update_assets() -> bool:
root_dir = os.path.abspath(os.path.dirname(__file__))
# Path to assets and utils directories
assets_dir = os.path.join(root_dir, "assets")
utils_dir = os.path.join(root_dir, "src", "utils")
utils_dir = os.path.join(root_dir, "src", "masquer", "utils")

# Get JSON file data
header_data = extract_data(os.path.join(assets_dir, "header.json"))
Expand Down