mirror of
https://github.com/simon987/chan_feed.git
synced 2025-04-10 14:06:42 +00:00
18 lines
573 B
Python
18 lines
573 B
Python
from chan.json import JsonChanHelper
|
|
from post_process import get_links_from_body
|
|
|
|
|
|
class AlokalJsonChanHelper(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"] + "/" + str(item["no"]) + item["ext"])
|
|
|
|
return list(urls)
|