GithubHelp home page GithubHelp logo

athena1433 / z-index Goto Github PK

View Code? Open in Web Editor NEW

This project forked from odysseusmax/tg-index

0.0 0.0 0.0 794 KB

Python web app to index telegram chats and serve its files for download over HTTP.

License: GNU General Public License v3.0

JavaScript 0.52% Python 63.17% HTML 36.30%

z-index's Introduction

Telegram Index

Python Web App which indexes a telegram channel(or a chat) and serves its files for download.

Open Source Love GPLv3 license

Highlights

  • Index one or more telegram channels/chats.
  • View messages and media files on the browser.
  • Search through the channel/chat.
  • Download media files through browser/download managers.

Deploy Guide

  • Clone to local machine.
$ git clone https://github.com/odysseusmax/tg-index.git

$ cd tg-index
  • Create and activate virtual environment.
$ python -m venv venv

$ source venv/bin/activate
  • Install dependencies.
$ pip3 install -U -r requirements.txt
  • Environment Variables.
Variable Name Value
API_ID (required) Telegram api_id obtained from https://my.telegram.org/apps.
API_HASH (required) Telegram api_hash obtained from https://my.telegram.org/apps.
INDEX_SETTINGS (required) See the below description.
SESSION_STRING (required) String obtained by running $ python3 app/generate_session_string.py. (Login with the telegram account which is a participant of the given channel (or chat).
PORT (optional) Port on which app should listen to, defaults to 8080.
HOST (optional) Host name on which app should listen to, defaults to 0.0.0.0.
DEBUG (optional) Give true to set logging level to debug, info by default.
BLOCK_DOWNLOADS (optional) Enable downloads or not. If any value is provided, downloads will be disabled.
RESULTS_PER_PAGE (optional) Number of results to be returned per page defaults to 20.
TGINDEX_USERNAME (optional) Username for authentication, defaults to ''.
PASSWORD (optional) Password for authentication, defaults to ''.
SHORT_URL_LEN (optional) Url length for aliases
SESSION_COOKIE_LIFETIME (optional) Number of minutes, for which authenticated session is valid for, after which user has to login again. defaults to 60.
SECRET_KEY (optional) 32 characters long string for signing the session cookies, required if authentication is enabled.
  • Setting value for INDEX_SETTINGS

This is the general format, change the values of corresponding fields as your requirements. You can copy paste this as is to index all the channels available in your account.

Remember to remove spaces.

{
  "index_all": true,
  "index_private": false,
  "index_group": false,
  "index_channel": true,
  "exclude_chats": [],
  "include_chats": []
}
  • index_all - Whether to consider all the chats associated with the telegram account. Value should either be true or false.
  • index_private - Whether to index private chats. Only considered if index_all is set to true. Value should either be true or false.
  • index_group - Whether to index group chats. Only considered if index_all is set to true. Value should either be true or false.
  • index_channel - Whether to index channels. Only considered if index_all is set to true. Value should either be true or false.
  • exclude_chats - An array/list of chat id's that should be ignored for indexing. Only considered if index_all is set to true.
  • include_chats - An array/list of chat id's to index. Only considered if index_all is set to false.
  • Run app.
python3 -m app

Deploy Guide (Repl.it)

A detailed and beginner friendly guide on how to deploy this project on a free instance of https://repl.it can be found here.

Contributions

Contributions are welcome.

Contact

You can contact me @odysseusmax.

License

Code released under The GNU General Public License.

z-index's People

Contributors

odysseusmax avatar pseudokawaii avatar rayanfer32 avatar dhavalhariyani avatar justinthoms avatar

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.