Skip to content

Issue Title: httpx.CookieConflict: Multiple cookies exist with name=__cf_bm when fetching tweets #42

@pavave

Description

@pavave

Problem Description
When running minercli, I encounter an error related to a cookie conflict with __cf_bm, which is set by Cloudflare.

Error Log:
python
Копировать
Редактировать
httpx.CookieConflict: Multiple cookies exist with name=__cf_bm
2025-03-14 06:30:59,752 [INFO] :: Sleeping 15s for timeline refresh...
Sometimes, I also see a JSON parsing error:

python
Копировать
Редактировать
demjson3.JSONDecodeError: Object literal (dictionary) is not terminated
What I've Tried:
Clearing all cookies before making a request:
python
Копировать
Редактировать
account.session.cookies.clear()
Removing only the specific __cf_bm cookie:
python
Копировать
Редактировать
if '__cf_bm' in account.session.cookies:
del account.session.cookies['__cf_bm']
Updating dependencies:
bash
Копировать
Редактировать
pip install --upgrade httpx
Question:
Are there any known solutions to bypass this issue? Should I use cloudscraper, or is there another way to properly manage cookies?

Environment:
OS: Ubuntu (on a server)
Python 3.12
httpx version: Latest (just updated)
Using poetry for dependency management
I’d appreciate any help! 🚀

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions