proseltd / Telepathy-Community

Public release of Telepathy, an OSINT toolkit for investigating Telegram chats.
MIT License
949 stars 133 forks source link

<frozen runpy>", line 198, in _run_module_as_main #41

Closed Aria147 closed 1 year ago

Aria147 commented 1 year ago

Hi guys,

I have installed Telepathy, and it worked the first time. But now every time I wanna use it, Ill get this error:

Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "C:\Users\alien\AppData\Local\Programs\Python\Python311\Scripts\telepathy.exe__main.py", line 7, in File "C:\Users\alien\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 829, in call__ return self.main(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\alien\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 782, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "C:\Users\alien\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\alien\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 610, in invoke return callback(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\alien\AppData\Local\Programs\Python\Python311\Lib\site-packages\telepathy\telepathy.py", line 226, in cli client = TelegramClient(phone_number, api_id, api_hash) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\alien\AppData\Local\Programs\Python\Python311\Lib\site-packages\telethon\client\telegrambaseclient.py", line 275, in init session = SQLiteSession(session) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\alien\AppData\Local\Programs\Python\Python311\Lib\site-packages\telethon\sessions\sqlite.py", line 47, in init c = self._cursor() ^^^^^^^^^^^^^^ File "C:\Users\alien\AppData\Local\Programs\Python\Python311\Lib\site-packages\telethon\sessions\sqlite.py", line 242, in _cursor self._conn = sqlite3.connect(self.filename, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sqlite3.OperationalError: unable to open database file

Does anyone know why? I am a journalist and have very limited knowledge of Python. I'd be grateful if someone could help me.

aaarghhh commented 1 year ago

Hi @Aria147 , it seems that the database used by Telethon ( the library used by Telepathy ) to store the session used to authenticate you on Telegram is corrupt or missing. You can try to uninstall and reinstall the Telepathy package

pip3 uninstall purge telepathy
pip3 install telepathy

After, you have follow the step used to register your API token. Let me know if it resolves your issue.

sean-doody commented 1 year ago

@Aria147 Make sure you delete your session file before running the CLI again. I just ran into this same issue before realizing this was the problem.

proseltd commented 1 year ago

Thanks for this, Sean!

I’m working as quickly as possible to get some updates out to improve Telepathy, including a rehaul of how telegram sessions are handled. This should make this particular bug history. As far as I’m aware it’s an issue with how .session files are currently @.***

@.***(https://github.com/Aria147) Make sure you delete your session file before running the CLI again. I just ran into this same issue before realizing this was the problem.

sean-doody commented 1 year ago

Awesome @jordanwildon — I'll keep an eye out for updates! This is a really great tool.

Cheers!

proseltd commented 1 year ago

@sean-doody (and also @Aria147), feel free to drop me a message on Twitter (@irohsint) and I might be able to work through a few more of these issues with you directly. For now, I'll close this one on GitHub.