Te-k / harpoon

CLI tool for open source and threat intelligence
https://www.randhome.io/blog/2018/02/23/harpoon-an-osint-/-threat-intelligence-tool/
GNU General Public License v3.0
1.18k stars 182 forks source link

Telegram Problem #50

Closed vsalehi closed 6 years ago

vsalehi commented 6 years ago

I haves problems with telegram. python and Telethon version is: python3.6 Telethon 0.17.4.1

root@kali:~/harpoon# harpoon telegram messages cybersecurity
Traceback (most recent call last):
  File "/usr/local/bin/harpoon", line 11, in <module>
    load_entry_point('harpoon==0.1.1', 'console_scripts', 'harpoon')()
  File "/usr/local/lib/python3.6/dist-packages/harpoon-0.1.1-py3.6.egg/harpoon/main.py", line 52, in main
    plugins[args.command].run(config, args, plugins)
  File "/usr/local/lib/python3.6/dist-packages/harpoon-0.1.1-py3.6.egg/harpoon/commands/telegram.py", line 78, in run
    print("%i messages downloaded:" % messages[0])
  File "/usr/lib/python3.6/collections/__init__.py", line 1050, in __getitem__
    def __getitem__(self, i): return self.data[i]
IndexError: list index out of range
Te-k commented 6 years ago

Nice catch, it comes from changes in the Telethon API. I just fixed it and forced a recent version in requirements.txt. So it should be good now, let me know

vsalehi commented 6 years ago

Hi, I got some errors again

root@kali:~/harpoon# harpoon telegram messages osint
5 messages downloaded:
[2016-03-03T22:40:42] Media (973 views)
[2015-09-23T17:48:01] Iedereen kan meelezen, maar alleen beheerders kunnen wat plaatsen. (885 views)
Traceback (most recent call last):
  File "/usr/local/bin/harpoon", line 11, in <module>
    load_entry_point('harpoon==0.1.1', 'console_scripts', 'harpoon')()
  File "/usr/local/lib/python3.6/dist-packages/harpoon-0.1.1-py3.6.egg/harpoon/main.py", line 52, in main
    plugins[args.command].run(config, args, plugins)
  File "/usr/local/lib/python3.6/dist-packages/harpoon-0.1.1-py3.6.egg/harpoon/commands/telegram.py", line 88, in run
    msg.action.message
AttributeError: 'MessageActionChatEditPhoto' object has no attribute 'message'
Te-k commented 6 years ago

Yes, the text version of messages is not fully implemented because you need to have a specific output for every different message type, in that case MessageActionChatEditPhoto was not implemented. I just implemented it, so it works for the osint channel but I would not be surprised that there are many other messages types not implemented yet. Feel free to implement them yourself, or use the json output (-f json)

Te-k commented 6 years ago

I close