Skip to content

Adds cloudscraper dependency for Cloudflare bypass#72

Merged
YisusChrist merged 2 commits into
mainfrom
403-errors
Jul 19, 2025
Merged

Adds cloudscraper dependency for Cloudflare bypass#72
YisusChrist merged 2 commits into
mainfrom
403-errors

Conversation

@YisusChrist

Copy link
Copy Markdown
Owner

Closes #71

📑 Description

  • Introduces the cloudscraper package to facilitate bypassing Cloudflare's anti-bot page, enhancing web scraping capabilities.

  • Replaces the standard requests session in the downloader with a cloudscraper instance, improving the handling of Cloudflare-protected resources.

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

{116496E8-59F5-4712-B62E-EB2BF08F9975}

@YisusChrist YisusChrist self-assigned this Jul 19, 2025
@YisusChrist
YisusChrist requested a review from Copilot July 19, 2025 17:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates the cloudscraper package to bypass Cloudflare's anti-bot protection when scraping web content. The change replaces the standard requests.Session with a CloudScraper instance and simplifies the HTTP headers configuration.

  • Adds cloudscraper dependency to handle Cloudflare-protected resources
  • Replaces requests.Session with cloudscraper.create_scraper() in the downloader
  • Removes extensive hardcoded headers that are now handled by cloudscraper

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
pyproject.toml Adds cloudscraper dependency version ^1.2.71
spankbang_dl/downloader.py Integrates cloudscraper and removes hardcoded headers

Comment thread spankbang_dl/downloader.py
Comment thread spankbang_dl/downloader.py
@YisusChrist
YisusChrist merged commit 0fe1c2f into main Jul 19, 2025
7 of 218 checks passed
@YisusChrist
YisusChrist deleted the 403-errors branch July 19, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: 403 Forbidden error when trying to download from any URL

2 participants