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

nurlresolver

v3.16.4

Published

url resolver for node

Downloads

961

Readme

nurlresolver

Streamline your download experience with this Node.js package designed to extract direct, hassle-free downloadable links from various file-sharing websites. Say goodbye to multiple clicks and pesky ads, ensuring a seamless and efficient downloading process.

license npm latest package npm downloads github forks github stars

Live Demo

Warning: This package is native ESM and no longer provides a CommonJS export. If your project uses CommonJS, you will have to convert to ESM or use the dynamic import() function. Please don't open issues for questions regarding CommonJS / ESM.

Installation

npm install nurlresolver

Usage: ES6 usage

import nUrlResolver from 'nurlresolver';
const results = await nUrlResolver.resolve(linkToResolve);

const linkToResolve = 'https://cloud.mail.ru/public/abcd/sAmPlE';
const results = await nUrlResolver.resolve(linkToResolve);

Output

[  
  {
    link: 'https://cloclo3.cldmail.ru/public/get/generatedlink/no/FileName.extension',
    title: 'FileName.extension',
    isPlayable: true,
    parent: 'https://cloud.mail.ru/public/abcd/sAmPlE',
    speedRank: 65 //0-100 better speed means higher rank
  }
]

Resolve link recursively:

const results = await nUrlResolver.resolveRecursive(link);
/*
This is going to resolve the final playback links.
Schema representation is same as above result.
The only difference is it recursively resolve all the links as they get found.
*/

Headers Support

In some of the sharing sites, it's required to send some header information back. e.g. Referer is required in some sites or if a link generated from an ip which is only accessible from that ip (in this case the xforward header is added in the result output so that same header can be sent to the same site later on.)

Advance Options

options

| Name | Type | Description | | :--- | :----: | :--- | extractMetaInformation | boolean | instruct the resolver to extract contenttype, lastmodifieddate and size of the file.
| timeout | number | timeout in seconds
| googleDrive.apiKey | string | optional api key to avoid anonymous access. Defaults to empty to allow anonymous access. | customResolvers | array | custom resolvers you can inject for resolving urls. Refer to app.tests for implementation samples
| ignoreResolvers | array | regex array you can inject to ignore executing specific resolvers. Refer to app.tests for implementation samples

const results = await nUrlResolver.resolve(linkToResolve, {
    extractMetaInformation: true,
    timeout: 30 //returns the results at maximum after 30 seconds.
});

Output

[
  {
    "link": "http://www5d.filecdn.pw/dkske911881kkk?download_token=SOME_TOKEN_VALUE",
    "title": "FILE.EXTENSION",
    "isPlayable": true,
    "headers": {
      "X-Real-IP": "XX.YY.ZZ.AA"
    },
    "parent": "https://dlfiles.online/dkske911881kkk",
    "speedRank": 55,
    "size": "900163682",
    "lastModified": "Wed, 21 Sep 2019 12:09:06 GMT",
    "contentType": "application/octet-stream"
  }
]

Supported sites

  • Google Drive
  • CloudMailRu
  • MegaupNet
  • Dlfiles
  • Doodvideo
  • Indishare
  • Racaty
  • uploadraja
  • ZuploadMe
  • Yourupload
  • etc. Refer here for complete implementation

Try it Online https://repl.it/repls/HandsomeLightgraySmalltalk

Testing

npm run test

License

MIT