npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dark-yasiya-magna-api

v1.0.0

Published

Unofficial API wrapper for magna-dl

Downloads

4

Readme

magna-dl API

yts.mx

Unofficial API wrapper for yts.mx/magna-dl

Example

The Following Code snipet will help you understand how to use this.

var Magna = require("dark-yasiya-magna-api");
var magna = new Magna();
await magna.login("[email protected]","password");
await magna.addMagnet("magnet_link");
// Starts downloading, wait till that happens
var contents = await magna.getVideos();
// An object containing list of all files and folders

Documentation

Logging in

There are two ways to login, that is,

  • using username and password
  • using device code

the username and password method returns a token with short lifetime while device id method returns a 1 year lifetime token.

var Magna = require("dark-yasiya-magna-api");
var magna = new Magna();
await magna.login("[email protected]","password");
var Magna = require("dark-yasiya-magna-api");
var magna = new Magna();
await magna.getDeviceCode();
// prints a device code and user code, go to devices and add user code
// after adding user code, pass the device code parameter to getToken function

await magna.getToken("device_code");
// returns a token with 1 year lifetime

** using an old token to log in directly **

var Magna = require("dark-yasiya-magna-api");
var magna = new Magna();
await magna.addToken("token");

Adding magnet link

Magnet link can be added using addMagnet function

var Magna = require("dark-yasiya-magna-api");
var magna = new Magna();
await magna.login("[email protected]","password");

await magna.addMagnet("magnet_link");

// adds a magnet link, wait till it downloads

Getting contents

To get contents (only videos), use the getVideos function

var Magna = require("dark-yasiya-magna-api");
var magna = new Magna();
await magna.login("[email protected]","password");

await magna.getVideos();

/*
Prints Array of Arrays with file data

[
  [
    {
      "fid": 124291671, // folder id
      "id": 636235280, // file id
      "name": "File Name"
    },
    ...
  ],
  ...
]
*/

Deleting contents

To delete Folders use deleteFolder function and to delete files, use deleteFiles function

var Magna = require("dark-yasiya-magna-api");
var magna = new Magna();
await magna.login("[email protected]","password");

await magna.deleteFile("file_id");

await magna.deleteFolder("folder_id");

Contributing

Thank you for your interest in contributing, If you feel like there's something missing or any new feature can be added, just create a PR and I will see the rest.

Help

You can contact me on social media, Everything about me can be found here

Installation

Requirements

  • Node.Js installed

Dev Dependencies

  • Axios

Credits

  • yts.mx For making an excellent tool

Contact

Contact me anywhere, just visit my portfolio

License

This project is licensed under MIT License, See LICENSE for more information