Skip to content

Torrents search engine for both JavaScript and NodeJS with TypeScript support.

License

Notifications You must be signed in to change notification settings

KiraLT/torrent-browse

Repository files navigation

Torrent browse

CodeQL codecov semantic-release prettier

Torrents discovery library for both NodeJS & browser.

Read Documentation 📘

Check Demo 🎁

Installation

npm version npm

Install with NPM/yarn:

# NPM
npm install torrent-browse
# Yarn
yarn add torrent-browse

Import what you need:

import { search, defaultProviders } from 'torrent-browse'

search(
    defaultProviders,
    'harry potter'
).then(result => {
    console.log(result)
})

Load directly in the browser

Include script from CDN and use torrentBrowse global variable:

<script src="https://unpkg.com/torrent-browse"></script>
<script>
    torrentBrowse.search(
        torrentBrowse.defaultProviders,
        'harry potter'
    ).then(result => {
        console.log(result)
    })
</script>

Browser VS Node

This library works in both NodeJS and the browser. However some default providers may not work in the browser due to browser limitations.

Due to CORS limitation browser can't fetch data from different domain. To get around that in the browser library uses free proxy servers. However they do not support custom headers and other things to get around website protections (like cloudflare).