Comments (9)
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.
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.
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.
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.
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.
from torrent-search-api.
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.
Duplicate of #68
from torrent-search-api.
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.
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)
- Feature req: Specify scrapes for only webtorrents HOT 2
- Yggtorrent - CaptchaError: captcha HOT 19
- Rarbg not working anymore HOT 1
- Error :: Module not found: Can't resolve '_http_common'
- TypeError: TorrentSearchApi is not a function HOT 11
- IPTorrents Authentication Doesn't Work HOT 8
- ThePirateBay doesn't seem to be working HOT 8
- Can't Deploy in Heroku HOT 3
- Provider ThePirateBay magnet name undefined
- cannot read property "toLowerCase' of undefined when getting magnet links HOT 3
- Suggestions about request and bluebird HOT 3
- [YGGTorrent] Error in torrent file HOT 2
- Unable to use Ygg provider HOT 14
- eztv.io changed to eztv.re HOT 1
- [Docs] No Custom Provider documentation
- uniqueName error when passed a number HOT 1
- this npm package requires netmask@^1.0.6 via a transitive dependency on [email protected]
- Error in searching torrents HOT 1
- Dead repo ? HOT 1
- Udpate YggTorrent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torrent-search-api.