1
0
Fork 0

sub and com ->subject and comment. Fixed arguments for match function.

This commit is contained in:
Alexander Andreev 2020-11-18 23:43:43 +04:00
parent 2043fc277f
commit 6a54b88498
1 changed files with 5 additions and 3 deletions

View File

@ -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']