Skip to main content

Download and upload files via telegram up to 1.5GB, CLI

Project description

Telegram-cloud (A.K.A tgcloud)

Telegram-cloud

telegram-cloud

Download and upload files via telegram, Use your telegram account as a free cloud storage.

Uploader, Downloader, Crawler, Bot 50MB limitation bypasser.

  • Upload file upto 1.5GB
  • Download file from every conversation, group, channel, ...
  • Crawling! search by name or caption for a specific file to download it

You can also:

  • Use it for multiple accounts, download from one Telegram account and upload that on another account, there is no difficulty
  • download files with file_id

Hmm what is this?

It's a python library for Telegram messenger, which can give you an ability to download, upload, and more options to do with your Telegram account on CLI.

Installation

telegram-cloud requires Python3 and Telethon as requirment.

$ pip3 install telegram-cloud

Also can be found on pypi

How can I use it?

  • install the package by pip package manager.
  • after installing, type tglogin on your terminal
  • Now you need to get api_id and api_hash from here Telegram from Telethon document:

    Before working with Telegram’s API, you need to get your own API ID and hash: Login to your Telegram account with the phone number of the developer account to use. Click under API Development tools. A Create new application window will appear. Fill in your application details. There is no need to enter any URL, and only the first two fields (App title and Short name) can currently be changed later. Click on Create application at the end. Remember that your API hash is secret and Telegram won’t let you revoke it. Don’t post it anywhere!

  • After that you able to call tgcloud on your terminal.

Commands

telegram-cloud is currently working with the following commands.

args help
--mode / -m Two modes for specify what you want, Available modes: download - upload
--name / -n A Name you choose while tglogin-ing and use for specify the current user you work on it
--username / -u Target username that you want to send file, type me if you want to get it on your saved messages
--path / -p For download mode: pass simple directory path like "/Users/nima/Desktop/Iwanttoescapefrom/"
--path / -p For upload mode: pass file path like "/Users/nima/Desktop/Iwanttoescapefrom/Iran.zip"
--caption / -c For download mode: pass the name of file or caption to crawl and download
--caption / -c For upload mode: write the caption to see it under your file

Need more examples?

Unix based operating systems

Download a music from my saved messages and save it on /Users/nima/Desktop/:

$ tgcloud -m download -n nima -u me -p "/Users/nima/Desktop/" -c "sad but true"
$ tgcloud --mode download --name nima --username me --path "/Users/nima/Desktop/" --caption "sad but true"

Upload a banner with caption to my saved messages:

$ tgcloud -m upload -n nima -u me -p "/Users/nima/Desktop/banner.png" -c "Help me"
$ tgcloud --mode upload --name nima --username me --path "/Users/nima/Desktop/banner.png" --caption "Help me"

Upload a pdf to an telegram ID:

$ tgcloud -m upload -n nima -u @autisticbruh -p "/Users/nima/Desktop/file.pdf" -c "Help me"

Search and download a zip from telegram chat_id group:

$ tgcloud -m download -n nima -u -1001240213443 -p "/Users/nima/Desktop/" -c "best memes"

not Unix (Lol I mean windows)

Just like unix but CAREFUL about paths Download all PDFs from your saved messages and save it on C:\Users\Nima\Desktop:

$ tgcloud -m download -n nima -u me -p "C:\Users\Nima\Desktop" -c ".pdf"

What is file_id?

from Telegram Doc:

When working with the API, it is sometimes necessary to send a relatively large file to the server. For example, when sending a message with a photo/video attachment or when setting the current user’s profile picture.

You can upload a file to Telegram once, and send it again to others or do things with file_id. So when you upload a file, you can see the file_id. So now what? If you have a Telegram bot and you have 50MB limitation for uploading and send to users, you can bypass this limitation by this trick and upload files upto 1.5GB and pass it by file_id or message_id or...

Good to know

The config file can be found on ~/.telegram-cloud/ (Also ~\.telegram-cloud\ in windows) Each login make *.session file which is located there and it cause script for logged-in user works globally. Inside telegram-cloud-config.ini, you can find api_hash and api_id and name you've entered by tglogin

To do

  • Upload and download multiple files
  • Upload and download a directory
  • Add progress bar while downloading/uploading
  • Make compatible with windows

Issues

Feel free to submit issues and enhancement requests.

Contributing

Please refer to each project's style and contribution guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

Python + Telethon

LICENSE

License: MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

telegram-cloud-1.1.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

telegram_cloud-1.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file telegram-cloud-1.1.0.tar.gz.

File metadata

  • Download URL: telegram-cloud-1.1.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for telegram-cloud-1.1.0.tar.gz
Algorithm Hash digest
SHA256 019818d57f8d3aa9d2206800d103eaa27764da032e16e5307ceb68975d8d87e0
MD5 1c6ce177682a3acbc577aa9304eeb161
BLAKE2b-256 81e1436a503b803aa68eb919c222b7e62788499b2328f4d1f1c4c23a6fb35102

See more details on using hashes here.

File details

Details for the file telegram_cloud-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: telegram_cloud-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

File hashes

Hashes for telegram_cloud-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c5dceff91aaf23072383a0fd0f293477a983c8ecb1a91c3cfc5a8874ee3220a4
MD5 6b9a1177300b317675487d52e3d1cf03
BLAKE2b-256 91c7309a300feef2304fe46a2ea0efef59eb5e3c407692fec39bd5ee09642c9b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page