From 6bed7978d030ebb4c64b6341a454d89a34661b3c Mon Sep 17 00:00:00 2001
From: brinbois <brinbois@localhost.localdomain>
Date: Wed, 20 Mar 2013 05:58:09 +0100
Subject: [PATCH] Manual Download patch

---
 .../core/providers/torrent/cPASbien/main.py   | 18 +++++++++++++++-
 .../core/providers/torrent/t411/main.py       | 21 ++++++++++++++++++-
 2 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/couchpotato/core/providers/torrent/cPASbien/main.py b/couchpotato/core/providers/torrent/cPASbien/main.py
index e4134f7c..c5796213 100755
--- a/couchpotato/core/providers/torrent/cPASbien/main.py
+++ b/couchpotato/core/providers/torrent/cPASbien/main.py
@@ -238,4 +238,20 @@ class cPASbien(TorrentProvider):
         except:
             log.error('Failed downloading from %s: %s', (self.getName(), traceback.format_exc()))
             
-            
\ No newline at end of file
+    def download(self, url = '', nzb_id = ''):
+        
+        if not self.login_opener and not self.login():
+            return
+        
+        values = {
+          'url' : '/'
+        }
+        data_tmp = urllib.urlencode(values)
+        req = urllib2.Request(url, data_tmp )
+        
+        try:
+            log.error('Failed downloading from %s', self.getName())
+            return urllib2.urlopen(req).read()
+        except:
+            log.error('Failed downloading from %s: %s', (self.getName(), traceback.format_exc()))
+      
\ No newline at end of file
diff --git a/couchpotato/core/providers/torrent/t411/main.py b/couchpotato/core/providers/torrent/t411/main.py
index 58d8784e..c641e964 100644
--- a/couchpotato/core/providers/torrent/t411/main.py
+++ b/couchpotato/core/providers/torrent/t411/main.py
@@ -12,6 +12,7 @@ import re
 import time
 import traceback
 import urllib2
+import urllib
 import unicodedata
 
 log = CPLog(__name__)
@@ -183,4 +184,22 @@ class t411(TorrentProvider):
              'password': self.conf('password'),
              'remember': '1',
              'url': '/'
-        })
\ No newline at end of file
+        })
+        
+        
+    def download(self, url = '', nzb_id = ''):
+        
+        if not self.login_opener and not self.login():
+            return
+        
+        values = {
+          'url' : '/'
+        }
+        data_tmp = urllib.urlencode(values)
+        req = urllib2.Request(url, data_tmp )
+        
+        try:
+            log.error('Failed downloading from %s', self.getName())
+            return urllib2.urlopen(req).read()
+        except:
+            log.error('Failed downloading from %s: %s', (self.getName(), traceback.format_exc()))
\ No newline at end of file
-- 
GitLab