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
|
||||
files = []
|
||||
for f in post['files']:
|
||||
if 'sticker' in f:
|
||||
continue
|
||||
if match(r"^image\.\w+$", f['fullname']) is None:
|
||||
fullname = f['fullname']
|
||||
if not 'sticker' in f:
|
||||
if match(r"^image\.\w+$", f['fullname']) is None:
|
||||
fullname = f['fullname']
|
||||
else:
|
||||
fullname = f['name']
|
||||
else:
|
||||
fullname = f['name']
|
||||
# Here's same thing as 4chan. 2ch.hk also has md5 field, so it is
|
||||
# completely fine to hardcode `hash_algo`.
|
||||
files.append(FileInfo(fullname, f['size'],
|
||||
f"{self.__url_file_link}{f['path']}",
|
||||
f['md5'], 'md5'))
|
||||
if 'md5' in f:
|
||||
files.append(FileInfo(fullname, f['size'],
|
||||
f"{self.__url_file_link}{f['path']}",
|
||||
f['md5'], 'md5'))
|
||||
else:
|
||||
files.append(FileInfo(fullname, f['size'],
|
||||
f"{self.__url_file_link}{f['path']}",
|
||||
None, None))
|
||||
return files
|
||||
|
Loading…
Reference in New Issue
Block a user