Git Product home page Git Product logo

teleparser's Introduction

TeleParser

This is my project for parsing Telegram channels and chats and processing received data

Requirements

  1. Python 3.12.0 or earlier (CPython)
  2. MongoDB
  3. Your Telegram API token, learn more here

Get started

  1. Run git clone:
    git clone https://github.com/artmih24/TeleParser.git
  2. Go to project directory:
    cd TeleParser
  3. Create Python venv:
    • on Windows:
      python -m venv .
    • on Linux/macOS/other Unix-like OS:
      python3 -m venv .
  4. Select project Python venv:
    • on Windows:
      .\Scripts\activate
    • on Linux/macOS/other Unix-like OS:
      source ./bin/activate
  5. Install dependencies:
    • on Windows:
      pip install -r .\requirements.txt
    • on Linux/macOS/other Unix-like OS:
      pip3 install -r ./requirements.txt
  6. You can use setup scripts:
    • on Windows:
      .\setup.cmd
      or
      .\setup.bat
      or
      .\setup.ps1
    • on Linux/macOS/other Unix-like OS:
      ./setup.sh
  7. Get your own Telegram API token here

How to use

  1. Make sure that:
    • You have received Your Telegram API token
    • And You have replaced contents in config.ini file by your Telegram API token
  2. Launch this script:
    • on Windows:
      python .\TeleParser.py
    • on Linux/macOS/other Unix-like OS:
      python3 ./TeleParser.py
    • You can write channel or chat name (written after '@' or t.me//https://t.me/) as command-line argument
  3. Login in Telegram if You weren't logged in (trust me, this script doesn't steal your Telegram token, login and password)
  4. If You haven't written channel or chat name as command-line argument, enter channel or chat name (written after '@' or t.me//https://t.me/) and press Enter key
  5. Wait until this script will parse and process all data (it can take a lot of time, please be patient and wait) and press Enter key
  6. You can view all .json and .csv files with received data and view all data in MongoDB database

WARNING

Don't give Your Telegram API token to anyone!

teleparser's People

Contributors

artmih24 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  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

teleparser's Issues

Assistance Required

I'm not understanding hoe to use it please make a tutorial on how it works and how to use it

Error

After getting going and downloading the dependencies, I am getting an error around bot users. See below.

Traceback (most recent call last): File "/Users/johamon/TeleParser/TeleParser.py", line 128, in <module> client.loop.run_until_complete(main()) File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 664, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Users/johamon/TeleParser/TeleParser.py", line 111, in main await dump_all_messages(channel, channel_string, datetime_string) File "/Users/johamon/TeleParser/TeleParser.py", line 88, in dump_all_messages history = await client(GetHistoryRequest( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/telethon/client/users.py", line 30, in __call__ return await self._call(self._sender, request, ordered=ordered) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/telethon/client/users.py", line 87, in _call result = await future ^^^^^^^^^^^^ telethon.errors.rpcerrorlist.BotMethodInvalidError: The API access for bot users is restricted. The method you tried to invoke cannot be executed as a bot (caused by GetHistoryRequest)

Can this work with groups?

I have test it and I can guarantee it works on Channels, but I'm not sure how to use it on Groups?
Thanks,

banned phone number

Hi, I used your script to read messages from the telegram group i joined, i limited amount of messages to 100, but anyway got banned. What could be a problem, amount of messages i can parse? It's not allowed to read from groups, or group can somehow banns me? Give me pls know if you had same problems and maybe you found ways how to solve them?

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.