feat(torrents): test scrape torrent info when create new torrent record

This commit is contained in:
OldHawk
2017-08-17 17:32:32 +08:00
parent 375debad32
commit 98296c1ede
2 changed files with 11 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ module.exports = {
admin: 'admin@chd.im',
base_url: 'http://chd.im:3000',
client_black_list_url: 'http://chd.im:3000/client_black_list',
private_torrent_cms: true
private_torrent_cms: false
},
ircAnnounce: {
enable: true,

View File

@@ -18,6 +18,7 @@ var path = require('path'),
fs = require('fs'),
nt = require('nt'),
benc = require('bncode'),
scrape = require(path.resolve('./config/lib/scrape')),
async = require('async'),
validator = require('validator'),
tmdb = require('moviedb')(config.meanTorrentConfig.tmdbConfig.key),
@@ -985,6 +986,15 @@ exports.torrentByID = function (req, res, next, id) {
} else {
req.torrent = torrent;
next();
scrape.doScrape(torrent, function (err, res) {
if (err) {
console.log(err);
}
if (res) {
console.log(res);
}
});
}
});
};