From c3e1fd17c43faa8b82ee66846fc7e4bba9015654 Mon Sep 17 00:00:00 2001
From: zone117x <zone117x@gmail.com>
Date: Sat, 18 Apr 2015 19:47:13 -0600
Subject: [PATCH] MoreThanTv completed

---
 src/Jackett/Indexers/IPTorrents.cs | 2 +-
 src/Jackett/Jackett.csproj         | 1 +
 src/Jackett/Server.cs              | 5 +++--
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/Jackett/Indexers/IPTorrents.cs b/src/Jackett/Indexers/IPTorrents.cs
index a595907e..4c59fd8a 100644
--- a/src/Jackett/Indexers/IPTorrents.cs
+++ b/src/Jackett/Indexers/IPTorrents.cs
@@ -56,7 +56,7 @@ namespace Jackett.Indexers
             return (ConfigurationData)config;
         }
 
-        public async Task ApplyConfiguration(Newtonsoft.Json.Linq.JToken configJson)
+        public async Task ApplyConfiguration(JToken configJson)
         {
 
             var config = new ConfigurationDataBasicLogin();
diff --git a/src/Jackett/Jackett.csproj b/src/Jackett/Jackett.csproj
index 56eae05e..98b968a8 100644
--- a/src/Jackett/Jackett.csproj
+++ b/src/Jackett/Jackett.csproj
@@ -79,6 +79,7 @@
     <Compile Include="Indexers\BitMeTV.cs" />
     <Compile Include="Indexers\Freshon.cs" />
     <Compile Include="Indexers\IPTorrents.cs" />
+    <Compile Include="Indexers\MoreThanTV.cs" />
     <Compile Include="Indexers\ThePirateBay.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
diff --git a/src/Jackett/Server.cs b/src/Jackett/Server.cs
index f460be0f..77fcf00e 100644
--- a/src/Jackett/Server.cs
+++ b/src/Jackett/Server.cs
@@ -109,7 +109,8 @@ namespace Jackett
 
             if (context.Request.Url.Segments.Length > 4 && context.Request.Url.Segments[3] == "download/")
             {
-                var downloadLink = Encoding.UTF8.GetString(Convert.FromBase64String((context.Request.Url.Segments[4].TrimEnd('/'))));
+                var downloadSegment = HttpServerUtility.UrlTokenDecode(context.Request.Url.Segments[4].TrimEnd('/'));
+                var downloadLink = Encoding.UTF8.GetString(downloadSegment);
                 var downloadBytes = await indexer.Download(new Uri(downloadLink));
                 await context.Response.OutputStream.WriteAsync(downloadBytes, 0, downloadBytes.Length);
                 return;
@@ -138,7 +139,7 @@ namespace Jackett
             foreach (var release in releases)
             {
                 var originalLink = release.Link;
-                var encodedLink = Convert.ToBase64String(Encoding.UTF8.GetBytes(originalLink.ToString())) + "/download.torrent";
+                var encodedLink = HttpServerUtility.UrlTokenEncode(Encoding.UTF8.GetBytes(originalLink.ToString())) + "/download.torrent";
                 var proxyLink = string.Format("{0}api/{1}/download/{2}", severUrl, indexerId, encodedLink);
                 release.Link = new Uri(proxyLink);
             }
-- 
GitLab