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

TorrentBeam

v1.4.0

Published

After the shutdown of KAT (KickAssTorrents) it has been harder and harder to find a reliable, consistent torrent provider. Even without KAT it was possible to find reliable sources through Torrentz.eu. Then that seemingly randomly shutdown. Now what are p

Downloads

12

Readme

TorrentBeamJS

What Is It?

After the shutdown of KAT (KickAssTorrents) it has been harder and harder to find a reliable, consistent torrent provider. Even without KAT it was possible to find reliable sources through Torrentz.eu. Then that seemingly randomly shutdown. Now what are people supposed to do? Enter TorrentBeamJS. While this won't be anywhere near as cool, or awesome as KAT / Torrentz.eu were, it can help find torrents from several sources all with a single search.

How Does It Work?

The premise is very simple. Most torrent websites provide a search function. The application emulates a browser (utilizing Nightmare (https://www.npmjs.com/package/nightmare)) to bypass straight HTTP request "securities" put in place by these websites, such as JavaScript rendering.

It works from a JSON file, namely search_config.json. Within this magical JSON file is an array of configuration objects for the individual providers. Here is the provided configuration of TorLock:

    {
		"name": "TorLock",
		"searchUrl": "https://www.torlock.com/all/torrents/%s.html",
		"testSearchUrl": "https://www.torlock.com/all/torrents/batman.html",
		"resultsCssSelectors": {
		  "links": [
			".panel-default .table-condensed td a@href"
		  ],
		  "titles": [
			".panel-default .table-condensed b"
		  ],
		  "added": [
			".panel-default .td"
		  ],
		  "sizes": [
			".panel-default .ts"
		  ],
		  "seeds": [
			".panel-default .tul"
		  ]
		}
	}

As you can see this provides all the necessary information points as keys in the config, with their accompanying value of their CSS selector for that specific website. These should be pretty self explanatory.

Performing Searches

Everything returns a Promise, so we can keep our code cleaner, and safe from callback hell.

All Provider Search

    import {TorrentBeam} from 'TorrentBeam';
    let torrentBeam = new TorrentBeam();
    let searchTerm = 'IAmSearchingForThis';
    
    torrentBeam.searchAll(searchTerm)
        .then(resp => console.log(resp))
        .catch(err => console.error(err));

Single Provider Search

    import {TorrentBeam} from 'TorrentBeam';
    let torrentBeam = new TorrentBeam();
    let searchTerm = 'IAmSearchingForThis';
    let provider = 'LimeTorrents';
    
    torrentBeam.searchSingle(provider,searchTerm)
        .then(resp => console.log(resp))
        .catch(err => console.error(err));

Without .then().catch()

import {TorrentBeam} from 'TorrentBeam';
let searchTerm = 'IAmSearchingForThis';

async function awaitSearchResults() {
    return await torrentBeam.searchAll(searchTerm);
}

Using Proxies / Switches

TorrentBeamJS supports all standard Nightmare switches, which in turn means it supports all of Chromium's switches. Just pass your configuration object into the constructor of TorrentBeam. Please read about the available switches here

How Do I Add Other Providers?

Request it as an issue, or you can use a tool like SelectorGadget. They have an awesome free Chrome extension.

License / Disclaimer

GNU General Public License v3 (GPL-3)

Text Summary

You may copy, distribute and modify the software as long as you track changes/dates in source files. Any modifications to or software including (via compiler) GPL-licensed code must also be made available under the GPL along with build & install instructions.

A full copy of the GNU license under which this software is partially released is available here

In addition to the GNU license:
  • This work is provided as is with no guarantee or warranty whether explicit or implied.
  • You may not utilize this software to illegally obtain copies of software, music, movies, and/or any other media.
  • Any actions conducted whether directly or indirectly while utilizing this software are the sole, full responsbility of the end-user.

In The Event I Have Not Been 100% Clear And Understood

What you do with this software is your responsibility. I will not be held liable for any damages caused by you, or your use of this software. Be sure to check your local laws and regulations before use.