Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Can't impersonate browsers in flatpak #362

Open
FrancescoCaracciolo opened this issue Aug 3, 2024 · 6 comments
Open

[BUG] Can't impersonate browsers in flatpak #362

FrancescoCaracciolo opened this issue Aug 3, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@FrancescoCaracciolo
Copy link

Describe the bug
With curl_cffi 0.7.1, when I try to impersonate a browser, it gives this error: (happens with every browser)

  File "/app/lib/python3.11/site-packages/curl_cffi/requests/session.py", line 581, in _set_curl_options
    raise RequestsError(f"Impersonating {impersonate} is not supported")
curl_cffi.requests.errors.RequestsError: Impersonating BrowserType.chrome124 is not supported

Note: this does not happen when I run curl_cffi on my system normally.

To Reproduce
Within the flatpak in Newelle source code, just running

from curl_cffi import requests

r = requests.get("https://tools.scrapfly.io/api/fp/ja3", impersonate="chrome124")

or with any other browser, it gives the error
Expected behavior
It just works

Versions

  • OS: Arch Linux x64 under Flatpak with
  • curl_cffi 0.7.1
  • pip freeze dump
aiohappyeyeballs==2.3.4
aiohttp==3.10.0
aiosignal==1.3.1
attrs==23.2.0
Brotli==1.1.0
certifi==2024.7.4
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
curl_cffi==0.7.1
Cython==0.29.37
expandvars==0.12.0
frozenlist==1.4.1
g4f==0.3.2.3
gpt4all==2.7.0
gTTS==2.5.1
idna==3.7
Jinja2==3.1.4
lxml==5.2.2
Mako==1.3.5
Markdown==3.6
MarkupSafe==2.1.5
meson==1.3.2
multidict==6.0.5
packaging==24.1
playsound==1.3.0
PyAudio==0.2.14
pycairo==1.26.1
pycparser==2.21
pycryptodome==3.20.0
Pygments==2.18.0
PyGObject==3.48.2
requests==2.32.3
six==1.16.0
SpeechRecognition==3.10.4
tqdm==4.66.4
typing_extensions==4.12.2
urllib3==2.2.2
yarl==1.9.4
@FrancescoCaracciolo FrancescoCaracciolo added the bug Something isn't working label Aug 3, 2024
@perklet
Copy link
Collaborator

perklet commented Aug 3, 2024

Weird, can you somehow unpack the bundle and check if the files were correctly included?

@FrancescoCaracciolo
Copy link
Author

For what file should I look for? impresonate.py is there and is correct

@perklet
Copy link
Collaborator

perklet commented Aug 3, 2024

Does it work without the impersonate parameter?

@FrancescoCaracciolo
Copy link
Author

Yes

@perklet
Copy link
Collaborator

perklet commented Aug 5, 2024

That's even more weird, do you have any additional information?

@FrancescoCaracciolo
Copy link
Author

FrancescoCaracciolo commented Aug 5, 2024

I don't know what could be the issue either. It is possible that it is related to sandboxing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants