This project is a TypeScript-based tool and python server for uploading files to various cloud storage providers, with a plugin-based architecture that makes it easy to extend.
- Cloud Agnostic: Easily switch between different cloud storage providers by changing the configuration.
- Plugin-Based Architecture: Add support for new cloud providers by creating a new plugin.
- Environment-Based Configuration: Uses a
.env
file for easy configuration.
- Clone the repository:
git clone https://github.com/chahakshahcs5/tg-to-cloud.git cd tg-to-cloud
- Install the dependencies:
npm install
- Build the project:
npm run build
- Python Setup:
python3 -m venv .venv source venv/bin/activatebasher python3 -m pip install -r requirements.txt npm install source /home/user/tg-to-cloud/.venv/bin/activate && python3 main.py
-
Create a
.env
file in the root of the project. -
Add the following environment variables:
API_ID= API_HASH= SESSION_STRING= Session string NDUS= Terabox Nuds - Gte it from Cookies of terabox website ARIA2_URL="http://localhost:8080/jsonrpc" ARIA2_SECRET="secret" CLOUD_PLUGIN="terabox" MONGODB_URI=mongodb://localhost:27017 MONGO_DB=tg-to-cloud
-
Configure the cloud provider-specific settings in
src/config/cloudConfig.ts
.
- Terabox: The initial implementation includes a plugin for Terabox.
- Create a new plugin in the
src/plugins
directory. - Implement the
ICloudPlugin
interface. - Add the configuration for the new plugin in
src/config/cloudConfig.ts
. - Update the
CLOUD_PLUGIN
environment variable in your.env
file to the name of your new plugin.
.
├── src
│ ├── plugins
│ │ └── terabox
│ │ └── index.ts
│ ├── config
│ │ ├── cloudConfig.ts
│ │ └── ...
│ ├── helpers
│ │ └── cloudPluginManager.ts
│ └── index.ts
├── package.json
└── tsconfig.json
main.py
config.py
- @inquirer/input: ^4.2.1
- dateformat: ^5.0.3
- dotenv: ^17.2.1
- filesize: ^11.0.2
- terabox-api: ^2.4.4
- tough-cookie: ^5.1.2
- undici: ^7.12.0
- yaml: ^2.8.0
- yargs: ^18.0.0
- @types/dateformat: ^5.0.3
- @types/node: ^24.1.0
- ts-node: ^10.0.0
- ts-node-dev: ^2.0.0
- typescript: ^5.0.0
- telethon==1.40.0
- python_dotenv==1.1.1
- fastapi==0.116.1
- uvicorn[standard]==0.35.0
- motor==3.7.1
- Serevr is running on Port 8000
- EndPoint - GET - "/export/{dialog_title}", dialog_title is dialog (channel or group or chat) name, Query Params - exts -> Can be file extension like .png, .pdf
- Example "/export/test?exts=.png,.mp4"