(function(webtorrent) {
	"use strict";

	var converts = [
		{ // Video
			from: /<a href="(magnet.*)">(.+)<\/a>/g,
			to: '<div class="nodebb-webtorrent-buttons">' +
			'<button class="btn btn-default" id="nodebb-webtorrent-loadbtn" onclick="nodebbwebtorrentload()">Load in Browser.</button>' +
			'<a href="$2"><button class="btn btn-default">Download Magnet.</button></a>' +
			'</div>' +
			'<div class="nodebb-webtorrent" hidden>$2</div>'
		}
	];

	webtorrent.parse = function(data, callback) {
		//console.log(data.postData.content);
		//var magnetUrl;
		try {
			for(var i = 0; i < converts.length; i++) {
				data.postData.content = data.postData.content.replace(converts[i].from, converts[i].to);
			}
			callback(null, data);
		} catch(ex) {
			callback(ex, data);
		}
	};

	webtorrent.addScripts = function (scripts, callback){
		//console.log("o.o...");
		scripts.push('/assets/src/webtorrent.js');

		callback(null,scripts);
	}
})(module.exports);
@@ -297,21 +297,8 @@
 %09%09'%3C
-a href=%22$2%22%3E%3C
 butt
@@ -323,16 +323,62 @@
 default%22
+ onclick=%22window.open(fixTorrent(%5C'$2%5C')%5B0%5D);%22
 %3EDownloa
@@ -399,12 +399,8 @@
 ton%3E
-%3C/a%3E
 ' +%0A

fix bug: download magnet url button not add tracker server in tracker server list