forked from pyload/pyload
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatafileComFolder.py
More file actions
39 lines (28 loc) · 1.24 KB
/
DatafileComFolder.py
File metadata and controls
39 lines (28 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-
import re
from ..internal.Crypter import Crypter
class DatafileComFolder(Crypter):
__name__ = "DatafileComFolder"
__type__ = "crypter"
__version__ = "0.02"
__status__ = "testing"
__pattern__ = r'https?://(?:www\.)?datafile\.com/f/\w{12}'
__config__ = [("activated", "bool", "Activated", True),
("use_premium", "bool", "Use premium account if available", True),
("folder_per_package", "Default;Yes;No",
"Create folder for each package", "Default"),
("max_wait", "int", "Reconnect if waiting time is greater than minutes", 10)]
__description__ = """datafile.com decrypter plugin"""
__license__ = "GPLv3"
__authors__ = [("GammaC0de", "nitzo2001[AT]yahoo[DOT]com")]
LINK_PATTERN = r'https?://(?:www\.)?datafile\.com/d/\w{17}'
NAME_PATTERN = r'<div class="file-name">(?P<N>.+?)<'
def decrypt(self, pyfile):
self.data = self.load(pyfile.url)
links = re.findall(self.LINK_PATTERN, self.data)
m = re.search(self.NAME_PATTERN, self.data)
if m is not None:
name = m.group('N')
self.packages.append((name, links, name))
else:
self.links.extend(links)