Socket
Socket
Sign inDemoInstall

mdiskpro

Package Overview
Dependencies
1
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mdiskpro

An Unofficial Mdiskpro.xyz API


Maintainers
1

Readme

MdiskPro

A Unofficial Wrapper for Mdiskpro.xyz
· Report Bug / Request Feature · Usage · Reference


MdiskPro

An Unofficial Python version of Mdiskpro.xyz. Used to Short your long link and let you Earn from it.

Installation

Install shortzy with pip

pip install mdiskpro

To Upgrade

pip install --upgrade mdiskpro

Usage

from mdiskpro import MdiskPro
import asyncio

mdiskpro = MdiskPro('<YOUR API KEY>')

async def main():
    link = await mdiskpro.convert('https://example.com/')
    print(link)

asyncio.run(main())
Output: https://mdiskpro.in/mVkra

Features

  • Single URL Convert
  • Batch Convert from List
  • Convert from Text

Contributing

Contributions are always welcome!

Reference

Init

from mdiskpro import Shortzy
import asyncio

mdiskpro = MdiskPro(api_key="Your API Key") 

Convert a single URL

convert(link, alias, silently_fail, quick_link) -> str
ParameterTypeDescription
linkstringRequired. Long URL Link
aliasstringCustom alias for the link
silently_failboolRaise an exception or not if error ocuurs
quick_linkboolReturns the quick link

Example:

async def main():
    link = await mdiskpro.convert('https://www.youtube.com/watch?v=d8RLHL3Lizw')
    print(link)

asyncio.run(main())

Convert from Text

convert_from_text(text:str, silently_fail:bool=True, quick_link:bool=False) -> str
ParameterTypeDescription
textstrRequired. Text containing Long URLS to short

Example:

async def main():
    text = """
Unstoppable:-https://www.youtube.com/watch?v=330xlOv8p9M
Night Changes:-https://www.youtube.com/watch?v=syFZfO_wfMQ
"""
    link = await MdiskPro.convert_from_text(text)
    print(link)

asyncio.run(main())


get_quick_link(link:str)
ParameterTypeDescription
linkstrRequired. Long Link

Example:

async def main():
    link = "https://www.youtube.com/watch?v=syFZfO_wfMQ"
    quick_link = await MdiskPro.get_quick_link(link)
    print(quick_link)

asyncio.run(main())

Credits

Keywords

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc