Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting session into tdata problem #135

Open
floutehh opened this issue Feb 10, 2025 · 0 comments
Open

Converting session into tdata problem #135

floutehh opened this issue Feb 10, 2025 · 0 comments

Comments

@floutehh
Copy link

my code here

from opentele.td import TDesktop
from opentele.tl import TelegramClient
from opentele.api import API, UseCurrentSession
import asyncio
import os

async def main():

# Load the client from telethon.session file
# We don't need to specify api, api_id or api_hash, it will use TelegramDesktop API by default.
client = TelegramClient("xxxxxxxxx.session")

# flag=UseCurrentSession
#
# Convert Telethon to TDesktop using the current session.
tdesk = await client.ToTDesktop(flag=UseCurrentSession)

# Save the session to a folder named "tdata"
tdesk.SaveTData()#"tdata")

asyncio.run(main())

When i run the whole code, i got error

"C:\Users\Administrator>C:\Users\Administrator\Desktop\hehe.py
[firstlineno] 140720065021064 - 140720065022920
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\hehe.py", line 1, in
from opentele.td import TDesktop
File "C:\Program Files\Python313\Lib\site-packages\opentele_init_.py", line 1, in
from . import td
File "C:\Program Files\Python313\Lib\site-packages\opentele\td_init_.py", line 2, in
from .shared import *
File "C:\Program Files\Python313\Lib\site-packages\opentele\td\shared.py", line 4, in
from .account import Account, StorageAccount, MapData
File "C:\Program Files\Python313\Lib\site-packages\opentele\td\account.py", line 3, in
from .configs import *
File "C:\Program Files\Python313\Lib\site-packages\opentele\td\configs.py", line 8, in
from .. import tl
File "C:\Program Files\Python313\Lib\site-packages\opentele\tl_init_.py", line 1, in
from .shared import *
File "C:\Program Files\Python313\Lib\site-packages\opentele\tl\shared.py", line 1, in
from .telethon import TelegramClient
File "C:\Program Files\Python313\Lib\site-packages\opentele\tl\telethon.py", line 66, in
@extend_class
^^^^^^^^^^^^
File "C:\Program Files\Python313\Lib\site-packages\opentele\utils.py", line 121, in new
raise BaseException("err")
BaseException: err"

I've been trying for several hours, but still the same. Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant