diff --git a/.gitea/workflows/python-syntax.yml b/.gitea/workflows/python-syntax.yml index 4f4de99..64d3092 100644 --- a/.gitea/workflows/python-syntax.yml +++ b/.gitea/workflows/python-syntax.yml @@ -1,22 +1,31 @@ -name: Python syntax & lint +name: Code Check - Quality and Syntax on: push: branches: ["**"] + paths: + - '**/*.py' pull_request: branches: ["**"] + paths: + - '**/*.py' jobs: syntax-lint: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11", "3.12", "3.13", "3.14"] + fail-fast: false + steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | @@ -36,3 +45,11 @@ jobs: files=$(git ls-files '*.py') if [ -z "$files" ]; then echo "No Python files to lint"; exit 0; fi 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 diff --git a/README.md b/README.md index 0124973..f37dfd3 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,11 @@ python batch.py - `with_ui.py` — Flask UI server and job manager. - `frontend.html` — browser interface. - `batch.py` — command-line batch downloader (now supports JSON input). -- `urls.sample.json` — example JSON file. - `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 - MIT No Attribution — see `MIT-0.txt`. diff --git a/get_urls.js b/get_urls.js new file mode 100644 index 0000000..5695910 --- /dev/null +++ b/get_urls.js @@ -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. \ No newline at end of file