Coder Social home page Coder Social logo

Comments (59)

mak448a avatar mak448a commented on September 28, 2024 25

Please stop bombing this thread unless if you actually have more information. It'll make it easier on the developers. Also, if you have the same issue, place a thumbs up on the first comment.

from poe-api.

Nox998464 avatar Nox998464 commented on September 28, 2024 9

https://github.com/snowby666/poe-api-wrapper is working for me

from poe-api.

ading2210 avatar ading2210 commented on September 28, 2024 5

I've fixed this in the latest commit, but the library is still broken due to changes in the __NEXT_DATA__ format.

from poe-api.

ading2210 avatar ading2210 commented on September 28, 2024 4

My current understanding of this bug is that Poe has started enforcing some sort of cloudflare-based verification which requires a full web browser.

from poe-api.

canxin121 avatar canxin121 commented on September 28, 2024 3

not the same promblem, i can successfuly download the poe.com, but i can't send query successfullt.
@canxin121

Are you able to port those changes from your async client to this library?

But my library don't have this downloading problem. I don't know why, perhaps because the headers? or aiohttp?I will try to find the reason.

from poe-api.

ading2210 avatar ading2210 commented on September 28, 2024 2

Sorry for the lack of an update, but I'm currently busy right now and won't be able to work on this for at least a week. Although if someone submits a PR that fixes this issue then I'll merge it and publish a new release.

from poe-api.

johnd0e avatar johnd0e commented on September 28, 2024 2

https://github.com/x404xx/POE-Api seems ok

from poe-api.

Hafi-Ansari avatar Hafi-Ansari commented on September 28, 2024 1

"After investigating, I found that accessing https://poe.com/ using GET method prompts a 403 error, 'Enable JavaScript and cookies to continue.' I can successfully retrieve data by using the Selenium library to access https://poe.com/, but it requires writing the cookies: p-b, __cf_bm, and cf_clearance in advance."

is what @31702160136 is saying, but what exactly does this mean?

from poe-api.

bolavefasfas avatar bolavefasfas commented on September 28, 2024 1

Hi Guys,

Started getting this error on Saturday, I sent an email to Poe and they said that the specific IP has been blocked for 7 days. I have tried using my same token from another IP, I tried getting another account with a different token and all have come up with the same 403 error. I think that they must have some antiscraping software running which is flagging the API requests. Has anyone tried using sock5 proxies ? Any better ?

Did you try new account with new ip ?
And if they are banning or they have some mechanism in place and even if new ip with new account works it will be useless as it will be limited again right ?

I have tried with diffrent ip and diffrent account key still the error

from poe-api.

canxin121 avatar canxin121 commented on September 28, 2024 1
image async poe client didn't have this problem, but it could't extarct formkey, "document is not defined", it requires a browser environment to run the script? I could't find a way to do that except for playwright. So i set formkey a must currently.But all other fuctions run well.

from poe-api.

DogManTC avatar DogManTC commented on September 28, 2024 1

I've fixed this in the latest commit, but the library is still broken due to changes in the __NEXT_DATA__ format.

So does it work now or not?

from poe-api.

Toaster496 avatar Toaster496 commented on September 28, 2024

same here

from poe-api.

cmldyu avatar cmldyu commented on September 28, 2024

same problem

from poe-api.

445022889 avatar 445022889 commented on September 28, 2024

一样的遭遇。

from poe-api.

media1demo avatar media1demo commented on September 28, 2024

yeah same here RuntimeError: Failed to download https://poe.com too many times.

from poe-api.

bolavefasfas avatar bolavefasfas commented on September 28, 2024

Its hapenning on older versions as well i was in v0.4.x
Its sad i had lots of texts to summerize

from poe-api.

freQuensy23-coder avatar freQuensy23-coder commented on September 28, 2024

Same problem(

from poe-api.

 avatar commented on September 28, 2024

same here!

from poe-api.

Milou4Dev avatar Milou4Dev commented on September 28, 2024

SAME

from poe-api.

chaney1030 avatar chaney1030 commented on September 28, 2024

same

from poe-api.

Hafi-Ansari avatar Hafi-Ansari commented on September 28, 2024

Unfortunately same :(

from poe-api.

double-zinc avatar double-zinc commented on September 28, 2024

same here :(

from poe-api.

31702160136 avatar 31702160136 commented on September 28, 2024

我经过排查后发现使用GET访问https://poe.com提示403,Enable JavaScript and cookies to continue。我使用selenium库去访问https://poe.com可以成功获取到数据,但需要提前写入cookie:p-b、__cf_bm、cf_clearance才可以

from poe-api.

31702160136 avatar 31702160136 commented on September 28, 2024

"After investigating, I found that accessing https://poe.com/ using GET method prompts a 403 error, 'Enable JavaScript and cookies to continue.' I can successfully retrieve data by using the Selenium library to access https://poe.com/, but it requires writing the cookies: p-b, __cf_bm, and cf_clearance in advance."

is what @31702160136 is saying, but what exactly does this mean?

我对这方面不太熟悉,我认为是需要加载JavaScript后才可以获得到数据,我们通常使用代码进行GET请求页面是无法加载JavaScript的,但是使用浏览器就可以加载JavaScript

from poe-api.

Hafi-Ansari avatar Hafi-Ansari commented on September 28, 2024

"After investigating, I found that accessing https://poe.com/ using GET method prompts a 403 error, 'Enable JavaScript and cookies to continue.' I can successfully retrieve data by using the Selenium library to access https://poe.com/, but it requires writing the cookies: p-b, __cf_bm, and cf_clearance in advance."
is what @31702160136 is saying, but what exactly does this mean?

我对这方面不太熟悉,我认为是需要加载JavaScript后才可以获得到数据,我们通常使用代码进行GET请求页面是无法加载JavaScript的,但是使用浏览器就可以加载JavaScript

Have you confirmed that this method works?

from poe-api.

445022889 avatar 445022889 commented on September 28, 2024

我经过排查后发现使用GET访问https://poe.com提示403,Enable JavaScript and cookies to continue。我使用selenium库去访问https://poe.com可以成功获取到数据,但需要提前写入cookie:p-b、__cf_bm、cf_clearance才可以

昨天用golang的chromedp访问好像也没问题,只需要加入p-b就行

from poe-api.

31702160136 avatar 31702160136 commented on September 28, 2024

我经过排查后发现使用GET访问https://poe.com提示403,启用JavaScript和cookie才能继续。我使用selenium去库访问https://poe.com可以成功获取到数据,但需要提前写入cookie :pb、__cf_bm、cf_clearance才可以

昨天用golang的chromedp访问没什么问题,只需要加入pb就行

我试了一下,确实只需要pb,之前我需要加入__cf_bm和cf_clearance是因为浏览器有缓存

from poe-api.

31702160136 avatar 31702160136 commented on September 28, 2024

“经过调查,我发现使用 GET 方法访问https://poe.com/会提示 403 错误,'启用 JavaScript 和 cookies 即可继续'。我可以使用 Selenium 库访问https://poe.com/成功检索数据,但需要提前写入cookie:pb、__cf_bm 和 cf_clearance。”
是什么@31702160136是这么说的,但这到底是什么意思呢?

我对这方面还不太熟悉,我认为是需要加载JavaScript后才能获得数据,通常使用我们的代码进行GET请求页面是无法加载JavaScript的,但是使用浏览器就可以加载JavaScript

你确认这个方法有效吗?

确实能有效获得到数据,但是又遇到了新的问题,提示’document‘ is not defined,可能是formkey算法变了

from poe-api.

tejas36026 avatar tejas36026 commented on September 28, 2024

me too getting the same

from poe-api.

mahmuod711 avatar mahmuod711 commented on September 28, 2024

Same Problem

from poe-api.

YUFOHON avatar YUFOHON commented on September 28, 2024

same

from poe-api.

sycapple avatar sycapple commented on September 28, 2024

same

from poe-api.

RamyGomaa avatar RamyGomaa commented on September 28, 2024

same on an older version too, looks like it's a general problem, not a version specific one.

from poe-api.

asce0 avatar asce0 commented on September 28, 2024

does anyone get any idea about how to solve this error?

from poe-api.

kraravind avatar kraravind commented on September 28, 2024

getting the same issue, i went to poe, got the token value through inspect and ran the poe.Client and passed the token. This is the error below, please help:
File ~\anaconda3\Lib\site-packages\poe_init_.py:156, in Client.init(self, token, proxy, headers, device_id, client_identifier, formkey)
153 self.formkey_salt = None
154 self.formkey = formkey
--> 156 self.connect_ws()

File ~\anaconda3\Lib\site-packages\poe_init_.py:446, in Client.connect_ws(self, timeout)
443 self.ws_connected = False
445 if self.connect_count % 5 == 0:
--> 446 self.setup_connection()
448 self.connect_count += 1
450 ws = websocket.WebSocketApp(
451 self.get_websocket_url(),
452 header={"User-Agent": user_agent},
(...)
456 on_close=self.on_ws_close
457 )

File ~\anaconda3\Lib\site-packages\poe_init_.py:182, in Client.setup_connection(self)
179 self.setup_count += 1
181 self.ws_domain = f"tch{random.randint(1, 1e6)}"
--> 182 self.next_data = self.get_next_data(overwrite_vars=True)
183 self.channel = self.get_channel_data()
185 self.gql_headers = {
186 "poe-formkey": self.formkey,
187 "poe-tchannel": self.channel["channel"],
188 }

File ~\anaconda3\Lib\site-packages\poe_init_.py:244, in Client.get_next_data(self, overwrite_vars)
241 def get_next_data(self, overwrite_vars=False):
242 logger.info("Downloading next_data...")
--> 244 r = request_with_retries(self.session.get, self.home_url)
245 json_regex = r'<script id="__NEXT_DATA__" type="application\/json">(.+?)</script>'
246 json_text = re.search(json_regex, r.text).group(1)

File ~\anaconda3\Lib\site-packages\poe_init_.py:84, in request_with_retries(method, *args, **kwargs)
81 raise RuntimeError("Invalid or missing token.")
82 logger.warn(f"Server returned a status code of {r.status_code} while downloading {url}. Retrying ({i+1}/{attempts})...")
---> 84 raise RuntimeError(f"Failed to download {url} too many times.")

RuntimeError: Failed to download https://poe.com/ too many times.

from poe-api.

teclectic avatar teclectic commented on September 28, 2024

Hi Guys,

Started getting this error on Saturday, I sent an email to Poe and they said that the specific IP has been blocked for 7 days. I have tried using my same token from another IP, I tried getting another account with a different token and all have come up with the same 403 error. I think that they must have some antiscraping software running which is flagging the API requests. Has anyone tried using sock5 proxies ? Any better ?

from poe-api.

4781121 avatar 4781121 commented on September 28, 2024

作者也不出来说两句, 也不知道是能解决还是不能解决

from poe-api.

akl7777777 avatar akl7777777 commented on September 28, 2024

解决应该是能解决,但是一解决就会被盯上,估计也是难

from poe-api.

teclectic avatar teclectic commented on September 28, 2024

Hi Guys,
Started getting this error on Saturday, I sent an email to Poe and they said that the specific IP has been blocked for 7 days. I have tried using my same token from another IP, I tried getting another account with a different token and all have come up with the same 403 error. I think that they must have some antiscraping software running which is flagging the API requests. Has anyone tried using sock5 proxies ? Any better ?

Did you try new account with new ip ? And if they are banning or they have some mechanism in place and even if new ip with new account works it will be useless as it will be limited again right ?

I have tried with diffrent ip and diffrent account key still the error

Yes still get the same error. Any luck with proxies or selenium?

from poe-api.

 avatar commented on September 28, 2024

Hi Guys,
Started getting this error on Saturday, I sent an email to Poe and they said that the specific IP has been blocked for 7 days. I have tried using my same token from another IP, I tried getting another account with a different token and all have come up with the same 403 error. I think that they must have some antiscraping software running which is flagging the API requests. Has anyone tried using sock5 proxies ? Any better ?

Did you try new account with new ip ? And if they are banning or they have some mechanism in place and even if new ip with new account works it will be useless as it will be limited again right ?
I have tried with diffrent ip and diffrent account key still the error

Yes still get the same error. Any luck with proxies or selenium?

have you tried to set a Custom Device ID with new IP and account ?
from the README:

Setting a Custom Device ID:

If you want to change the device ID that is being spoofed, you can use the poe.set_device_id, which accepts the following arguments:

user_id - The user ID of the account you want to change the device ID for. The user ID can be found at client.viewer["poeUser"]["id"].
device_id - The new device ID. This is a 32 character UUID string in the following format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

poe.set_device_id("UGMlVXqlcLYyMOATMDsKNTMz", "6d659b04-043a-41f8-97c7-fb7d7fe9ad34")

The device IDs are saved to ~/.config/poe-api/device_id.json on Unix-like systems, and C:\Users<user>\AppData\Roaming\poe-api\device_id.json on Windows.

Additionally, the poe.get_device_id function or client.device_id can be used to retrieve the saved device ID.

poe.get_device_id("UGMlVXqlcLYyMOATMDsKNTMz")
#6d659b04-043a-41f8-97c7-fb7d7fe9ad34

client.device_id
#6d659b04-043a-41f8-97c7-fb7d7fe9ad34"

from poe-api.

pythonhook avatar pythonhook commented on September 28, 2024

How to resolve this, guys

from poe-api.

wangyu1997 avatar wangyu1997 commented on September 28, 2024

感觉解决不了 放弃了一个月了 作者好像没有要解决的意思 换个库吧兄弟

from poe-api.

pythonhook avatar pythonhook commented on September 28, 2024

from poe-api.

445022889 avatar 445022889 commented on September 28, 2024

目前自己golang用的无头浏览器,劫持ws消息,勉强能用吧,不用一堆js,希望作者早日修复bug

有什么好的库推荐下呗

---Original--- From: "Wang @.> Date: Wed, Aug 9, 2023 15:20 PM To: @.>; Cc: @.@.>; Subject: Re: [ading2210/poe-api] Server returned a status code of 403 whiledownloading https://poe. com (Issue #218) 感觉解决不了 放弃了一个月了 作者好像没有要解决的意思 换个库吧兄弟 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

from poe-api.

teclectic avatar teclectic commented on September 28, 2024

from poe-api.

ongspxm avatar ongspxm commented on September 28, 2024
curl 'https://poe.com/' \
  -H 'authority: poe.com' \
  -H 'cookie: p-b=<token>' \
  -H 'user-agent: <copy user-agent>' --http2

after testing with curl

  • found that both "authority" and "user-agent" header required
  • http1.1 doesnt work (tested with --http1.1 on curl and it gave the error), http2 does

but...

  • requests is a 1.1 only library, maybe httpx might work?

can anybody confirm this?

from poe-api.

claell avatar claell commented on September 28, 2024

@ading2210 You added the help wanted label. Is there anything you need right now? Or are you just busy with other stuff right now?

from poe-api.

huyremy avatar huyremy commented on September 28, 2024

@ading2210 You added the help wanted label. Is there anything you need right now? Or are you just busy with other stuff right now?

and...I feel something like dead project.

from poe-api.

fanxyu avatar fanxyu commented on September 28, 2024

希望作者能注意到这个问题,解决一下

from poe-api.

claell avatar claell commented on September 28, 2024

Alright, thanks for the update! If your understanding is correct, that would be rather sad to see.

@canxin121 I assume you experience the same problem with your async client?

from poe-api.

canxin121 avatar canxin121 commented on September 28, 2024

not the same promblem, i can successfuly download the poe.com, but i can't send query successfullt.

from poe-api.

mak448a avatar mak448a commented on September 28, 2024

My current understanding of this bug is that Poe has started enforcing some sort of cloudflare-based verification which requires a full web browser.

Maybe selenium would work for this project?

from poe-api.

claell avatar claell commented on September 28, 2024

@mak448a see #195

from poe-api.

claell avatar claell commented on September 28, 2024

@canxin121 That's interesting findings. Apparently, a web browser might only be required to retrieve the formkey, then (if even that)? That might leave some room for a hybrid solution where the formkey can get extracted through browser automation and following that the API can still be used.

from poe-api.

4781121 avatar 4781121 commented on September 28, 2024

@ading2210 可以参考这个项目, 他解决了目前的问题, https://github.com/canxin121/Async-Poe-Client

from poe-api.

ading2210 avatar ading2210 commented on September 28, 2024

not the same promblem, i can successfuly download the poe.com, but i can't send query successfullt.
@canxin121

Are you able to port those changes from your async client to this library?

from poe-api.

GoAwayNow avatar GoAwayNow commented on September 28, 2024

@ongspxm
I got a 200 returned with a full set of browser cookies and the user-agent. I didn't use the authority header and made the request with http1.1. I don't know if it's the same for everyone, but it seems to be entirely a Cloudflare issue for me.

from poe-api.

tic-top avatar tic-top commented on September 28, 2024

寄!

from poe-api.

Iamprashanth-1 avatar Iamprashanth-1 commented on September 28, 2024

try g4f pypi

from poe-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.