Code Monkey home page Code Monkey logo

Comments (9)

JimmyLaurent avatar JimmyLaurent commented on September 17, 2024 1

Cloudfare may have done some changes since someone also opened an issue on cloudscraper with the same problem few hours ago (issue).

Hopefully, there will be a fix and we'll just have to upgrade.

from torrent-search-api.

JimmyLaurent avatar JimmyLaurent commented on September 17, 2024

Try this:

const torrentSearch = require('torrent-search-api');
torrentSearch.enableProvider('IpTorrents', 'USER', 'PASSWORD');

async function startTorrentQuery() {
    return await torrentSearch.search('1080', 'Movies', 20);
}

(async () => {
 const results = await startTorrentQuery();
 console.log(results);
})();

from torrent-search-api.

97WaterPolo avatar 97WaterPolo commented on September 17, 2024

Try this:

const torrentSearch = require('torrent-search-api');
torrentSearch.enableProvider('IpTorrents', 'USER', 'PASSWORD');

async function startTorrentQuery() {
    return await torrentSearch.search('1080', 'Movies', 20);
}

(async () => {
 const results = await startTorrentQuery();
 console.log(results);
})();

Ran that, but now I am getting an empty array when printing out the value of the search. Copy pasted your code and all I have are the empty square brackets. I know for sure my credentials and I know there should be results for 1080 in the search option.

I have tried a few other public providers and it seems to be throwing some random errors occasionally when searching for even basic torrents. Specifically whenever I deal with IPtorrents, I receive an empty array when executing my torrent search, did something change on their end?

from torrent-search-api.

JimmyLaurent avatar JimmyLaurent commented on September 17, 2024

It seems so, unfortunately I don't have an IpTorrents account anymore.

From what I see, your queries may be blocked by cloudfare.

You can try to enable the "enableCloudFareBypass" flag on the IpTorrents provider.

{
    "name": "IpTorrents",
    "baseUrl": "https://iptorrents.eu",
    "enableCloudFareBypass": true, // <==== Here
    "requireAuthentification": true,
    "supportCookiesAuthentification": true,
    "supportCredentialsAuthentification": true,
    "loginUrl": "/take_login.php",
    "loginQueryString": "username={username}&password={password}",
    "searchUrl": "/t?{cat}q={query};o=seeders",
    "categories": {
       "All": "",
       "Movies": "7;68;54;77;20;89;90;96;6;48;62;38;",
       "TV": "73;",
       "Games": "74;",
       "Music": "75;"
    },
    "defaultCategory": "All",
    "resultsPerPageCount": 50,
    "itemsSelector": "table[id=\"torrents\"] tr:not(:first-child)",
    "itemSelectors": {
       "title": "td:nth-child(2) a",
       "time": "tr:nth-child(2) div.t_ctime | split:%SPECIAL_CHAR%,1 | trim",
       "downloaded": "td:nth-child(7) | int",
       "seeds": "td:nth-child(8) | int",
       "peers": "td:nth-child(9) | int",
       "size": "td:nth-child(6)",
       "link": "td:nth-child(4) a@href",
       "desc": "td:nth-child(2) a@href"
    },
    "paginateSelector": "a:contains(Next)@href",
    "torrentDetailsSelector": ".desWrap@html"
 }

from torrent-search-api.

97WaterPolo avatar 97WaterPolo commented on September 17, 2024

It seems so, unfortunately I don't have an IpTorrents account anymore.

From what I see, your queries may be blocked by cloudfare.

You can try to enable the "enableCloudFareBypass" flag on the IpTorrents provider.

{
    "name": "IpTorrents",
    "baseUrl": "https://iptorrents.eu",
    "enableCloudFareBypass": true, // <==== Here
    "requireAuthentification": true,
    "supportCookiesAuthentification": true,
    "supportCredentialsAuthentification": true,
    "loginUrl": "/take_login.php",
    "loginQueryString": "username={username}&password={password}",
    "searchUrl": "/t?{cat}q={query};o=seeders",
    "categories": {
       "All": "",
       "Movies": "7;68;54;77;20;89;90;96;6;48;62;38;",
       "TV": "73;",
       "Games": "74;",
       "Music": "75;"
    },
    "defaultCategory": "All",
    "resultsPerPageCount": 50,
    "itemsSelector": "table[id=\"torrents\"] tr:not(:first-child)",
    "itemSelectors": {
       "title": "td:nth-child(2) a",
       "time": "tr:nth-child(2) div.t_ctime | split:%SPECIAL_CHAR%,1 | trim",
       "downloaded": "td:nth-child(7) | int",
       "seeds": "td:nth-child(8) | int",
       "peers": "td:nth-child(9) | int",
       "size": "td:nth-child(6)",
       "link": "td:nth-child(4) a@href",
       "desc": "td:nth-child(2) a@href"
    },
    "paginateSelector": "a:contains(Next)@href",
    "torrentDetailsSelector": ".desWrap@html"
 }

I just attempted again with cloud flare bypass, but still throwing an error, this time with the CloudFlare technique changing.
plexconsoel

from torrent-search-api.

JimmyLaurent avatar JimmyLaurent commented on September 17, 2024

The library we use to bypass cloudfare (cloudscraper) may be outdated.
We use the 3.2.0 and the latest is 4.3.0.

You should try to upgrade, but you may have some breaking changes to fix.

from torrent-search-api.

JimmyLaurent avatar JimmyLaurent commented on September 17, 2024

Duplicate of #68

from torrent-search-api.

97WaterPolo avatar 97WaterPolo commented on September 17, 2024

@JimmyLaurent

As of today I started getting this issue again. I have had "enableCloudFareBypass": true, in my iptorrents.json and now I am once again recieving the error in regards to Cloudflare changing their technique. I updated to the latest version of cloudscraper(4.5.0) and am still having this issue. If I set the variable to false I am given an empty array of torrent each time the search is executed.

Any idea on how I should resolve this? Only happens with IpTorrents, error and configuration below.

{
"name": "IpTorrents",
"baseUrl": "https://iptorrents.com",
"enableCloudFareBypass": true,
"requireAuthentification": true,
"supportCookiesAuthentification": true,
"supportCredentialsAuthentification": true,
"loginUrl": "/take_login.php",
"loginQueryString": "username={username}&password={password}",
"searchUrl": "/t?{cat}q={query};o=seeders",
"categories": {
"All": "",
"Movies": "7;68;54;77;20;89;90;96;6;48;62;38;",
"TV": "73;",
"Games": "74;",
"Music": "75;"
},
"defaultCategory": "All",
"resultsPerPageCount": 50,
"itemsSelector": "table[id="torrents"] tr:not(:first-child)",
"itemSelectors": {
"title": "td:nth-child(2) a",
"time": "tr:nth-child(2) div.t_ctime | split:%SPECIAL_CHAR%,1 | trim",
"downloaded": "td:nth-child(7) | int",
"seeds": "td:nth-child(8) | int",
"peers": "td:nth-child(9) | int",
"size": "td:nth-child(6)",
"link": "td:nth-child(4) a@href",
"desc": "td:nth-child(2) a@href"
},
"paginateSelector": "a:contains(Next)@href",
"torrentDetailsSelector": ".desWrap@html"
}

(node:8372) UnhandledPromiseRejectionWarning: ParserError:

Cloudflare may have changed their technique, or there may be a bug.

Bug Reports: https://github.com/codemanki/cloudscraper/issues

Check the detailed exception message that follows for the cause.

SyntaxError: Challenge evaluation failed: Unexpected token |
at solveChallenge (C:\Users\Plex\Desktop\TorrentTalker\node_modules\torrent-
search-api\node_modules\cloudscraper\index.js:254:21)
at Timeout._onTimeout (C:\Users\Plex\Desktop\TorrentTalker\node_modules\torr
ent-search-api\node_modules\cloudscraper\index.js:179:7)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
(node:8372) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). (rejection
id: 2)

from torrent-search-api.

97WaterPolo avatar 97WaterPolo commented on September 17, 2024

A new update was pushed for cloudscraper(version 4.6.0), but still having the same issue with the request being rejected. Any other ideas?

from torrent-search-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.