Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
ci/cd: improve security of workflows (#1737)
NTFSvolumecc7eb9b81542
diff --git a/.github/workflows/create_release.yaml b/.github/workflows/GH_release.yamlsimilarity index 73%rename from .github/workflows/create_release.yamlrename to .github/workflows/GH_release.yamlindex 269c20f59..9f8357181 100644--- a/.github/workflows/create_release.yaml+++ b/.github/workflows/GH_release.yaml@@ -3,15 +3,20 @@ name: Create GH Releaseon:workflow_dispatch:+permissions: {}+jobs:create_release:+ name: Create GitHub Releaseruns-on: ubuntu-latestpermissions:contents: writesteps:- name: Checkout repository- uses: actions/checkout@v5+ uses: actions/[email protected]+ with:+ persist-credentials: false- name: Check for version tagid: check_tag@@ -26,7 +31,7 @@ jobs:- name: Extract version numberid: extract_versionrun: |- TAG_NAME=${{ env.TAG_NAME }}+ TAG_NAME=${TAG_NAME}VERSION_NUMBER=$(echo "$TAG_NAME" | grep -oE '^[0-9]+' | head -n 1)if [ -z "$VERSION_NUMBER" ]; thenecho "Error: No numeric version found in tag name."@@ -37,7 +42,7 @@ jobs:- name: Extract changelog contentid: extract_changelogrun: |- TAG_NAME=${{ env.TAG_NAME }}+ TAG_NAME=${TAG_NAME}CHANGELOG_CONTENT=$(awk -v version="$TAG_NAME" '/^#+ \[/ { if (p) { exit }; if ($2 == "["version"]") { p=1; next} } p && NF' "CHANGELOG.md")@@ -51,15 +56,16 @@ jobs:- name: Create start scripts ziprun: |- mkdir -p zip/Cyberdrop-DL.v${{ env.VERSION_NUMBER }}- cp -r scripts/release/* zip/Cyberdrop-DL.v${{ env.VERSION_NUMBER }}+ mkdir -p zip/Cyberdrop-DL.v${VERSION_NUMBER}+ cp -r scripts/release/* zip/Cyberdrop-DL.v${VERSION_NUMBER}cd zip- zip -r ../Cyberdrop-DL.v${{ env.TAG_NAME }}.zip *+ zip -r ../Cyberdrop-DL.v${TAG_NAME}.zip *- name: Create GH releaseid: create_release- uses: softprops/action-gh-release@v2- with:- name: ${{ env.TAG_NAME }}- body: ${{ env.CHANGELOG_CONTENT }}- files: Cyberdrop-DL.v${{ env.TAG_NAME }}.zip+ run: |+ gh release create "$TAG_NAME" \+ --title "$TAG_NAME" \+ --notes "$CHANGELOG_CONTENT" \+ --draft \+ "Cyberdrop-DL.v${TAG_NAME}.zip"diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yamlindex 46a717fe4..bbed81fbe 100644--- a/.github/workflows/ci.yaml+++ b/.github/workflows/ci.yaml@@ -5,22 +5,27 @@ on:branches:- mainpaths:- - 'cyberdrop_dl/**/*.py'- - 'tests/**/*.py'- - '.github/workflows/ci.yaml'+ - "cyberdrop_dl/**/*.py"+ - "tests/**/*.py"+ - ".github/workflows/ci.yaml"pull_request:branches:- mainpaths:- - 'cyberdrop_dl/**/*.py'- - 'cyberdrop_dl/pyproject.toml'- - 'tests/**/*.py'- - '.github/workflows/ci.yaml'+ - "cyberdrop_dl/**/*.py"+ - "cyberdrop_dl/pyproject.toml"+ - "tests/**/*.py"+ - ".github/workflows/ci.yaml"workflow_dispatch:-jobs:+permissions: {}+jobs:test:+ name: Run pytest+ permissions:+ contents: read+runs-on: ${{ matrix.os }}strategy:@@ -34,19 +39,17 @@ jobs:python-version: "pypy-3.11"fail-fast: true- defaults:- run:- shell: bash-steps:- name: Checkout code- uses: actions/checkout@v5+ uses: actions/[email protected]+ with:+ persist-credentials: false- name: Install uv- uses: astral-sh/setup-uv@v6+ uses: astral-sh/[email protected]with:- version: "0.10.11"python-version: ${{ matrix.python-version }}+ enable-cache: false- name: Install dependenciesrun: |diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex d407edd5c..482cf81aa 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -9,7 +9,7 @@ permissions: {}jobs:publish_to_pypi:- name: publish_to_pypi+ name: Publish to Pypiruns-on: ubuntu-latestenvironment:name: pypi@@ -18,12 +18,12 @@ jobs:contents: readsteps:- name: Checkout- uses: actions/checkout@v6+ uses: actions/[email protected]with:ref: ${{ github.ref_name }}persist-credentials: false- name: Install uv- uses: astral-sh/setup-uv@v7+ uses: astral-sh/[email protected]with:enable-cache: false- name: Ensure tag matches package versiondiff --git a/.github/workflows/ruff.yaml b/.github/workflows/ruff.yamlindex b7dfbc8b1..2781cc0f3 100644--- a/.github/workflows/ruff.yaml+++ b/.github/workflows/ruff.yaml@@ -1,20 +1,24 @@name: Ruff-on: [ push, pull_request ]++permissions: {}++on:+ push:+ pull_request:+jobs:ruff:+ name: Lint and formatruns-on: ubuntu-latest+ permissions:+ contents: read+steps:- name: checkout code- uses: actions/checkout@v5-- - name: ruff lint- uses: astral-sh/ruff-action@v3+ uses: actions/[email protected]with:- version: "0.15.6"+ persist-credentials: false- - name: ruff format check- uses: astral-sh/ruff-action@v3- with:- version: "0.15.6"- args:- "format --check --diff"+ - uses: astral-sh/[email protected]+ - run: ruff format --check --diff+ if: ${{ !cancelled() }}diff --git a/cyberdrop_dl/crawlers/gofile.py b/cyberdrop_dl/crawlers/gofile.pyindex dbb025a1a..37913ec68 100644--- a/cyberdrop_dl/crawlers/gofile.py+++ b/cyberdrop_dl/crawlers/gofile.py@@ -193,7 +193,7 @@ class GoFileCrawler(Crawler):)if password:- sha256_password = sha256(password.encode()).hexdigest()+ sha256_password = sha256(password.encode(), usedforsecurity=False).hexdigest()api_url = api_url.update_query(password=sha256_password)for page in itertools.count(1):