summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-22 19:44:59 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-10-22 19:47:17 +0200
commit0eb6e7ec4a1144dcca824d8add049787d3da1762 (patch)
treed653f5fe28bb247a3c4fadeca9bf6278d744f929 /module/plugins/crypter
parentSpare code cosmetics (diff)
downloadpyload-0eb6e7ec4a1144dcca824d8add049787d3da1762.tar.xz
Two space before function declaration
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r--module/plugins/crypter/DDLMusicOrg.py1
-rw-r--r--module/plugins/crypter/DailymotionBatch.py6
-rw-r--r--module/plugins/crypter/DuckCryptInfo.py2
-rw-r--r--module/plugins/crypter/EmbeduploadCom.py1
-rw-r--r--module/plugins/crypter/HoerbuchIn.py1
-rw-r--r--module/plugins/crypter/LinkdecrypterCom.py5
-rw-r--r--module/plugins/crypter/NCryptIn.py6
-rw-r--r--module/plugins/crypter/NetfolderIn.py3
-rw-r--r--module/plugins/crypter/OneKhDe.py2
-rw-r--r--module/plugins/crypter/TurbobitNetFolder.py1
-rw-r--r--module/plugins/crypter/YoutubeBatch.py7
11 files changed, 26 insertions, 9 deletions
diff --git a/module/plugins/crypter/DDLMusicOrg.py b/module/plugins/crypter/DDLMusicOrg.py
index a78794b6d..bd5560ed1 100644
--- a/module/plugins/crypter/DDLMusicOrg.py
+++ b/module/plugins/crypter/DDLMusicOrg.py
@@ -22,6 +22,7 @@ class DDLMusicOrg(Crypter):
def setup(self):
self.multiDL = False
+
def decrypt(self, pyfile):
html = self.load(pyfile.url, cookies=True)
diff --git a/module/plugins/crypter/DailymotionBatch.py b/module/plugins/crypter/DailymotionBatch.py
index a0ed0e80f..5d2f53b38 100644
--- a/module/plugins/crypter/DailymotionBatch.py
+++ b/module/plugins/crypter/DailymotionBatch.py
@@ -26,6 +26,7 @@ class DailymotionBatch(Crypter):
page = self.load(url, get=req)
return json_loads(page)
+
def getPlaylistInfo(self, id):
ref = "playlist/" + id
req = {"fields": "name,owner.screenname"}
@@ -38,6 +39,7 @@ class DailymotionBatch(Crypter):
owner = playlist['owner.screenname']
return name, owner
+
def _getPlaylists(self, user_id, page=1):
ref = "user/%s/playlists" % user_id
req = {"fields": "id", "page": page, "limit": 100}
@@ -53,9 +55,11 @@ class DailymotionBatch(Crypter):
for item in self._getPlaylists(user_id, page + 1):
yield item
+
def getPlaylists(self, user_id):
return [(id,) + self.getPlaylistInfo(id) for id in self._getPlaylists(user_id)]
+
def _getVideos(self, id, page=1):
ref = "playlist/%s/videos" % id
req = {"fields": "url", "page": page, "limit": 100}
@@ -71,9 +75,11 @@ class DailymotionBatch(Crypter):
for item in self._getVideos(id, page + 1):
yield item
+
def getVideos(self, playlist_id):
return list(self._getVideos(playlist_id))[::-1]
+
def decrypt(self, pyfile):
m = re.match(self.__pattern__, pyfile.url)
m_id = m.group("ID")
diff --git a/module/plugins/crypter/DuckCryptInfo.py b/module/plugins/crypter/DuckCryptInfo.py
index 29eeb4453..737ed59ec 100644
--- a/module/plugins/crypter/DuckCryptInfo.py
+++ b/module/plugins/crypter/DuckCryptInfo.py
@@ -33,6 +33,7 @@ class DuckCryptInfo(Crypter):
else:
self.handleFolder(m)
+
def handleFolder(self, m):
src = self.load("http://duckcrypt.info/ajax/auth.php?hash=" + str(m.group(2)))
m = re.match(self.__pattern__, src)
@@ -47,6 +48,7 @@ class DuckCryptInfo(Crypter):
if clink.find("a"):
self.handleLink(clink.find("a")['href'])
+
def handleLink(self, url):
src = self.load(url)
soup = BeautifulSoup(src)
diff --git a/module/plugins/crypter/EmbeduploadCom.py b/module/plugins/crypter/EmbeduploadCom.py
index 71c4d5778..8e4f5da07 100644
--- a/module/plugins/crypter/EmbeduploadCom.py
+++ b/module/plugins/crypter/EmbeduploadCom.py
@@ -44,6 +44,7 @@ class EmbeduploadCom(Crypter):
if not self.urls:
self.fail('Could not extract any links')
+
def getLocation(self, tmp_links):
new_links = []
for link in tmp_links:
diff --git a/module/plugins/crypter/HoerbuchIn.py b/module/plugins/crypter/HoerbuchIn.py
index 34e124d82..773e0bf8b 100644
--- a/module/plugins/crypter/HoerbuchIn.py
+++ b/module/plugins/crypter/HoerbuchIn.py
@@ -40,6 +40,7 @@ class HoerbuchIn(Crypter):
else:
self.urls = self.decryptFolder(pyfile.url)
+
def decryptFolder(self, url):
m = self.protection.search(url)
if m is None:
diff --git a/module/plugins/crypter/LinkdecrypterCom.py b/module/plugins/crypter/LinkdecrypterCom.py
index c72092a5f..0358d1308 100644
--- a/module/plugins/crypter/LinkdecrypterCom.py
+++ b/module/plugins/crypter/LinkdecrypterCom.py
@@ -24,7 +24,6 @@ class LinkdecrypterCom(Crypter):
def decrypt(self, pyfile):
-
self.passwords = self.getPassword().splitlines()
# API not working anymore
@@ -32,8 +31,8 @@ class LinkdecrypterCom(Crypter):
if not self.urls:
self.fail('Could not extract any links')
- def decryptAPI(self):
+ def decryptAPI(self):
get_dict = {"t": "link", "url": self.pyfile.url, "lcache": "1"}
self.html = self.load('http://linkdecrypter.com/api', get=get_dict)
if self.html.startswith('http://'):
@@ -51,8 +50,8 @@ class LinkdecrypterCom(Crypter):
return None
- def decryptHTML(self):
+ def decryptHTML(self):
retries = 5
post_dict = {"link_cache": "on", "pro_links": self.pyfile.url, "modo_links": "text"}
diff --git a/module/plugins/crypter/NCryptIn.py b/module/plugins/crypter/NCryptIn.py
index 28a0735a5..ef696dbd8 100644
--- a/module/plugins/crypter/NCryptIn.py
+++ b/module/plugins/crypter/NCryptIn.py
@@ -131,7 +131,6 @@ class NCryptIn(Crypter):
def unlockProtection(self):
-
postData = {}
form = re.search(r'<form name="protected"(.*?)</form>', self.cleanedHtml, re.DOTALL).group(1)
@@ -210,7 +209,6 @@ class NCryptIn(Crypter):
def handleSingleLink(self):
-
self.logDebug("Handling Single link")
package_links = []
@@ -223,7 +221,6 @@ class NCryptIn(Crypter):
def handleCNL2(self):
-
self.logDebug("Handling CNL2 links")
package_links = []
@@ -239,7 +236,6 @@ class NCryptIn(Crypter):
def handleContainers(self):
-
self.logDebug("Handling Container links")
package_links = []
@@ -254,7 +250,6 @@ class NCryptIn(Crypter):
def handleWebLinks(self):
-
self.logDebug("Handling Web links")
pattern = r'(http://ncrypt\.in/link-.*?=)'
links = re.findall(pattern, self.html)
@@ -280,7 +275,6 @@ class NCryptIn(Crypter):
def _getCipherParams(self):
-
pattern = r'<input.*?name="%s".*?value="(.*?)"'
# Get jk
diff --git a/module/plugins/crypter/NetfolderIn.py b/module/plugins/crypter/NetfolderIn.py
index 027503bd2..03c62ba14 100644
--- a/module/plugins/crypter/NetfolderIn.py
+++ b/module/plugins/crypter/NetfolderIn.py
@@ -40,12 +40,14 @@ class NetfolderIn(SimpleCrypter):
# Set package
self.packages = [(package_name, package_links, folder_name)]
+
def isPasswordProtected(self):
if '<input type="password" name="password"' in self.html:
self.logDebug("Links are password protected")
return True
return False
+
def submitPassword(self):
# Gather data
try:
@@ -69,6 +71,7 @@ class NetfolderIn(SimpleCrypter):
return html
+
def getLinks(self):
links = re.search(r'name="list" value="(.*?)"', self.html).group(1).split(",")
self.logDebug("Package has %d links" % len(links))
diff --git a/module/plugins/crypter/OneKhDe.py b/module/plugins/crypter/OneKhDe.py
index 7a2aefe83..188a0a0ef 100644
--- a/module/plugins/crypter/OneKhDe.py
+++ b/module/plugins/crypter/OneKhDe.py
@@ -22,11 +22,13 @@ class OneKhDe(Crypter):
Crypter.__init__(self, parent)
self.parent = parent
+
def file_exists(self):
""" returns True or False
"""
return True
+
def proceed(self, url, location):
url = self.parent.url
self.html = self.load(url)
diff --git a/module/plugins/crypter/TurbobitNetFolder.py b/module/plugins/crypter/TurbobitNetFolder.py
index 390520d88..1158c5cc1 100644
--- a/module/plugins/crypter/TurbobitNetFolder.py
+++ b/module/plugins/crypter/TurbobitNetFolder.py
@@ -35,6 +35,7 @@ class TurbobitNetFolder(SimpleCrypter):
else:
return
+
def getLinks(self):
id = re.match(self.__pattern__, self.pyfile.url).group("ID")
fixurl = lambda id: "http://turbobit.net/%s.html" % id
diff --git a/module/plugins/crypter/YoutubeBatch.py b/module/plugins/crypter/YoutubeBatch.py
index e5fd83c4f..e70003ab1 100644
--- a/module/plugins/crypter/YoutubeBatch.py
+++ b/module/plugins/crypter/YoutubeBatch.py
@@ -33,6 +33,7 @@ class YoutubeBatch(Crypter):
page = self.load(url, get=req)
return json_loads(page)
+
def getChannel(self, user):
channels = self.api_response("channels", {"part": "id,snippet,contentDetails", "forUsername": user, "maxResults": "50"})
if channels['items']:
@@ -42,6 +43,7 @@ class YoutubeBatch(Crypter):
"relatedPlaylists": channel['contentDetails']['relatedPlaylists'],
"user": user} # One lone channel for user?
+
def getPlaylist(self, p_id):
playlists = self.api_response("playlists", {"part": "snippet", "id": p_id})
if playlists['items']:
@@ -51,6 +53,7 @@ class YoutubeBatch(Crypter):
"channelId": playlist['snippet']['channelId'],
"channelTitle": playlist['snippet']['channelTitle']}
+
def _getPlaylists(self, id, token=None):
req = {"part": "id", "maxResults": "50", "channelId": id}
if token:
@@ -65,9 +68,11 @@ class YoutubeBatch(Crypter):
for item in self._getPlaylists(id, playlists['nextPageToken']):
yield item
+
def getPlaylists(self, ch_id):
return map(self.getPlaylist, self._getPlaylists(ch_id))
+
def _getVideosId(self, id, token=None):
req = {"part": "contentDetails", "maxResults": "50", "playlistId": id}
if token:
@@ -82,9 +87,11 @@ class YoutubeBatch(Crypter):
for item in self._getVideosId(id, playlist['nextPageToken']):
yield item
+
def getVideosId(self, p_id):
return list(self._getVideosId(p_id))
+
def decrypt(self, pyfile):
m = re.match(self.__pattern__, pyfile.url)
m_id = m.group("ID")