{"id":13813700,"url":"https://github.com/EverythingSuckz/TG-FileStreamBot","last_synced_at":"2025-05-15T00:34:05.933Z","repository":{"id":37545614,"uuid":"358619739","full_name":"EverythingSuckz/TG-FileStreamBot","owner":"EverythingSuckz","description":"A telegram bot that will give instant stream links for telegram files without the need of waiting till the download completes.","archived":false,"fork":false,"pushed_at":"2024-07-31T18:01:27.000Z","size":395,"stargazers_count":1307,"open_issues_count":23,"forks_count":1290,"subscribers_count":22,"default_branch":"main","last_synced_at":"2024-10-29T17:29:37.125Z","etag":null,"topics":["aiohttp","bot","filehosting","filestreambot","filetolinkbot","gin-gonic","golang","golang-server","gotd","hacktoberfest","hacktoberfest-accepted","hacktoberfest2022","hacktoberfest2023","heroku","mtproto","pyrogram","streaming","telegram","telegram-bot","tgcrypto"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EverythingSuckz.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-16T14:08:14.000Z","updated_at":"2024-10-29T12:06:21.000Z","dependencies_parsed_at":"2023-02-18T07:50:37.505Z","dependency_job_id":"1e13eece-1683-421d-bd8b-1b5c865f06fc","html_url":"https://github.com/EverythingSuckz/TG-FileStreamBot","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingSuckz%2FTG-FileStreamBot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingSuckz%2FTG-FileStreamBot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingSuckz%2FTG-FileStreamBot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EverythingSuckz%2FTG-FileStreamBot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EverythingSuckz","download_url":"https://codeload.github.com/EverythingSuckz/TG-FileStreamBot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224936320,"owners_count":17395079,"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","bot","filehosting","filestreambot","filetolinkbot","gin-gonic","golang","golang-server","gotd","hacktoberfest","hacktoberfest-accepted","hacktoberfest2022","hacktoberfest2023","heroku","mtproto","pyrogram","streaming","telegram","telegram-bot","tgcrypto"],"created_at":"2024-08-04T04:01:26.331Z","updated_at":"2025-05-15T00:34:05.897Z","avatar_url":"https://github.com/EverythingSuckz.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eTelegram File Stream Bot\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n  \u003c/a\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca herf=\"https://github.com/EverythingSuckz/TG-FileStreamBot\"\u003e\n        \u003cimg src=\"https://telegra.ph/file/a8bb3f6b334ad1200ddb4.png\" height=\"100\" width=\"100\" alt=\"File Stream Bot Logo\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    A Telegram bot to \u003cb\u003egenerate direct link\u003c/b\u003e for your Telegram files.\n    \u003cbr /\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003e [!NOTE]\n\u003e Checkout [python branch](https://github.com/EverythingSuckz/TG-FileStreamBot/tree/python) if you are interested in that.\n\n\u003chr\u003e\n\n\u003cdetails open=\"open\"\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#how-to-make-your-own\"\u003eHow to make your own\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#deploy-to-koyeb\"\u003eDeploy to Koyeb\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#deploy-to-heroku\"\u003eDeploy to Heroku\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#download-from-releases\"\u003eDownload and run\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#run-using-docker-compose\"\u003eRun via Docker compose\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#run-using-docker\"\u003eRun via Docker\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#build-from-source\"\u003eBuild and run\u003c/a\u003e\n          \u003cul\u003e\n            \u003cli\u003e\u003ca href=\"#ubuntu\"\u003eUbuntu\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=\"#windows\"\u003eWindows\u003c/a\u003e\u003c/li\u003e\n          \u003c/ul\u003e\n        \u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#setting-up-things\"\u003eSetting up Things\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#required-vars\"\u003eRequired environment variables\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#optional-vars\"\u003eOptional environment variables\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#use-multiple-bots-to-speed-up\"\u003eUsing multiple bots\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#use-multiple-bots-to-speed-up\"\u003eUsing user session to auto add bots\u003c/a\u003e\n          \u003cul\u003e\n            \u003cli\u003e\u003ca href=\"#what-it-does\"\u003eWhat it does?\u003c/a\u003e\u003c/li\u003e\n            \u003cli\u003e\u003ca href=\"#how-to-generate-a-session-string\"\u003eHow to generate a session string?\u003c/a\u003e\u003c/li\u003e\n          \u003c/ul\u003e\n        \u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact-me\"\u003eContact me\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#credits\"\u003eCredits\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\n## How to make your own\n\n### Deploy to Koyeb\n\n\u003e [!IMPORTANT]\n\u003e You'll have to expand the \"Environment variables and files\" section and update the env variables before hitting the deploy button.\n\n\u003e [!NOTE]\n\u003e This deploys the **latest docker release and NOT the latest commit**. Since it uses prebuilt docker container, the deploy speed will be significantly faster.\n\n[![Deploy to Koyeb](https://www.koyeb.com/static/images/deploy/button.svg)](https://app.koyeb.com/deploy?type=docker\u0026name=file-stream-bot\u0026image=ghcr.io/everythingsuckz/fsb:latest\u0026env%5BAPI_HASH%5D=\u0026env%5BAPI_ID%5D=\u0026env%5BAPI_HASH%5D=\u0026env%5BAPI_ID%5D=\u0026env%5BBOT_TOKEN%5D=\u0026env%5BHOST%5D=https%3A%2F%2F%7B%7B+KOYEB_PUBLIC_DOMAIN+%7D%7D\u0026env%5BLOG_CHANNEL%5D=\u0026env%5BPORT%5D=8038\u0026ports=8038%3Bhttp%3B%2F\u0026hc_protocol%5B8038%5D=tcp\u0026hc_grace_period%5B8038%5D=5\u0026hc_interval%5B8038%5D=30\u0026hc_restart_limit%5B8038%5D=3\u0026hc_timeout%5B8038%5D=5\u0026hc_path%5B8038%5D=%2F\u0026hc_method%5B8038%5D=get)\n\n### Deploy to Heroku\n\n\u003e [!NOTE]\n\u003e You'll have to [fork](https://github.com/EverythingSuckz/TG-FileStreamBot/fork) this repository to deploy to Heroku.\n\nPress the below button to fast deploy to Heroku\n\n[![Deploy To Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n\n[Click Here](https://devcenter.heroku.com/articles/config-vars#using-the-heroku-dashboard) to know how to add / edit [environment variables](#required-vars) in Heroku.\n\n\u003chr\u003e\n\n### Download from releases\n- Head over to [releases](https://github.com/EverythingSuckz/TG-FileStreamBot/releases) tab, from the *pre release* section, download the one for your platform and architecture.\n- Extract the zip file to a folder.\n- Create an a file named `fsb.env` and add all the variables there (see `fsb.sample.env` file for reference).\n- Give the executable file permission to execute using the command `chmod +x fsb` (Not required for windows).\n- Run the bot using `./fsb run` command. ( `./fsb.exe run` for windows)\n\n\u003chr\u003e\n\n### Run using docker-compose\n\n- Clone the repository\n```sh\ngit clone https://github.com/EverythingSuckz/TG-FileStreamBot\ncd TG-FileStreamBot\n```\n\n- Create an a file named `fsb.env` and add all the variables there (see `fsb.sample.env` file for reference).\n\n```sh\nnano fsb.env\n```\n\n- Build and run the docker-compose file\n\n```sh\ndocker-compose up -d\n```\n OR\n\n```sh\ndocker compose up -d\n```\n\n\u003chr\u003e\n\n### Run using docker\n\n```sh\ndocker run --env-file fsb.env ghcr.io/everythingsuckz/fsb:latest\n```\nWhere `fsb.env` is the environment file containing all the variables.\n\n\u003chr\u003e\n\n### Build from source\n\n#### Ubuntu\n\n\u003e [!NOTE]\n\u003e Make sure to install go 1.21 or above.\n\u003e Refer https://stackoverflow.com/a/17566846/15807350\n\n```sh\ngit clone https://github.com/EverythingSuckz/TG-FileStreamBot\ncd TG-FileStreamBot\ngo build ./cmd/fsb/\nchmod +x fsb\nmv fsb.sample.env fsb.env\nnano fsb.env\n# (add your environment variables, see the next section for more info)\n./fsb run\n```\n\nand to stop the program,\n do \u003ckbd\u003eCTRL\u003c/kbd\u003e+\u003ckbd\u003eC\u003c/kbd\u003e\n\n#### Windows\n\n\u003e [!NOTE]\n\u003e Make sure to install go 1.21 or above.\n\n```powershell\ngit clone https://github.com/EverythingSuckz/TG-FileStreamBot\ncd TG-FileStreamBot\ngo build ./cmd/fsb/\nRename-Item -LiteralPath \".\\fsb.sample.env\" -NewName \".\\fsb.env\"\nnotepad fsb.env\n# (add your environment variables, see the next section for more info)\n.\\fsb run\n```\n\nand to stop the program,\n do \u003ckbd\u003eCTRL\u003c/kbd\u003e+\u003ckbd\u003eC\u003c/kbd\u003e\n\n## Setting up things\n\nIf you're locally hosting, create a file named `fsb.env` in the root directory and add all the variables there.\nYou may check the `fsb.sample.env`.\nAn example of `fsb.env` file:\n\n```sh\nAPI_ID=452525\nAPI_HASH=esx576f8738x883f3sfzx83\nBOT_TOKEN=55838383:yourbottokenhere\nLOG_CHANNEL=-10045145224562\nPORT=8080\nHOST=http://yourserverip\n# (if you want to set up multiple bots)\nMULTI_TOKEN1=55838373:yourworkerbottokenhere\nMULTI_TOKEN2=55838355:yourworkerbottokenhere\n```\n\n### Required Vars\nBefore running the bot, you will need to set up the following mandatory variables:\n\n- `API_ID` : This is the API ID for your Telegram account, which can be obtained from my.telegram.org.\n\n- `API_HASH` : This is the API hash for your Telegram account, which can also be obtained from my.telegram.org.\n\n- `BOT_TOKEN` : This is the bot token for the Telegram Media Streamer Bot, which can be obtained from [@BotFather](https://telegram.dog/BotFather).\n\n- `LOG_CHANNEL` :  This is the channel ID for the log channel where the bot will forward media messages and store these files to make the generated direct links work. To obtain a channel ID, create a new telegram channel (public or private), post something in the channel, forward the message to [@missrose_bot](https://telegram.dog/MissRose_bot) and **reply the forwarded message** with the /id command. Copy the forwarded channel ID and paste it into the this field.\n\n### Optional Vars\nIn addition to the mandatory variables, you can also set the following optional variables:\n\n- `PORT` : This sets the port that your webapp will listen to. The default value is 8080.\n\n- `HOST` :  A Fully Qualified Domain Name if present or use your server IP. (eg. `https://example.com` or `http://14.1.154.2:8080`)\n\n- `HASH_LENGTH` : Custom hash length for generated URLs. The hash length must be greater than 5 and less than or equal to 32. The default value is 6.\n\n- `USE_SESSION_FILE` : Use session files for worker client(s). This speeds up the worker bot startups. (default: `false`)\n\n- `USER_SESSION` : A pyrogram session string for a user bot. Used for auto adding the bots to `LOG_CHANNEL`. (default: `null`)\n\n- `ALLOWED_USERS` : A list of user IDs separated by comma (`,`). If this is set, only the users in this list will be able to use the bot. (default: `null`)\n\n\u003chr\u003e\n\n### Use Multiple Bots to speed up\n\n\u003e [!NOTE]\n\u003e **What it multi-client feature and what it does?** \u003cbr\u003e\n\u003e This feature shares the Telegram API requests between worker bots to speed up download speed when many users are using the server and to avoid the flood limits that are set by Telegram. \u003cbr\u003e\n\n\u003e [!NOTE]\n\u003e You can add up to 50 bots since 50 is the max amount of bot admins you can set in a Telegram Channel.\n\nTo enable multi-client, generate new bot tokens and add it as your `fsb.env` with the following key names. \n\n`MULTI_TOKEN1`: Add your first bot token here.\n\n`MULTI_TOKEN2`: Add your second bot token here.\n\nyou may also add as many as bots you want. (max limit is 50)\n`MULTI_TOKEN3`, `MULTI_TOKEN4`, etc.\n\n\u003e [!WARNING]\n\u003e Don't forget to add all these worker bots to the `LOG_CHANNEL` for the proper functioning\n\n### Using user session to auto add bots\n\n\u003e [!WARNING]\n\u003e This might sometimes result in your account getting resticted or banned.\n\u003e **Only newly created accounts are prone to this.**\n\nTo use this feature, you need to generate a pyrogram session string for the user account and add it to the `USER_SESSION` variable in the `fsb.env` file.\n\n#### What it does?\n\nThis feature is used to auto add the worker bots to the `LOG_CHANNEL` when they are started. This is useful when you have a lot of worker bots and you don't want to add them manually to the `LOG_CHANNEL`.\n\n#### How to generate a session string?\n\nThe easiest way to generate a session string is by running\n\n```sh\n./fsb session --api-id \u003cyour api id\u003e --api-hash \u003cyour api hash\u003e\n```\n\n\u003cimg src=\"https://github.com/EverythingSuckz/TG-FileStreamBot/assets/65120517/b5bd2b88-0e1f-4dbc-ad9a-faa6d5a17320\" height=300\u003e\n\n\u003cbr\u003e\u003cbr\u003e\n\nThis will generate a session string for your user account using QR code authentication. Authentication via phone number is not supported yet and will be added in the future.\n\n## Contributing\n\nFeel free to contribute to this project if you have any further ideas\n\n## Contact me\n\n[![Telegram Channel](https://img.shields.io/static/v1?label=Join\u0026message=Telegram%20Channel\u0026color=blueviolet\u0026style=for-the-badge\u0026logo=telegram\u0026logoColor=violet)](https://xn--r1a.click/wrench_labs)\n[![Telegram Group](https://img.shields.io/static/v1?label=Join\u0026message=Telegram%20Group\u0026color=blueviolet\u0026style=for-the-badge\u0026logo=telegram\u0026logoColor=violet)](https://xn--r1a.click/AlteredVoid)\n\nYou can contact either via my [Telegram Group](https://xn--r1a.click/AlteredVoid) or you can message me on [@EverythingSuckz](https://xn--r1a.click/EverythingSuckz)\n\n\n## Credits\n\n- [@celestix](https://github.com/celestix) for [gotgproto](https://github.com/celestix/gotgproto)\n- [@divyam234](https://github.com/divyam234/teldrive) for his [Teldrive](https://github.com/divyam234/teldrive) Project\n- [@karu](https://github.com/krau) for adding image support\n\n## Copyright\n\nCopyright (C) 2023 [EverythingSuckz](https://github.com/EverythingSuckz) under [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html).\n\nTG-FileStreamBot is Free Software: You can use, study share and improve it at your\nwill. Specifically you can redistribute and/or modify it under the terms of the\n[GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.en.html) as\npublished by the Free Software Foundation, either version 3 of the License, or\n(at your option) any later version. Also keep in mind that all the forks of this repository MUST BE OPEN-SOURCE and MUST BE UNDER THE SAME LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEverythingSuckz%2FTG-FileStreamBot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEverythingSuckz%2FTG-FileStreamBot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEverythingSuckz%2FTG-FileStreamBot/lists"}