Package: telegram-cloud
Telegram-cloud (A.K.A tgcloud)telegram-cloudSearching in groups, private channel and chats, Download and upload files via telegram and Using your telegram account as free cloud storage.Uploader, Downloader, Crawler, Bot 50MB limitation bypasser. (Maybe can wash the dishes someday)Upload file upto 2 GBDownload file from every conversation, group, channel, ...Crawling! search by name or caption for a specific file to download itYou can also:Use it for multiple accounts, download from one Telegram account and upload that on another account, there is no difficultydownload files with file_idSend regular and silent messages to any user, channel or chatHmm what is this?It's a python package forTelegram messenger, which can give you an ability to download, upload, and more options to do with your Telegram account on CLI.Installationtelegram-cloud requiresPython3andTelethonas requirment.$pip3installtelegram-cloudAlso can be found onpypiHow can I use it?install the package by pip package manager.after installing, typetgloginon your terminalNow you need to get api_id and api_hash from hereTelegramfromTelethon document:Before working with Telegram’s API, you need to get your own API ID and hash:Login to your Telegramaccount 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 calltgcloudon your terminal.Commandstelegram-cloud is currently working with the following commands.argshelp--mode / -mTwo modes for specify what you want, Available modes: download - upload--name / -nA Name you choose while tglogin-ing and use for specify the current user you work on it--username / -uTarget username that you want to send file, typemeif you want to get it on yoursaved messages--path / -pFor download mode: pass simple directory path like "/Users/nima/Desktop/Iwanttoescapefrom/"--path / -pFor upload mode: pass file path like "/Users/nima/Desktop/Iwanttoescapefrom/Iran.zip"--caption / -cFor download mode: pass the name of file or caption to crawl and download--caption / -cFor upload mode: write the caption to see it under your filetgutil accepts these arguments:argshelp--name / -nA Name you choose while tglogin-ing and use for specify the current user you work on it--username / -uTarget username's chat that you want to edit/delete message on it, typemeif you want to get it on yoursaved messages--mode { edit, editall, delete, deleteall }Choose what you need to do, delete/edit last message or deleteall/editall--textthe text that you are looking for to do operation on it--newtextthe new text that you want to be replaced with current text, can be used foreditandeditalltgsend accepts these arguments:argshelp--name / -nA Name you choose while tglogin-ing and use for specify the current user you work on it--username / -uTarget username that you want to send file, typemeif you want to get it on yoursaved messages--format { text, markdown, html }How to parse message body. Default istext--no-link-previewDisable web link preview card for this message--silentDisable audible notification--stdinRead message text from stdintginfo accepts these arguments:argshelp--name / -nA Name you choose while tglogin-ing and use for specify the current user you work on it--username / -uTarget username that you want to fetch info, typemeif you want to get it on yoursaved messages--search / -ssearch specific extension or textNeed more examples?Are you done withtglogin? so come with me.Unix based operating systemsDownloada music from mysaved messagesand save it on/Users/nima/Desktop/:$tgcloud-mdownload-nnima-ume-p"/Users/nima/Desktop/"-c"sad but true"$tgcloud--modedownload--namenima--usernameme--path"/Users/nima/Desktop/"--caption"sad but true"Uploada banner with caption to mysaved messages:$tgcloud-mupload-nnima-ume-p"/Users/nima/Desktop/banner.png"-c"Help me"$tgcloud--modeupload--namenima--usernameme--path"/Users/nima/Desktop/banner.png"--caption"Help me"Uploada pdf to antelegram ID:$tgcloud-mupload-nnima-u@autisticbruh-p"/Users/nima/Desktop/file.pdf"-c"Help me"Searchanddownloada zip from telegramchat_id group:$tgcloud-mdownload-nnima-u-1001240213443-p"/Users/nima/Desktop/"-c"best memes"Send asilenttext message to achat group:$tgsend-nanightshade-u-1001240213443--silent"Panda eats shoots and leaves"Send a fortune cookie to yourself viastdin:$tgsend-nanightshade-ume--stdinSearchall PDFs inside a telegram conversation:$tginfo-ntestSession-ume-s".pdfEditthe lasthellotext message on yoursaved messagetobye:$tgutil-nnimnim-ume--modeedit--text"hello"--newtext"bye"Editallhellotext messages on yoursaved messagetobye:$tgutil-nnimnim-ume--modeeditall--text"hello"--newtext"bye"Deletethe lasthellotext message on yoursaved message:$tgutil-nnimnim-ume--modedelete--text"hello"Deleteallhellotext messages on yoursaved message:$tgutil-nnimnim-ume--modedeleteall--text"hello"Get infofor all Media inside a telegram conversation:$tginfo-ntestSession-umenot Unix (Lol I mean windows)Just like unix butCAREFULabout paths, your path must not end with\!!Downloadall PDFs from yoursaved messagesand save it onC:\Users\Nima\Desktop:$tgcloud-mdownload-nnima-ume-p"C:\Users\Nima\Desktop"-c".pdf"What is file_id?fromTelegram 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 2 GB and pass it by file_id or message_id or...Good to knowThe 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.
Insidetelegram-cloud-config.ini, you can find api_hash and api_id and name you've entered bytgloginTo doSend a message via cli (tgsend)Delete a message via cli (tgutil)Edit a message via cli (tgutil)Increasing the speed of Download and UploadClean and compelete document (please help, please)Code is super dirty, need to be cleaned and have a good structureUpload and download multiple filesUpload and download a directoryAdd progress bar while downloading/uploadingAdd progress bar while downloading/uploadingIssuesFeel free to submit issues and enhancement requests.ContributingPlease refer to each project's style and contribution guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow.Forkthe repo on GitHubClonethe project to your own machineUpdate the VersioninSetup.pyCommitchanges to your own branchPushyour work back up to your forkSubmit aPull requestso that we can review your changesNOTE: Be sure to merge the latest from "upstream" before making a pull request!Python + TelethonSeeTelethonContributors 🤝Special thanks to Contributors@anightshade: For addingtgsendand fixing bugs!@anightshade: For adding Command line option to select format for the file caption.@rany2: For fixing uploading path and files@anightshade: For adding option to disable weblink preview in messageLICENSE