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.
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.
Everything returns a Promise, so we can keep our code cleaner, and safe from callback hell.
import {TorrentBeam} from 'TorrentBeam';
let torrentBeam = new TorrentBeam();
let searchTerm = 'IAmSearchingForThis';
torrentBeam.searchAll(searchTerm)
.then(resp => console.log(resp))
.catch(err => console.error(err)); 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));import {TorrentBeam} from 'TorrentBeam';
let searchTerm = 'IAmSearchingForThis';
async function awaitSearchResults() {
return await torrentBeam.searchAll(searchTerm);
}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
Request it as an issue, or you can use a tool like SelectorGadget. They have an awesome free Chrome extension.
GNU General Public License v3 (GPL-3)
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
- 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.
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.