diff options
-rw-r--r-- | module/plugins/hoster/VkCom.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/module/plugins/hoster/VkCom.py b/module/plugins/hoster/VkCom.py new file mode 100644 index 000000000..8237e7536 --- /dev/null +++ b/module/plugins/hoster/VkCom.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# +# Test links: +# http://vk.com/video_ext.php?oid=166335015&id=162608895&hash=b55affa83774504b&hd=1 + +import re + +from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo + + +class VkCom(SimpleHoster): + __name__ = "VkCom" + __type__ = "hoster" + __version__ = "0.01" + + __pattern__ = r"https?://(?:www\.)?vk\.com/video_ext\.php/\?.+" + __config__ = [("quality", "Low;High;Auto", "Quality", "Auto")] + + __description__ = """Vk.com hoster plugin""" + __license__ = "GPLv3" + __authors__ = [("Walter Purcaro", "vuolter@gmail.com")] + + + NAME_PATTERN = r'"md_title":"(?P<N>.+?)"' + OFFLINE_PATTERN = r'<div id="video_ext_msg">' + + LINK_FREE_PATTERN = r'url\d+":"(.+?)"' + + + def handleFree(self, pyfile): + self.link = re.findall(self.LINK_FREE_PATTERN, self.html)[0 if self.getConfig('quality') is "Low" else -1] + + +getInfo = create_getInfo(VkCom) |