summaryrefslogtreecommitdiffstats
path: root/module/plugins/crypter
diff options
context:
space:
mode:
authorGravatar Stefano <l.stickell@yahoo.it> 2013-04-16 21:00:34 +0200
committerGravatar Stefano <l.stickell@yahoo.it> 2013-04-16 21:00:34 +0200
commit75abe40812b481481fe9e2fd0bfbd7c49704b15b (patch)
treefc4c367da4544be474c315fbc8a99d3a3e753858 /module/plugins/crypter
parentMerge pull request #79 from 4Christopher/stable (diff)
parentDownloadVimeoCom: Fixed regular expression. (diff)
downloadpyload-75abe40812b481481fe9e2fd0bfbd7c49704b15b.tar.xz
Merge pull request #84 from 4Christopher/stable-DownloadVimeoCom
Wrote DownloadVimeoCom.
Diffstat (limited to 'module/plugins/crypter')
-rw-r--r--module/plugins/crypter/DownloadVimeoCom.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/module/plugins/crypter/DownloadVimeoCom.py b/module/plugins/crypter/DownloadVimeoCom.py
new file mode 100644
index 000000000..88310915b
--- /dev/null
+++ b/module/plugins/crypter/DownloadVimeoCom.py
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+import re
+import HTMLParser
+from module.plugins.Crypter import Crypter
+
+class DownloadVimeoCom(Crypter):
+ __name__ = 'DownloadVimeoCom'
+ __type__ = 'crypter'
+ __pattern__ = r'(?:http://vimeo\.com/\d*|http://smotri\.com/video/view/\?id=.*)'
+ ## The download from dailymotion failed with a 403
+ __version__ = '0.1'
+ __description__ = """Video Download Plugin based on downloadvimeo.com"""
+ __author_name__ = ('4Christopher')
+ __author_mail__ = ('4Christopher@gmx.de')
+ BASE_URL = 'http://downloadvimeo.com'
+
+ def decrypt(self, pyfile):
+ self.package = pyfile.package()
+ html = self.load('%s/generate?url=%s' % (self.BASE_URL, pyfile.url))
+ h = HTMLParser.HTMLParser()
+ try:
+ f = re.search(r'cmd quality="(?P<quality>[^"]+?)">\s*?(?P<URL>[^<]*?)</cmd>', html)
+ except:
+ self.logDebug('Failed to find the URL')
+ else:
+ url = h.unescape(f.group('URL'))
+ self.logDebug('Quality: %s, URL: %s' % (f.group('quality'), url))
+ self.packages.append((self.package.name, [url], self.package.folder))