Taosky/telegram-search-bot

导入遇到新问题

Closed this issue · 3 comments

Traceback (most recent call last):
File "/app/json_receive.py", line 167, in
main()
File "/app/json_receive.py", line 110, in main
filesize = int(filesize)
ValueError: invalid literal for int() with base 10: '5213871{\n "name": "Coder Offtopic 中文群",\n "type": "public_supergroup",\n "id": 1154313178,\n "messages": [\n {\n "id": 2632606,\n "type": "message",\n "date": "2023-09-08T00:02:42",\n "date

Taosky commented

不应该啊,先传过去的是文件名和文件大小。

filesize = os.path.getsize(filepath)
    client.send(f"{filepath}{SEPARATOR}{filesize}".encode())

奇怪的事发生了,我又试了下,又可以了

發生同樣的事,client.send先後不能保證,我是先加了一秒delay減少出現次數