Closed ajanjairam closed 4 years ago
You have an error in your code:
const TorrentSearchApi = require('torrent-search-api');
TorrentSearchApi.enableProvider('Torrent9');
async function getTorrents() {
const torrents = await TorrentSearchApi('1080', 'Movies', 20); // <= TorrentSearchApi.search('1080', 'Movies', 20)
const result = await TorrentSearchApi.getTorrentDetails(torrents);
console.log(result);
}
getTorrents()
You have an error in your code:
const TorrentSearchApi = require('torrent-search-api'); TorrentSearchApi.enableProvider('Torrent9'); async function getTorrents() { const torrents = await TorrentSearchApi('1080', 'Movies', 20); // <= TorrentSearchApi.search('1080', 'Movies', 20) const result = await TorrentSearchApi.getTorrentDetails(torrents); console.log(result); } getTorrents()
Can you specify the error ?
There's a comment on this line ;)
const torrents = await TorrentSearchApi('1080', 'Movies', 20); // <= TorrentSearchApi.search('1080', 'Movies', 20)
There's a comment on this line ;)
const torrents = await TorrentSearchApi('1080', 'Movies', 20); // <= TorrentSearchApi.search('1080', 'Movies', 20)
const TorrentSearchApi = require('torrent-search-api'); TorrentSearchApi.enableProvider('Torrent9'); async function getTorrents() { const torrents = await TorrentSearchApi.search('1080', 'Movies', 20); const result = await TorrentSearchApi.getTorrentDetails(torrents); console.log(result); } getTorrents()
i corrected the error code to the above code, and this gives an new error !
(node:11940) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toLowerCase' of undefined
There's also an error on the getTorrentDetails
line, this function returns the details of only one torrent:
const result = await TorrentSearchApi.getTorrentDetails(torrents[0]);
console.log(result);
There's also an error on the
getTorrentDetails
line, this function returns the details of only one torrent:const result = await TorrentSearchApi.getTorrentDetails(torrents[0]); console.log(result);
Thanks for your support, where can i find the syntax examples for all different torrent providers, i'm asking this because when i use torrent providers except Torrent9, i get the below error
(node:8144) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'provider' of undefined
It's the same syntax for all providers.
From what I can see in the stacktrace, I think you're passing an undefined
value to the getTorrentDetails
function. I assume you didn't have any result from the search.
It's the same syntax for all providers. From what I can see in the stacktrace, I think you're passing an
undefined
value to thegetTorrentDetails
function. I assume you didn't have any result from the search.
whenever i use pirate bay i get this error
(node:13924) UnhandledPromiseRejectionWarning: RequestError: Error: getaddrinfo ENOTFOUND thepiratebay.vip
ThePirateBay.vip is blocked by your ISP, try to find another tpb proxy that works for you and change it like this:
TorrentSearchApi.overrideConfig('thepiratebay', { baseUrl: 'https://pirateproxy.surf' });
ThePirateBay.vip is blocked by your ISP, try to find another tpb proxy that works for you and change it like this:
TorrentSearchApi.overrideConfig('thepiratebay', { baseUrl: 'https://pirateproxy.surf' });
I used the same code and got the below error (https://pirateproxy.surf is accessible in my ISP)
(node:19232) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'provider' of undefined
I updated TPB provide, with a new api (apibay). You should be good to go with the last version 2.1.2.
const TorrentSearchApi = require('torrent-search-api'); TorrentSearchApi.enableProvider('Torrent9'); async function getTorrents() { const torrents = await TorrentSearchApi('1080', 'Movies', 20); const result = await TorrentSearchApi.getTorrentDetails(torrents); console.log(result); } getTorrents()
The above code gives the below error
(node:38300) UnhandledPromiseRejectionWarning: TypeError: TorrentSearchApi is not a function