sub and com ->subject and comment. Fixed arguments for match function.
This commit is contained in:
parent
2043fc277f
commit
6a54b88498
@ -26,9 +26,9 @@ class DvachParser(Parser):
|
||||
@property
|
||||
def op(self) -> Optional[str]:
|
||||
op = ""
|
||||
if 'sub' in self._op_post:
|
||||
if 'subject' in self._op_post:
|
||||
op = f"{self._op_post['subject']}\n"
|
||||
if 'com' in self._op_post:
|
||||
if 'comment' in self._op_post:
|
||||
op += self._op_post['comment']
|
||||
return op if not op == "" else None
|
||||
|
||||
@ -36,7 +36,9 @@ class DvachParser(Parser):
|
||||
if not 'files' in post: return None
|
||||
files = []
|
||||
for f in post['files']:
|
||||
if match(f['fullname'], r"^image\.\w{1,4}$") is None:
|
||||
if 'sticker' in f:
|
||||
continue
|
||||
if match(r"^image\.\w+$", f['fullname']) is None:
|
||||
fullname = f['fullname']
|
||||
else:
|
||||
fullname = f['name']
|
||||
|
Loading…
Reference in New Issue
Block a user