Start by removing any useless try except to see full traceback. or use traceback module.
the cause should be get_permissions or iter/get_participants. get id of failing chat and check it closely
Hi
How can I get when a user joins a channel? Not chat. @client.on(events.ChatAction) does not work.
Brother
I have saved session file
How to run code from session file directly without passing api_key and api_hash
can i stream a file with telethon?
like telegram downloaders when you start downloading streams file for you
Can you point me to a document where I can reference telethon version and the api layer it uses?
Читать полностью…If you want to increase up/down speed, you can install cryptg
via pip.
This module aims to provide a better encryption/decryption algorithm for Telegram clients.
If you want to increase speed even further, you can use this snippet
Be cautious while using it, because it can lead to FloodWait
error, as it uses multiple simultaneous connections.
Is there a limit to how many Sessions i can create? I have a lot of data on my account and i don't wanna get banned for creating a lot of sessions
Читать полностью…import os
from telethon.sync import TelegramClient
from telethon.errors import SessionPasswordNeededError
def get_user_input():
api_id = input("Enter your Telegram API ID: ")
api_hash = input("Enter your Telegram API Hash: ")
phone_number = input("Enter your phone number (with country code, e.g., +123456789): ")
return api_id, api_hash, phone_number
def delete_session_file():
session_file = "session.session"
if os.path.exists(session_file):
os.remove(session_file)
print("Session file deleted.")
def main():
api_id, api_hash, phone_number = get_user_input()
client = TelegramClient("session", api_id, api_hash)
try:
client.connect()
if not client.is_user_authorized():
client.send_code_request(phone_number)
try:
client.sign_in(phone_number, input("Enter the code you received: "))
except SessionPasswordNeededError:
password = input("Enter your 2-step verification password: ")
client.sign_in(password=password)
session_string = client.session.save()
print("Session string:", session_string,"\n\n Genrated By: @Wolf_Bots")
except Exception as e:
print(f"Error: {e}")
finally:
delete_session_file()
client.disconnect()
if __name__ == "__main__":
main()
getting this error from an exception but can't find where it's coming from.
'ChatParticipantsForbidden' object has no attribute 'participants'
I messed around with FastTelethon's connection_count and if I put 20 or something high the speed max out at 3MB/s also it's stable it doesn't go like 8, 4, 6, 7 if it's at 3MB/s it tends to stay at that but if I put the connection_count as 5 or something then the speed increases a lot and it's more volatile
Читать полностью…Hi and welcome to the group. Before asking any questions, please read the rules from the group's description, and don't forget to read the docs. Make sure you are using the latest version with pip3 install -U telethon
, since most problems have already been fixed in newer versions.
Code:async with client.conversation(event.chat_id) as x:
await x.send_message("GIVE ME THE FILE IN .TEXT EXTENSION FILE")
grpid = await x.get_response()
lol = await grpid.download()
try:
with open(lol, "r") as f:
Error:
lol = await grpid.download()
AttributeError: 'Message' object has no attribute 'download'
Just hardcode same api_id used to login and pass that to any session. api_hash is not required, it can be a random string
Читать полностью…Yesterday it was 10 MB/s every 10 seconds i printed out downloaded and total each time the "downloaded" increased around 100 - 140 MB I've been downloading files non-stop and I've noticed after 5-7 hours the speed has decreased to only 30MB every 10-13 seconds
Читать полностью…