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

Bypass Fa3 autism :( #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

orithecapper
Copy link

thanks use curl_cffi

@cibere
Copy link
Owner

cibere commented Jul 11, 2023

Thanks for this PR, but there are a couple crucial issues with it.

1) I will not be using a blocking http method in an async environment. If i recall correctly, that curl lib does support async, and that support should be used here.
2) commenting old code out is not a good idea. Please remove the code that is no longer used, and test it.
3) You're changes don't just effect http.py, so other files would have to be modified as well.

@cibere cibere self-requested a review July 11, 2023 22:19
@@ -236,22 +237,21 @@ async def request(self, route: Route, **kwargs) -> Any:
f"Making request to {route.method} {url}. headers: {headers}, params: {kwargs.get('params', None)}, json: {kwargs.get('json', None)}"
)
try:
res = await self.__session.request(
res = await requests_ORI.AsyncSession().request(
Copy link
Owner

Choose a reason for hiding this comment

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

Just like with aiohttp, the session should be reused and stored, not creating a new one

route.method,
url
if self.whitelisted is True
Copy link
Owner

Choose a reason for hiding this comment

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

If you're going to remove generating the url like this, you should also remove HTTPClient.whitelisted, and the others. kick.Client's docstring would also need to change

@@ -4,12 +4,13 @@
import json
import logging
from typing import TYPE_CHECKING, Any, Coroutine, Optional, TypeVar, Union
from curl_cffi import requests as requests_ORI
Copy link
Owner

Choose a reason for hiding this comment

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

There is no reason to change the name its imported under. Importing curl_cffi itself is better than changing the name of something from the library

@orithecapper
Copy link
Author

@cibere I hope you enjoy the fact that I really like this repo.

Yes its really trashy , but it does work , I promise you

I tried, I am able to connect , I am able to get the Fa3 corrected

I am not a developer , and my english is too broken to become one too

@cibere
Copy link
Owner

cibere commented Jul 12, 2023

@cibere I hope you enjoy the fact that I really like this repo.

Yes its really trashy , but it does work , I promise you

I tried, I am able to connect , I am able to get the Fa3 corrected

I am not a developer , and my english is too broken to become one too

I just can't put this in the main repo in the state its in. Though once I'm home from camping I can probably fix it.

@orithecapper
Copy link
Author

@cibere I hope you enjoy the fact that I really like this repo.
Yes its really trashy , but it does work , I promise you
I tried, I am able to connect , I am able to get the Fa3 corrected
I am not a developer , and my english is too broken to become one too

I just can't put this in the main repo in the state its in. Though once I'm home from camping I can probably fix it.

Oh no this was not a request to pull , I just showed you can use curl_cffi

Yes you're right its a really put in thing , for me it works flawlessly , but I guess you can just to show

anyways if you can get this cffi thing into an aio libary it would be amazing ..

its a way that works, but it breaks anything else - but shout out for you for this kick.py thing

https://github.com/yifeikong/curl_cffi/blob/master/curl_cffi/aio.py

god knows what its all about , should be there

https://github.com/yifeikong/curl_cffi/blob/1f3285cef2ef0cb6597ef25285832e59325a014a/curl_cffi/requests/session.py#L294C1-L296

it is a library , but I have no idea what the hell they do

cffi is something that cross do C and python idk man

it does act like requests tho

@orithecapper
Copy link
Author

@cibere im unsure if curl_cffi works too well on windows

@cibere
Copy link
Owner

cibere commented Jul 12, 2023

@cibere im unsure if curl_cffi works too well on windows

Oh? What operating systems did you test it on?

@orithecapper
Copy link
Author

@cibere im unsure if curl_cffi works too well on windows

Oh? What operating systems did you test it on?

arch linux because I am an hipster

@orithecapper
Copy link
Author

bump

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.

2 participants