From e9f6f3a656b03ae557ab90a516c964f458efa0ec Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Tue, 9 Jan 2018 16:44:10 +0100 Subject: [PATCH] We added a new python app for fetching torrents. The api is now changed to use the new project. IMPORTANT that a check for if jackett is set up is done, if else this is will not run correctly. --- seasoned_api/src/pirate/pirateRepository.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/seasoned_api/src/pirate/pirateRepository.js b/seasoned_api/src/pirate/pirateRepository.js index 97bb77c..ab4ca3c 100644 --- a/seasoned_api/src/pirate/pirateRepository.js +++ b/seasoned_api/src/pirate/pirateRepository.js @@ -6,12 +6,12 @@ var PythonShell = require('python-shell'); async function find(searchterm, callback) { var options = { - pythonPath: '/usr/bin/python3', - // pythonPath: '/Library/Frameworks/Python.framework/Versions/3.6/bin/python3', - args: [searchterm] + // pythonPath: '/usr/bin/python3', + pythonPath: '/Library/Frameworks/Python.framework/Versions/3.6/bin/python3', + args: [searchterm, '-s', 'jackett', '--print'] } - PythonShell.run('../app/pirateSearch.py', options, callback); + PythonShell.run('../app/torrent_search/torrentSearch/search.py', options, callback); // PythonShell does not support return }; @@ -29,6 +29,7 @@ async function callPythonAddMagnet(magnet, callback) { async function SearchPiratebay(query) { return await new Promise((resolve) => { return find(query, function(err, results) { + console.log('err', err, '. result', results); resolve(JSON.parse(results, null, '\t')); }) })