MCPcopy Index your code
hub / github.com/pyload/pyload / get_info

Method get_info

module/plugins/internal/SimpleCrypter.py:89–126  ·  view source on GitHub ↗
(cls, url="", html="")

Source from the content-addressed store, hash-verified

87
88 @classmethod
89 def get_info(cls, url="", html=""):
90 info = super(SimpleCrypter, cls).get_info(url)
91
92 info.update(cls.api_info(url))
93
94 if not html and info['status'] != 2:
95 if not url:
96 info['error'] = "missing url"
97 info['status'] = 1
98
99 elif info['status'] in (3, 7):
100 try:
101 html = get_url(url, cookies=cls.COOKIES, decode=cls.TEXT_ENCODING)
102
103 except BadHeader, e:
104 info['error'] = "%d: %s" % (e.code, e.content)
105
106 except Exception:
107 pass
108
109 if html:
110 if search_pattern(cls.OFFLINE_PATTERN, html) is not None:
111 info['status'] = 1
112
113 elif search_pattern(cls.TEMP_OFFLINE_PATTERN, html) is not None:
114 info['status'] = 6
115
116 elif cls.NAME_PATTERN:
117 m = search_pattern(cls.NAME_PATTERN, html)
118 if m is not None:
119 info['status'] = 2
120 info['pattern'].update(m.groupdict())
121
122 if 'N' in info['pattern']:
123 name = replace_patterns(info['pattern']['N'], cls.NAME_REPLACEMENTS)
124 info['name'] = parse_name(name)
125
126 return info
127
128 #@TODO: Remove in 0.4.10
129 def setup_base(self):

Callers

nothing calls this directly

Calls 5

search_patternFunction · 0.85
replace_patternsFunction · 0.85
parse_nameFunction · 0.85
updateMethod · 0.45
api_infoMethod · 0.45

Tested by

no test coverage detected