Pirate repository has relative and use virtuale python when running python commands

This commit is contained in:
2019-06-28 22:44:39 +02:00
parent 15826a00ba
commit d3bc854e03

View File

@@ -21,12 +21,12 @@ function getMagnetFromURL(url) {
async function find(searchterm, callback) { async function find(searchterm, callback) {
const options = { const options = {
pythonPath: '/usr/bin/python3', pythonPath: '../torrent_search/env/bin/python3.6',
// pythonPath: '/Library/Frameworks/Python.framework/Versions/3.6/bin/python3', scriptPath: '../torrent_search',
args: [searchterm, '-s', 'jackett', '-f', '--print'], args: [searchterm, '-s', 'jackett', '-f', '--print']
}; }
PythonShell.run('../torrent_search/torrentSearch/search.py', options, callback); PythonShell.run('torrentSearch/search.py', options, callback);
// PythonShell does not support return // PythonShell does not support return
} }
@@ -35,12 +35,12 @@ async function callPythonAddMagnet(url, callback) {
getMagnetFromURL(url) getMagnetFromURL(url)
.then((magnet) => { .then((magnet) => {
const options = { const options = {
pythonPath: '/usr/bin/python', pythonPath: '../delugeClient/env/bin/python3.6',
// pythonPath: '/Library/Frameworks/Python.framework/Versions/3.6/bin/python3', scriptPath: '../delugeClient',
args: [magnet], args: ['add', magnet]
}; };
PythonShell.run('../app/magnet.py', options, callback); PythonShell.run('deluge_cli.py', options, callback);
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
@@ -63,7 +63,7 @@ async function SearchPiratebay(query) {
})); }));
} }
async function AddMagnet(magnet) { async function AddMagnet(magnet, name, tmdb_id) {
return await new Promise((resolve, reject) => callPythonAddMagnet(magnet, (err, results) => { return await new Promise((resolve, reject) => callPythonAddMagnet(magnet, (err, results) => {
if (err) { if (err) {
/* eslint-disable no-console */ /* eslint-disable no-console */