summaryrefslogtreecommitdiffstats
path: root/module/plugins/hoster
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-05 16:31:44 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-05 16:31:44 +0200
commit389e5bd208feb97f4faca9cfd4bc0f037efc32d9 (patch)
tree8dddee3c09fdeb58202feeea7e0a4835a5a65c55 /module/plugins/hoster
parentCleaned ShareLinksBiz pattern + better if-check for RSDF plugin (diff)
downloadpyload-389e5bd208feb97f4faca9cfd4bc0f037efc32d9.tar.xz
[VeohCom] Auto quality detection
Diffstat (limited to 'module/plugins/hoster')
-rw-r--r--module/plugins/hoster/VeohCom.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/module/plugins/hoster/VeohCom.py b/module/plugins/hoster/VeohCom.py
index c1ebffb81..15d7a98b0 100644
--- a/module/plugins/hoster/VeohCom.py
+++ b/module/plugins/hoster/VeohCom.py
@@ -23,8 +23,8 @@ class VeohCom(SimpleHoster):
__name__ = "VeohCom"
__type__ = "hoster"
__pattern__ = r'http://(?:www\.)?veoh\.com/(tv/)?(watch|videos)/(?P<ID>v\w+)'
- __version__ = "0.1"
- __config__ = [("quality", "Low;High", "Quality", "High")]
+ __version__ = "0.2"
+ __config__ = [("quality", "Low;High;Auto", "Quality", "Auto")]
__description__ = """Veoh.com hoster plugin"""
__author_name__ = "Walter Purcaro"
__author_mail__ = "vuolter@gmail.com"
@@ -41,16 +41,22 @@ class VeohCom(SimpleHoster):
self.chunkLimit = -1
def handleFree(self):
- q = self.getConfig("quality")
- pattern = r'"fullPreviewHash%sPath":"(.+?)"' % q
- found = re.search(pattern, self.html)
- if found:
- self.pyfile.name += ".mp4"
- link = found.group(1).replace("\\", "")
- self.logDebug("Download link: " + link)
- self.download(link)
+ quality = self.getConfig("quality")
+ if quality == "Auto":
+ quality = ("High", "Low")
+ for q in quality:
+ pattern = r'"fullPreviewHash%sPath":"(.+?)"' % q
+ found = re.search(pattern, self.html)
+ if found:
+ self.pyfile.name += ".mp4"
+ link = found.group(1).replace("\\", "")
+ self.logDebug("Download link: " + link)
+ self.download(link)
+ return
+ else:
+ self.logInfo("No %s quality video found" % q.upper())
else:
- self.fail("No %s quality video found" % q.lower())
+ self.fail("No video found!")
getInfo = create_getInfo(VeohCom)