GithubHelp home page GithubHelp logo

vhdmsm / tg_crawler Goto Github PK

View Code? Open in Web Editor NEW
77.0 77.0 24.0 63 KB

Just a crawler based on tg-cli for Telegram. Deprecated by now, please use telegram-export.

License: GNU General Public License v3.0

Python 100.00%
crawler telegram telegram-cli telegram-crawler text-mining

tg_crawler's People

Contributors

vhdmsm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

tg_crawler's Issues

Error in crawler.py

length of channel messages: 3
in channel $05000000800c293c9655296d98364b7f error has been occurred!
{u'error_code': 71, u'result': u'FAIL', u'error': u'RPC_CALL_FAIL 400: CHANNEL_INVALID'}
time: Mon Nov 13 23:55:34 2017 #channel: 16, channel_id: $05000000864b043cdfd7e2e3ef5cd490

I get the above error repeatedly (for different channel ids) when I run the crawler.py

crawler.py didn't work correctly

I have installed telegram-cli compeltely and when I run the command ./bin/telegram-cli -k server_pub -p 4458 --json I got the following output:

{"event": "message", "id": "05000000558380401500000000000000fa5738a4b844d66d", "flags": 256, "from": {"id": "$0500000055838040fa5738a4b844d66d", "peer_type": "channel", "peer_id": 1082164053, "print_name": "Hotgram", "flags": 65537, "title": "Hotgram", "participants_count": 0, "admins_count": 0, "kicked_count": 0}, "to": {"id": "$0500000055838040fa5738a4b844d66d", "peer_type": "channel", "peer_id": 1082164053, "print_name": "Hotgram", "flags": 65537, "title": "Hotgram", "participants_count": 0, "admins_count": 0, "kicked_count": 0}, "out": false, "unread": false, "service": false, "date": 1515446283, "text": "💥⁉️ نسخه جدید اندروید  هاتگرام منتشر شد  \n\nبرای فعالسازی و استفاده از هاتگرام نیازی \nبه استفاده از فیلترشکن نیست.\n\nاز لینک زیر دانلود کنید👇👇👇\n \napp.hotgram.ir/hotgramv160.apk\n\nیا فایل زیر را دانلود و سپس نصب کنید     \n\n👇👇👇"}
{"event": "message", "id": "05000000558380401600000000000000fa5738a4b844d66d", "flags": 256, "from": {"id": "$0500000055838040fa5738a4b844d66d", "peer_type": "channel", "peer_id": 1082164053, "print_name": "Hotgram", "flags": 65537, "title": "Hotgram", "participants_count": 0, "admins_count": 0, "kicked_count": 0}, "to": {"id": "$0500000055838040fa5738a4b844d66d", "peer_type": "channel", "peer_id": 1082164053, "print_name": "Hotgram", "flags": 65537, "title": "Hotgram", "participants_count": 0, "admins_count": 0, "kicked_count": 0}, "out": false, "unread": false, "service": false, "date": 1515446299, "media": {"type": "document"}}

and when I run the crawler.py, I got this error:

Running crawler...
Traceback (most recent call last):
  File "crawler.py", line 335, in <module>
    pubkey_file="/path/to/tg/tg-server.pub") # for example: "/Users/vahid/PycharmProjects/tchannels-gif/tg/server.pub"
  File "/usr/local/lib/python2.7/dist-packages/pytg/__init__.py", line 31, in __init__
    self.startCLI(telegram=telegram, pubkey_file=pubkey_file, custom_cli_args=custom_cli_args, port=port)
  File "/usr/local/lib/python2.7/dist-packages/pytg/__init__.py", line 79, in startCLI
    self._proc = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, preexec_fn = preexec_function)
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/local/lib/python2.7/dist-packages/pytg/__init__.py", line 94, in stopCLI
    if self.sender:
AttributeError: 'Telegram' object has no attribute 'sender'
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/usr/local/lib/python2.7/dist-packages/pytg/__init__.py", line 94, in stopCLI
    if self.sender:
AttributeError: 'Telegram' object has no attribute 'sender'

sender.channel_join in not work

hello @vhdmsm (Vahid Masoumi)
channel_join function is not work but you use it.
for example i can't join to gizmiztel channel. this error is : pytg.exceptions.FailException: Error 38: 'can not parse arg #1' (command '[disable_preview] channel_join @gizmiztel\n')
but msg function works:
sender.msg("@Username", "Hello World!")
Response: True

Thank you

Can't get messages from private chats

Hi, may I ask how can I use Telegram-Crawler to extract messages from private chats. I can only get messages from GroupMessages and SupergroupMessages.

Thanks!

Fundamental bug

Hi countryman,
You have a bad bud in your package.
When run crawler.py got this exception:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/vahid/PycharmProjects/tchannels-gif/tg/bin/telegram-cli'
Use a relative address instead of absolute address.

Group

Hi- 1) Does the bot attach to groups as well or just channel? To my understanding, a can only join a group, if you are the admin/owner of the group. I would appreciate your comment. 2) Is it possible to obtain the userid of a user who posts to the group using crawler? Thank you

AttributeError: 'Telegram' object has no attribute 'sender'

Hey there
when I run the crawler.py using python 3.6 I got this error :
FileNotFoundError: [Errno 2] No such file or directory: '/path/to/tg/bin/telegram-cli': '/path/to/tg/bin/telegram-cli'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/pytg/init.py", line 94, in stopCLI
if self.sender:
AttributeError: 'Telegram' object has no attribute 'sender'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.