RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-580418

user580418's questions

Martin Hope
user580418
Asked: 2024-04-20 03:25:12 +0000 UTC

关于无法连接到电报服务器的周期性错误。爱图

  • 6

有一个电报机器人已经工作了 3 个月,大约 2 周前开始出现定期错误,无法连接到电报服务器,尽管那里有互联网,有关于如何解决此问题的想法吗?

python --version

Python 3.11.5
python -m pip show aiogram

Name: aiogram
Version: 3.3.0
Summary: Modern and fully asynchronous framework for Telegram Bot API
Home-page:
Author:
Author-email: Alex Root Junior <[email protected]>
License:
Location: C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages
Requires: aiofiles, aiohttp, certifi, magic-filter, pydantic, typing-extensions
Required-by:
python -m pip show aiohttp

Name: aiohttp
Version: 3.9.1
Summary: Async http client/server framework (asyncio)
Home-page: https://github.com/aio-libs/aiohttp
Author:
Author-email:
License: Apache 2
Location: C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages
Requires: aiosignal, attrs, frozenlist, multidict, yarl
Required-by: aiogram

该机器人在 Windows 11 的 PC 上启动,PC 上的时间是正确的错误示例:

Failed to fetch updates - TelegramNetworkError: HTTP Client says - ClientConnectorError: Cannot connect to host api.telegram.org:443 ssl:default [getaddrinfo failed]
Sleep for 1.000000 seconds and try again... (tryings = 0, bot id = *******))
Failed to fetch updates - TelegramNetworkError: HTTP Client says - ClientConnectorError: Cannot connect to host api.telegram.org:443 ssl:default [getaddrinfo failed]
Sleep for 1.264188 seconds and try again... (tryings = 1, bot id = *******))
Failed to fetch updates - TelegramNetworkError: HTTP Client says - ClientConnectorError: Cannot connect to host api.telegram.org:443 ssl:default [getaddrinfo failed]
Sleep for 1.678613 seconds and try again... (tryings = 2, bot id = *******))
Failed to fetch updates - TelegramNetworkError: HTTP Client says - ClientConnectorError: Cannot connect to host api.telegram.org:443 ssl:default [getaddrinfo failed]
Sleep for 2.187897 seconds and try again... (tryings = 3, bot id = *******)
telegram-bot
  • 1 个回答
  • 29 Views
Martin Hope
user580418
Asked: 2024-04-15 15:26:56 +0000 UTC

如何查看别人的Android应用程序的互联网请求?

  • 5

有没有办法查看 Android 应用程序到底向互联网发送了什么内容?有点像浏览器的开发人员菜单中的网络选项卡。安卓应用程序不是我的。PacketCapture 不显示请求正文,这正是您需要了解的。

android
  • 1 个回答
  • 44 Views
Martin Hope
user580418
Asked: 2024-02-18 20:19:45 +0000 UTC

通过 aiogram 从 telegram bot 接收文件

  • 5

如何下载由人发送给机器人的 xlsx 文件? 有一个机器人应该发送 xlsx 文件,但它已经以某种样式转换为 pdf 格式;转换已通过 openpyxl 准备就绪,但是接收文件时出现问题。

@dp.message(F.content_type == ContentType.DOCUMENT)
async def get_doc(message: types.Message):
    file_id = message.document.file_id
    print(file_id)

    await Bot.download(bot,file_id,"test.xlsx",120)

这段代码完美下载文件

python
  • 1 个回答
  • 30 Views
Martin Hope
user580418
Asked: 2024-02-02 02:55:49 +0000 UTC

请求 python 不工作

  • 5

由于某种原因,请求在一台电脑上不起作用,它给出了一个错误,我尝试重新安装它,但它仍然出错。在其他电脑上相同的代码可以工作

Traceback (most recent call last):
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 467, in _make_request
    self._validate_conn(conn)
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 1096, in _validate_conn
    conn.connect()
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connection.py", line 642, in connect
    sock_and_verified = _ssl_wrap_socket_and_match_hostname(
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connection.py", line 782, in _ssl_wrap_socket_and_match_hostname
    ssl_sock = ssl_wrap_socket(
               ^^^^^^^^^^^^^^^^
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\ssl_.py", line 470, in ssl_wrap_socket
    ssl_sock = _ssl_wrap_socket_impl(sock, context, tls_in_tls, server_hostname)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\ssl_.py", line 514, in _ssl_wrap_socket_impl
    return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 517, in wrap_socket
    return self.sslsocket_class._create(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 1108, in _create
    self.do_handshake()
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\ssl.py", line 1379, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLEOFError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 790, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 491, in _make_request
    raise new_e
urllib3.exceptions.SSLError: [SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 844, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\retry.py", line 515, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='job.myсайт.ru', port=443): Max retries exceeded with url: /auth/self-employed/login (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\adelt\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\adapters.py", line 517, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='job.myсайт.ru', port=443): Max retries exceeded with url: /auth/self-employed/login (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1006)')))

我用了这个代码

import requests



json = {"phone": f"+12345678910"}
print(json)
#после этой строки происходит ошибка
r = requests.post("https://job.cfqn.ru/auth/self-employed/login", json=json)
print(r.status_code)
print(r.text)
python
  • 1 个回答
  • 65 Views
Martin Hope
user580418
Asked: 2024-01-25 22:54:57 +0000 UTC

如何通过 Windows 11 代理创建静态路由

  • 6

如何通过代理创建静态路由。有 2 个连接到您的 PC(以太网和 wi-fi) 如何通过代理将 1 个 ip 123.456.7.8 的站点重定向到以太网,其余连接通过 wi-fi ?有一个route add命令,但不清楚如何通过代理发送请求。我还找到了Tun2Socks,它只是通过代理发送请求,但我不明白如何重定向到特定的网络适配器。赢得 11 场审判:

route add ipпрокси mask 255.255.0.0 IPv4-адрес -p

但即使现在为所有程序启用代理,它也不会那样工作。或者可以通过一个keinetic路由器来完成,或者如果不是太贵的话需要什么样的设备?

маршрутизация
  • 1 个回答
  • 91 Views
Martin Hope
user580418
Asked: 2024-01-16 15:45:29 +0000 UTC

发送发布请求后出现错误“内容类型‘application/x-www-form-urlencoded;charset=UTF-8’不受支持”

  • 5

尝试使用此代码:

import requests

r = requests.post("https://job.сайт.ru/auth/self-employed/login", {"phone":"+12345678910"})
print(r.status_code)
print(r.text)

但出现错误:

{"systemMessage":"Content type 'application/x-www-form-urlencoded;charset=UTF-8' not supported","message":"Упс! Что-то пошло не так...","errors":{}}

我怎样才能解决这个问题?据我了解,他抱怨不支持UTF-8编码,但不幸的是我不知道如何修复它

:authority:job.сайт.ru
:method:POST
:path:/auth/self-employed/login
:scheme:https
Accept:application/json, text/plain, */*
Accept-Encoding:gzip, deflate, br
Accept-Language:ru,en;q=0.9,ko;q=0.8

这是如果您使用该网站并通过网站上的按钮提出相同的请求

python
  • 1 个回答
  • 42 Views
Martin Hope
user580418
Asked: 2024-01-15 14:45:23 +0000 UTC

如何使用Python发出授权的POST请求

  • 4

有一个站点发出post请求,如何使用Python使用Bearer授权发出POST请求。提供该站点的链接是没有意义的,因为您只能在某个网络上登录。 在此输入图像描述 在此输入图像描述 在此输入图像描述

尝试过这个:


import requests

data={"orderId":"b449e695-123-23-9f29-43999665ad6f","comment":" "}
url = 'https://job.сайт.ru/api/order/response/make'

import requests

headers = {
    'Authorization': 'Bearer удалено'
}



response = requests.post(
    url,
    data=data,
    headers=headers,
    timeout=30
)

print(response.status_code)  

result = response.json()
print(result)  

但有一个错误

Traceback (most recent call last):
  File "C:\Users\ad\PycharmProjects\pythonProject6\.venv\Lib\site-packages\requests\models.py", line 971, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.496.0_x64__qbz5n2kfra8p0\Lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.496.0_x64__qbz5n2kfra8p0\Lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.496.0_x64__qbz5n2kfra8p0\Lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\ad\PycharmProjects\pythonProject6\main.py", line 24, in <module>
    result = response.json()
             ^^^^^^^^^^^^^^^
  File "C:\Users\ad\PycharmProjects\pythonProject6\.venv\Lib\site-packages\requests\models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

如果您从站点行中删除“job.” 然后就没有错误了,但是当然不行:)

python
  • 1 个回答
  • 131 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5