{"id":13611648,"url":"https://github.com/odysseusmax/tg-index","last_synced_at":"2025-04-13T05:33:12.745Z","repository":{"id":40655608,"uuid":"286398615","full_name":"odysseusmax/tg-index","owner":"odysseusmax","description":"Python web app to index telegram chats and serve its files for download over HTTP. ","archived":false,"fork":false,"pushed_at":"2023-01-24T17:37:09.000Z","size":794,"stargazers_count":382,"open_issues_count":32,"forks_count":467,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-11-07T18:47:55.438Z","etag":null,"topics":["aiohttp","download","indexing","python","telegram","telethon"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/odysseusmax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-10T06:50:14.000Z","updated_at":"2024-11-03T07:32:11.000Z","dependencies_parsed_at":"2023-02-13T23:50:17.605Z","dependency_job_id":null,"html_url":"https://github.com/odysseusmax/tg-index","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odysseusmax%2Ftg-index","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odysseusmax%2Ftg-index/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odysseusmax%2Ftg-index/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odysseusmax%2Ftg-index/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/odysseusmax","download_url":"https://codeload.github.com/odysseusmax/tg-index/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670513,"owners_count":21142896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiohttp","download","indexing","python","telegram","telethon"],"created_at":"2024-08-01T19:01:59.588Z","updated_at":"2025-04-13T05:33:11.099Z","avatar_url":"https://github.com/odysseusmax.png","language":"Python","funding_links":[],"categories":["Python","[↑](#contents) Tools"],"sub_categories":[],"readme":"# Telegram Index\n\n\u003e Python Web App which indexes a telegram channel(or a chat) and serves its files for download.\n\n[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.png?v=103)](.) [![GPLv3 license](https://img.shields.io/badge/License-GPLv3-blue.svg)](LICENSE)\n\n## Highlights\n\n- Index one or more telegram channels/chats.\n- View messages and media files on the browser.\n- Search through the channel/chat.\n- Download media files through browser/download managers.\n\n## Deploy Guide\n\n- **Clone to local machine.**\n\n```bash\n$ git clone https://github.com/odysseusmax/tg-index.git\n\n$ cd tg-index\n```\n\n- **Create and activate virtual environment.**\n\n```bash\n$ python -m venv venv\n\n$ source venv/bin/activate\n```\n\n- **Install dependencies.**\n\n```bash\n$ pip3 install -U -r requirements.txt\n```\n\n- **Environment Variables.**\n\n| Variable Name                        | Value                                                                                                                                                          |\n| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `API_ID` (required)                  | Telegram api_id obtained from \u003chttps://my.telegram.org/apps\u003e.                                                                                                  |\n| `API_HASH` (required)                | Telegram api_hash obtained from \u003chttps://my.telegram.org/apps\u003e.                                                                                                |\n| `INDEX_SETTINGS` (required)          | See the below description.                                                                                                                                     |\n| `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). |\n| `PORT` (optional)                    | Port on which app should listen to, defaults to 8080.                                                                                                          |\n| `HOST` (optional)                    | Host name on which app should listen to, defaults to 0.0.0.0.                                                                                                  |\n| `DEBUG` (optional)                   | Give `true` to set logging level to debug, info by default.                                                                                                    |\n| `BLOCK_DOWNLOADS` (optional)         | Enable downloads or not. If any value is provided, downloads will be disabled.                                                                                 |\n| `RESULTS_PER_PAGE` (optional)        | Number of results to be returned per page defaults to 20.                                                                                                      |\n| `TGINDEX_USERNAME` (optional)        | Username for authentication, defaults to `''`.                                                                                                                 |\n| `PASSWORD` (optional)                | Password for authentication, defaults to `''`.                                                                                                                 |\n| `SHORT_URL_LEN` (optional)           | Url length for aliases                                                                                                                                         |\n| `SESSION_COOKIE_LIFETIME` (optional) | Number of minutes, for which authenticated session is valid for, after which user has to login again. defaults to 60.                                          |\n| `SECRET_KEY` (optional)              | 32 characters long string for signing the session cookies, required if authentication is enabled.                                                              |\n\n- **Setting value for `INDEX_SETTINGS`**\n\nThis 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.\n\n**Remember to remove spaces.**\n\n```json\n{\n  \"index_all\": true,\n  \"index_private\": false,\n  \"index_group\": false,\n  \"index_channel\": true,\n  \"exclude_chats\": [],\n  \"include_chats\": []\n}\n```\n\n\u003e - `index_all` - Whether to consider all the chats associated with the telegram account. Value should either be `true` or `false`.\n\u003e - `index_private` - Whether to index private chats. Only considered if `index_all` is set to `true`. Value should either be `true` or `false`.\n\u003e - `index_group` - Whether to index group chats. Only considered if `index_all` is set to `true`. Value should either be `true` or `false`.\n\u003e - `index_channel` - Whether to index channels. Only considered if `index_all` is set to `true`. Value should either be `true` or `false`.\n\u003e - `exclude_chats` - An array/list of chat id's that should be ignored for indexing. Only considered if `index_all` is set to `true`.\n\u003e - `include_chats` - An array/list of chat id's to index. Only considered if `index_all` is set to `false`.\n\n- **Run app.**\n\n```bash\npython3 -m app\n```\n\n## Deploy Guide (Repl.it)\n\nA detailed and beginner friendly guide on how to deploy this project on a free instance of \u003chttps://repl.it\u003e can be found [here](./repl-config/replit-deploy-guide.md).\n\n## Contributions\n\nContributions are welcome.\n\n## Contact\n\nYou can contact me [@odysseusmax](https://tx.me/odysseusmax).\n\n## License\n\nCode released under [The GNU General Public License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodysseusmax%2Ftg-index","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fodysseusmax%2Ftg-index","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodysseusmax%2Ftg-index/lists"}