refactor chan.py, update endchan, add doushio

This commit is contained in:
2019-09-08 14:42:15 -04:00
parent 175d0bebaa
commit 18247d4139
15 changed files with 679 additions and 530 deletions

18
chan/synch_json.py Normal file
View File

@@ -0,0 +1,18 @@
from chan.json import JsonChanHelper
from post_process import get_links_from_body
class SynchJsonChanHelper(JsonChanHelper):
def item_urls(self, item, board):
urls = set()
if "com" in item and item["com"]:
urls.update(get_links_from_body(item["com"]))
elif "sub" in item and item["sub"]:
urls.update(get_links_from_body(item["sub"]))
if "fsize" in item and item["fsize"]:
urls.add(self._image_url + self._image_path + item["tim"] + item["ext"])
return list(urls)