diff options
Diffstat (limited to 'module/plugins/hoster/DailymotionCom.py')
-rw-r--r-- | module/plugins/hoster/DailymotionCom.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/module/plugins/hoster/DailymotionCom.py b/module/plugins/hoster/DailymotionCom.py index f9cc0d28e..18f84ff56 100644 --- a/module/plugins/hoster/DailymotionCom.py +++ b/module/plugins/hoster/DailymotionCom.py @@ -8,7 +8,7 @@ from module.network.RequestFactory import getURL from module.plugins.internal.Hoster import Hoster -def getInfo(urls): +def get_info(urls): result = [] regex = re.compile(DailymotionCom.__pattern__) apiurl = "https://api.dailymotion.com/video/%s" @@ -40,7 +40,7 @@ def getInfo(urls): class DailymotionCom(Hoster): __name__ = "DailymotionCom" __type__ = "hoster" - __version__ = "0.21" + __version__ = "0.22" __pattern__ = r'https?://(?:www\.)?dailymotion\.com/.*video/(?P<ID>[\w^_]+)' __config__ = [("quality", "Lowest;LD 144p;LD 240p;SD 384p;HQ 480p;HD 720p;HD 1080p;Highest", "Quality", "Highest")] @@ -51,11 +51,11 @@ class DailymotionCom(Hoster): def setup(self): - self.resumeDownload = True - self.multiDL = True + self.resume_download = True + self.multi_dl = True - def getStreams(self): + def get_streams(self): streams = [] for result in re.finditer(r"\"(?P<URL>http:\\/\\/www.dailymotion.com\\/cdn\\/H264-(?P<QF>.*?)\\.*?)\"", @@ -71,8 +71,8 @@ class DailymotionCom(Hoster): return sorted(streams, key=lambda x: x[0][::-1]) - def getQuality(self): - q = self.getConfig('quality') + def get_quality(self): + q = self.get_config('quality') if q == "Lowest": quality = 0 @@ -84,7 +84,7 @@ class DailymotionCom(Hoster): return quality - def getLink(self, streams, quality): + def get_link(self, streams, quality): if quality > 0: for x, s in [item for item in enumerate(streams)][::-1]: qf = s[0][1] @@ -98,28 +98,28 @@ class DailymotionCom(Hoster): s = streams[idx] - self.logInfo(_("Download video quality %sx%s") % s[0]) + self.log_info(_("Download video quality %sx%s") % s[0]) return s[1] - def checkInfo(self, pyfile): - pyfile.name, pyfile.size, pyfile.status, pyfile.url = getInfo([pyfile.url])[0] + def check_info(self, pyfile): + pyfile.name, pyfile.size, pyfile.status, pyfile.url = get_info([pyfile.url])[0] if pyfile.status == 1: self.offline() elif pyfile.status == 6: - self.tempOffline() + self.temp_offline() def process(self, pyfile): - self.checkInfo(pyfile) + self.check_info(pyfile) id = re.match(self.__pattern__, pyfile.url).group('ID') self.html = self.load("http://www.dailymotion.com/embed/video/" + id) - streams = self.getStreams() - quality = self.getQuality() + streams = self.get_streams() + quality = self.get_quality() - self.download(self.getLink(streams, quality)) + self.download(self.get_link(streams, quality)) |