Mdisky
An Unofficial Python version of Mdisk API wrapper. Used to convert and rename Mdisk Files.
Installation
Install mdisky with pip
pip install mdisky
To Upgrade
pip install --upgrade mdisky
Usage
from mdisky import Mdisk
import asyncio
mdisk = Mdisk('us5CqX8oandALtQ86FLq')
async def main():
link = await mdisk.convert('https://mdisk.me/convertor/16x9/H331KO')
print(link)
asyncio.run(main())
Output: https://mdisk.me/convertor/16x9/gvh9fI
Features
- Single URL Convert
- Batch Convert from list
- Convert from Text
- Rename Filename
Contributing
Contributions are always welcome!
Reference
Init
from mdisky import Mdisk
import asyncio
mdisk = Mdisk("Your MDisk API Key")
Convert a single URL
convert(link, silently_fail) -> str
Parameter | Type | Description |
---|---|---|
link |
string |
Required. Others Mdisk Link |
silently_fail |
bool |
Raise an exception or not if error ocuurs |
Example:
async def main():
link = await mdisk.convert('https://mdisk.me/convertor/16x9/H331KO')
print(link)
asyncio.run(main())
## Output: https://mdisk.me/convertor/16x9/gvh9fI
Bulk Convert
bulk_convert(urls:list, silently_fail) -> list
Parameter | Type | Description |
---|---|---|
urls |
list |
Required. List of URLs to convert |
Example:
async def main():
links = ['https://mdisk.me/convertor/16x9/zlG3T0', 'https://mdisk.me/convertor/16x9/H331KO']
link = await mdisk.bulk_convert(links)
print(link)
asyncio.run(main())
## Output: ['https://mdisk.me/convertor/16x9/RpLLan', 'https://mdisk.me/convertor/16x9/gvh9fI']
Convert from Text
convert_from_text(text:str, silently_fail:bool=True)
Parameter | Type | Description |
---|---|---|
text |
str |
Required. Text containing Mdisk links to convert |
Example:
async def main():
text = """
Ep 1:-https://mdisk.me/convertor/16x9/H331KO
Ep 2:-https://mdisk.me/convertor/16x9/mRnSFW
"""
link = await mdisk.convert_from_text(text)
print(link)
asyncio.run(main())
## Output:
Ep 1:-https://mdisk.me/convertor/16x9/gvh9fI
Ep 2:-https://mdisk.me/convertor/16x9/5JIit7
Get filename
get_filename(link:str)
Parameter | Type | Description |
---|---|---|
link |
str |
Required. Link to get the filename of |
Example:
async def main():
link = "https://mdisk.me/convertor/16x9/5JIit7"
filename = await mdisk.get_filename(link)
print(filename)
asyncio.run(main())
## Output: Mdisky Demo Link
Change filename
change_filename(link, filename)
Parameter | Type | Description |
---|---|---|
link |
str |
Required. Link to Change the filename of |
filename |
str |
Required. New Filename |
Example:
async def main():
link = "https://mdisk.me/convertor/16x9/5JIit7"
link = await mdisk.change_filename(link, 'Mdisky Demo Link')
print(link)
asyncio.run(main())
## Output: Mdisky Demo Link
Support
For support, email jesikamaraj@gmail.com or PM Dev
Roadmap
- Async API Request for time saving
- Add more integrations
Disclaimer
Licensed under GNU AGPL v3.0.
Selling The Codes To Other People For Money Is Strictly Prohibited.