summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter/YoutubeBatch.py
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/YoutubeBatch.py
parentSpare code cosmetics (diff)
downloadpyload-0eb6e7ec4a1144dcca824d8add049787d3da1762.tar.xz
Two space before function declaration
Diffstat (limited to 'module/plugins/crypter/YoutubeBatch.py')
-rw-r--r--module/plugins/crypter/YoutubeBatch.py7
1 files changed, 7 insertions, 0 deletions
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")