Modified Version of mega.py package for Pyrogram Bots

Overview

Pyro Mega.py

Python library for the Mega.co.nz API, currently supporting:

  • login
  • uploading
  • downloading
  • deleting
  • searching
  • sharing
  • renaming
  • moving files

Note: This is a modified version of mega.py. Made for Mega.nz-Bot. It's a Open Source Mega.nz Downloader Bot so you can get idea about How to use this library for Telegram Bots (PyrogramOnly) 🥳

Features of this modification

  • Progress Tracker for Downloading
  • Progress Tracker for Uploading Telegram Files to Mega.nz

How To Use

Create a Mega account

First, create an account with Mega .

Install mega.py package

Run the following command to install pyro-mega.py

pip install git+https://github.com/Itz-fork/pyro-mega.py

Import mega.py

from mega import Mega

Create an instance of Mega.py

mega = Mega()

Login to Mega

m = mega.login(email, password)
# login using a temporary anonymous account
m = mega.login()

Get user details

details = m.get_user()

Get account balance (Pro accounts only)

balance = m.get_balance()

Get account disk quota

quota = m.get_quota()

Get account storage space

# specify unit output kilo, mega, gig, else bytes will output
space = m.get_storage_space(kilo=True)

Get account files

files = m.get_files()

Upload a file, and get its public link

# Uploading File
file = m.upload("/home/Itz-fork/Mega.nz-Bot/downloaded_file.mp4", upstatusmsg=your_upload_status_message)
m.get_upload_link(file)

Export a file or folder

public_exported_web_link = m.export('myfile.doc')
public_exported_web_link = m.export('my_mega_folder/my_sub_folder_to_share')
# e.g. https://mega.nz/#F!WlVl1CbZ!M3wmhwZDENMNUJoBsdzFng

Find a file or folder

folder = m.find('my_mega_folder')
# Excludes results which are in the Trash folder (i.e. deleted)
folder = m.find('my_mega_folder', exclude_deleted=True)

Upload a file to a destination folder

folder = m.find('my_mega_folder')
m.upload('myfile.doc', folder[0])

Download a file from URL or file obj, optionally specify destination folder

file = m.find('myfile.doc')
m.download(file)
# Specifying a path
m.download(file, '/home/john-smith/Desktop')
# specify optional download filename (download_url() supports this also)
m.download(file, '/home/john-smith/Desktop', 'myfile.zip')
# Download file with Simple Progress Tracker (Pyrogram Bots Only)
m.download_url(url, "home/Itz-fork/Mega.nz-Bot/Downlaods", statusdl_msg=your_download_status_message)

Import a file from URL, optionally specify destination folder

m.import_public_url('https://mega.co.nz/#!utYjgSTQ!OM4U3V5v_W4N5edSo0wolg1D5H0fwSrLD3oLnLuS9pc')
folder_node = m.find('Documents')[1]
m.import_public_url('https://mega.co.nz/#!utYjgSTQ!OM4U3V5v_W4N5edSo0wolg1D5H0fwSrLD3oLnLuS9pc', dest_node=folder_node)

Create a folder

m.create_folder('new_folder')
m.create_folder('new_folder/sub_folder/subsub_folder')

Returns a dict of folder node name and node_id, e.g.

{
  'new_folder': 'qpFhAYwA',
  'sub_folder': '2pdlmY4Z',
  'subsub_folder': 'GgMFCKLZ'
}

Rename a file or a folder

file = m.find('myfile.doc')
m.rename(file, 'my_file.doc')

Support

Contact Original Authors,

Modified for Pyrogram by,

Owner
I'm Not A Bot #Left_TG
Everything is impossible until You use Your Brain 😄
I'm Not A Bot #Left_TG
Video Stream: an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat

Video Stream is an Advanced Telegram Bot that's allow you to play Video & Music on Telegram Group Video Chat 🧪 Get SESSION_NAME from below: Pyrogram

Jonathan 6 Feb 08, 2022
A script that takes what you're listening too on Spotify and sets it as your Nertivia custom status.

nertivia-spotify-listening-status A script that takes what you're listening too on Spotify and sets it as your Nertivia custom status. setup Install r

Ben Tettmar 2 Feb 03, 2022
Discord bot for playing blindfold chess.

Albin Discord bot for playing blindfold chess written in Python. Albin takes the moves from chat and pushes them on the board without showing it. TODO

8 Oct 14, 2022
This repository provides a set functions to extract paragraphs from AWS Textract responses.

extract-paragraphs-with-aws-textract Since AWS Textract (the AWS OCR service) does not have a native function to extract paragraphs, this repository p

Juan Anzola 3 Jan 26, 2022
A multipurpose bot designed to make Discord better for everyone, written in Python.

Hadum A multipurpose bot that makes Discord better for everyone Features A Fully Functional Moderation component: manage your staff, members and permi

1 Jan 25, 2022
An EmbedBuilder in Python for discord.py embeds. Pip Module.

Discord.py-MaxEmbeds An EmbedBuilder for Discord bots in Python. You need discord.py to use this module. Installation Step 1 First you have to install

Max Tischberger 6 Jan 13, 2022
API RestFull de uma clinica, onde vai efetuar os agendamentos dos pacientes e mostrar o historicos de cada agendamentos

API REstFull O que tem na API Usado para clinicas. Cadastro de pacientes. Agendamentos de pacientes. Históricos dos agendamentos vinculados com a tabe

Lucas Silva 3 Aug 29, 2022
Simple contact bot for telegram, written in python.

🔗 | Install Install the requirements with pip install -r requirements.txt 📋 | Setup Get your token from BotFather Get your UserId with Nicegram or w

Stehack 3 Dec 10, 2022
Currency And Gold Prices - Currency And Gold Prices For Python

Currency_And_Gold_Prices Photos from the app New Update Show range Change better

Ali HemmatNia 4 Sep 19, 2022
Coinbase Listing Sniper

Coinbase Listing Sniper Script that listens to the @CoinbaseAssets twitter to find information about new Coinbase listings, and automatically buys 100

4 Oct 26, 2022
Python functions to run WASS stereo wave processing executables, and load and post process WASS output files.

wass-pyfuns Python functions to run the WASS stereo wave processing executables, and load and post process the WASS output files. General WASS (Waves

Mika Malila 3 May 13, 2022
KiKi bare dogs can share your joys and sorrows with you.

Kiki-FangLee-DiscordBot KiKi bare dogs can share your joys and sorrows with you. $help: Kiki will show you my talent, aw-aw. $list: Show Kiki's knowle

Fang Lee 0 Feb 12, 2022
Бот для мини-игры "Рабы" ("Рабство") ВКонтакте.

vk-slaves-bot Бот для мини-игры "Рабы" ("Рабство") ВК Группа в ВК, в ней публикуются новости и другая полезная информация. У группы есть беседа, в кот

Almaz 80 Dec 17, 2022
Ulaavi for nuke, helps to keep our stocl elements organised.

Ulaavi Ulaavi for nuke, helps to keep our stock elements organised. Installation Downlaod ffmpeg from ffmpeg.org linux : https://johnvansickle.com/ffm

Arun Subramaniyam 17 Aug 24, 2022
discord.xp Bot, counts XP for members

discord.xp Bot, counts XP for members. How to setup and run? You must have an mysql database Download libs from the requirements.txt file Configurize

irwing 4 Feb 05, 2022
Andrei 1.4k Dec 24, 2022
Python SDK for IEX Cloud

iexfinance Python SDK for IEX Cloud. Architecture mirrors that of the IEX Cloud API (and its documentation). An easy-to-use toolkit to obtain data for

Addison Lynch 640 Jan 07, 2023
Sie_banxico - A python class for the Economic Information System (SIE) API of Banco de México

sie_banxico A python class for the Economic Information System (SIE) API of Banco de México. Args: token (str): A query token from Banco de México id_

Dillan 2 Apr 07, 2022
Touca SDK for Python

Touca SDK For Python Touca helps you understand the true impact of your day to day code changes on the behavior and performance of your overall softwa

Touca 12 May 18, 2022