Dvach's stickers handling.
This commit is contained in:
parent
6022c9929a
commit
93e442939a
@ -36,15 +36,21 @@ class DvachParser(Parser):
|
|||||||
if not 'files' in post: return None
|
if not 'files' in post: return None
|
||||||
files = []
|
files = []
|
||||||
for f in post['files']:
|
for f in post['files']:
|
||||||
if 'sticker' in f:
|
if not 'sticker' in f:
|
||||||
continue
|
|
||||||
if match(r"^image\.\w+$", f['fullname']) is None:
|
if match(r"^image\.\w+$", f['fullname']) is None:
|
||||||
fullname = f['fullname']
|
fullname = f['fullname']
|
||||||
else:
|
else:
|
||||||
fullname = f['name']
|
fullname = f['name']
|
||||||
|
else:
|
||||||
|
fullname = f['name']
|
||||||
# Here's same thing as 4chan. 2ch.hk also has md5 field, so it is
|
# Here's same thing as 4chan. 2ch.hk also has md5 field, so it is
|
||||||
# completely fine to hardcode `hash_algo`.
|
# completely fine to hardcode `hash_algo`.
|
||||||
|
if 'md5' in f:
|
||||||
files.append(FileInfo(fullname, f['size'],
|
files.append(FileInfo(fullname, f['size'],
|
||||||
f"{self.__url_file_link}{f['path']}",
|
f"{self.__url_file_link}{f['path']}",
|
||||||
f['md5'], 'md5'))
|
f['md5'], 'md5'))
|
||||||
|
else:
|
||||||
|
files.append(FileInfo(fullname, f['size'],
|
||||||
|
f"{self.__url_file_link}{f['path']}",
|
||||||
|
None, None))
|
||||||
return files
|
return files
|
||||||
|
Loading…
Reference in New Issue
Block a user