chore: update Python syntax check workflow and add browser helper script

This commit is contained in:
Space-Banane
2026-04-06 23:07:57 +02:00
parent b817f34607
commit 002533044a
3 changed files with 43 additions and 5 deletions

View File

@@ -1,22 +1,31 @@
name: Python syntax & lint name: Code Check - Quality and Syntax
on: on:
push: push:
branches: ["**"] branches: ["**"]
paths:
- '**/*.py'
pull_request: pull_request:
branches: ["**"] branches: ["**"]
paths:
- '**/*.py'
jobs: jobs:
syntax-lint: syntax-lint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13", "3.14"]
fail-fast: false
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Python - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: '3.x' python-version: ${{ matrix.python-version }}
- name: Install dependencies - name: Install dependencies
run: | run: |
@@ -36,3 +45,11 @@ jobs:
files=$(git ls-files '*.py') files=$(git ls-files '*.py')
if [ -z "$files" ]; then echo "No Python files to lint"; exit 0; fi if [ -z "$files" ]; then echo "No Python files to lint"; exit 0; fi
flake8 $files flake8 $files
- name: Check execution (Smoke Test)
run: |
files=$(git ls-files '*.py')
for file in $files; do
echo "Testing execution of $file..."
python "$file" --version || python -m py_compile "$file"
done

View File

@@ -90,8 +90,11 @@ python batch.py
- `with_ui.py` — Flask UI server and job manager. - `with_ui.py` — Flask UI server and job manager.
- `frontend.html` — browser interface. - `frontend.html` — browser interface.
- `batch.py` — command-line batch downloader (now supports JSON input). - `batch.py` — command-line batch downloader (now supports JSON input).
- `urls.sample.json` — example JSON file.
- `requirements.txt` — Python dependencies. - `requirements.txt` — Python dependencies.
- `urls.sample.json` — example JSON file.
## Browser helper
Use the included `get_urls.js` helper to extract post URLs from a Patreon page via the browser console. Paste and run the script in the console while viewing a page with posts; the script logs an array of URLs which you can right-click and "Copy Object" on.
## License ## License
- MIT No Attribution — see `MIT-0.txt`. - MIT No Attribution — see `MIT-0.txt`.

18
get_urls.js Normal file
View File

@@ -0,0 +1,18 @@
// Execute this in your browser console on a patreon page.
let urls = [];
const target = temp1;
for (const child of target.children) {
try {
const url = child.children[0].children[0].children[0].children[0].children[0].children[0].children[1].children[0].children[0].children[0].children[0].children[0].children[0].children[0].href
urls.push(url);
} catch (error) {
console.error('Error occurred while extracting URL (expected');
}
}
console.log(urls);
// Now you can press "Copy Object" when you rightclick on the output of the console log above.