Title: ValueError: Failed to send message: 400 {'captcha_key': ['captcha-required'] · Issue #62 · 2captcha/2captcha-python · GitHub
Open Graph Title: ValueError: Failed to send message: 400 {'captcha_key': ['captcha-required'] · Issue #62 · 2captcha/2captcha-python
X Title: ValueError: Failed to send message: 400 {'captcha_key': ['captcha-required'] · Issue #62 · 2captcha/2captcha-python
Description: Hey man! Could you guide me with this? What am I doing wrong? async def send_message(self, message, api_key: str): headers = self.__get_headers() async with self.__session.post( f"{self.BASE_URL}{self.TYPE_ENDPOINT_START}{self.channel_id...
Open Graph Description: Hey man! Could you guide me with this? What am I doing wrong? async def send_message(self, message, api_key: str): headers = self.__get_headers() async with self.__session.post( f"{self.BASE_URL}{s...
X Description: Hey man! Could you guide me with this? What am I doing wrong? async def send_message(self, message, api_key: str): headers = self.__get_headers() async with self.__session.post( f"{self.BASE_U...
Opengraph URL: https://github.com/2captcha/2captcha-python/issues/62
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ValueError: Failed to send message: 400 {'captcha_key': ['captcha-required']","articleBody":" Hey man! Could you guide me with this? What am I doing wrong?\r\n \r\n async def send_message(self, message, api_key: str):\r\n headers = self.__get_headers()\r\n\r\n async with self.__session.post(\r\n f\"{self.BASE_URL}{self.TYPE_ENDPOINT_START}{self.channel_id}{self.TYPE_ENDPOINT_END}\", headers=headers,\r\n ) as response:\r\n if response.status == 204:\r\n pass\r\n else:\r\n raise ValueError(f\"Failed to type: {response.status} {await response.json()}\")\r\n\r\n async with self.__session.post(\r\n f\"{self.BASE_URL}{self.SEND_ENDPOINT_START}{self.channel_id}{self.SEND_ENDPOINT_END}\", headers=headers,\r\n json={\"content\": message, \"flags\": 0, \"nonce\": \"f4yh5\", \"tts\": False}\r\n ) as response:\r\n if response.status == 200:\r\n data = await response.json()\r\n self.__message_id = data[\"id\"]\r\n return data[\"id\"]\r\n else:\r\n data = await response.json()\r\n solver = TwoCaptcha(apiKey=api_key)\r\n result = await solver.hcaptcha(\r\n sitekey=\"a9b5fb07-92ff-493f-86fe-352a2803b3df\",\r\n url='https://discord.com/',\r\n data=data['captcha_rqdata'],\r\n invisible=True,\r\n UserAgent='Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) '\r\n 'discord/1.0.9016 Chrome/108.0.5359.215 Electron/22.3.12 Safari/537.36'\r\n )\r\n headers.update({\"X-Captcha-Key\": result[\"code\"]})\r\n async with self.__session.post(\r\n f\"{self.BASE_URL}{self.SEND_ENDPOINT_START}{self.channel_id}{self.SEND_ENDPOINT_END}\",\r\n headers=headers,\r\n json={\"content\": message, \"flags\": 0, \"nonce\": \"nonce\", \"tts\": False}\r\n ) as resp:\r\n if resp.status == 200:\r\n data = await resp.json()\r\n self.__message_id = data[\"id\"]\r\n return data[\"id\"]\r\n else:\r\n raise ValueError(f\"Failed to send message: {resp.status} {await resp.json()}\")","author":{"url":"https://github.com/CodecNomad","@type":"Person","name":"CodecNomad"},"datePublished":"2023-08-16T11:15:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/62/2captcha-python/issues/62"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f9997c72-03c1-0784-b125-07dfe10fcf85 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AB8C:146535:13B8B53:1908E52:6990311C |
| html-safe-nonce | f010a1f44c30601cf9aebabc3cf65b89a344c6c42665e00b6f2002934fe0d935 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjhDOjE0NjUzNToxM0I4QjUzOjE5MDhFNTI6Njk5MDMxMUMiLCJ2aXNpdG9yX2lkIjoiODc1Mjc3MDYwNjc0Njk1NDUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 27e852c0606193dc9da3cb36a630245cc4b7076d738344c5513f8f72180ca2e8 |
| hovercard-subject-tag | issue:1853024355 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/2captcha/2captcha-python/62/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f13ad30bd4ffcf4aa9ff8813e2ed333b3b320dd4d682541d4024af2a48f4ff97/2captcha/2captcha-python/issues/62 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f13ad30bd4ffcf4aa9ff8813e2ed333b3b320dd4d682541d4024af2a48f4ff97/2captcha/2captcha-python/issues/62 |
| og:image:alt | Hey man! Could you guide me with this? What am I doing wrong? async def send_message(self, message, api_key: str): headers = self.__get_headers() async with self.__session.post( f"{self.BASE_URL}{s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | CodecNomad |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/2captcha/2captcha-python git https://github.com/2captcha/2captcha-python.git |
| octolytics-dimension-user_id | 16306999 |
| octolytics-dimension-user_login | 2captcha |
| octolytics-dimension-repository_id | 264179044 |
| octolytics-dimension-repository_nwo | 2captcha/2captcha-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 264179044 |
| octolytics-dimension-repository_network_root_nwo | 2captcha/2captcha-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b33c5aedc9808f45bc5fcf0b1e4404cf749dac7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width