mirror of
https://github.com/simon987/chan_feed.git
synced 2025-12-14 13:09:01 +00:00
refactor chan.py, update endchan, add doushio
This commit is contained in:
18
chan/synch_json.py
Normal file
18
chan/synch_json.py
Normal 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)
|
||||
|
||||
Reference in New Issue
Block a user