vhdmsm / tg_crawler Goto Github PK
View Code? Open in Web Editor NEWJust a crawler based on tg-cli for Telegram. Deprecated by now, please use telegram-export.
License: GNU General Public License v3.0
Just a crawler based on tg-cli for Telegram. Deprecated by now, please use telegram-export.
License: GNU General Public License v3.0
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
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'
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
hi
I cant get message from big channels by receiver...
can u help me?
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!
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.
Hi:
I want to crawl my target room.
how can i get channel_id like:
$0500000061cd86479e2ba45974fb41eb
thanks
firstname, lastname are not in the CREATE TABLE definition, total 12 columns in the db, 14 attempted to be inserted.
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
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'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.