mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-07 16:23:05 +02:00
feat(torrents): test scrape torrent info when create new torrent record
This commit is contained in:
2
config/env/torrents.js
vendored
2
config/env/torrents.js
vendored
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user