opentele icon indicating copy to clipboard operation
opentele copied to clipboard

Errors at loop, need help.

Open ghost opened this issue 2 years ago • 2 comments

hello mate, i very like your repo but i have problem with opentele.

i want create many session file from tdata folders

async def main():
	_path = input("[Path]> ")
	all_dirs = glob.glob(f"{_path}/*/Telegram/*/")
	print(len(all_dirs))
	for tdataFolder in all_dirs:
		try:
			time.sleep(2)
			tdesk = TDesktop(tdataFolder)
			api = API.TelegramIOS.Generate()
			savePath = r"tgses\\" + str(int(time.time())) + ".session"
			client = await tdesk.ToTelethon(savePath, CreateNewSession, api)
			await client.connect()
			await client.PrintSessions()
			await client.disconnect()
		except TDesktopUnauthorized:
			print("TDesktopUnauthorized | TDesktop client is unauthorized")
			continue
		except OpenTeleException:
			print("OpenTeleException | No account has been loaded")
			continue
		except LoginFlagInvalid:
			print("LoginFlagInvalid | LoginFlag invalid")
			continue
		except Exception as ex:
			print(ex)
			continue
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
asyncio.run(main())

i used try except , and have this error:

 File "C:\Users\Plutonium\Desktop\tdata.py", line 51, in main
    client = await tdesk.ToTelethon(savePath, CreateNewSession, api)

telethon.errors.common.InvalidBufferError: Invalid response buffer (HTTP code 404)

Future exception was never retrieved
future: <Future finished exception=InvalidBufferError('Invalid response buffer (HTTP code 404)')>

And this error:

maximum recursion depth exceeded in comparison

how fix it ? pls help me.

ghost avatar May 24 '22 11:05 ghost

The same issue, everything was good with one account at tdata if more than get 'maximum recursion depth exceeded'

Ch4ttY avatar May 25 '22 20:05 Ch4ttY

did anybody figure out how to do this? i get maxium recursion depth exceeded all the time

faredus avatar May 29 '22 21:05 faredus