mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-08 21:30:01 +08:00
Update data_source.py
This commit is contained in:
@@ -117,10 +117,15 @@ async def search_online_setu(url: str):
|
|||||||
return '\n图片被小怪兽恰掉啦..!QAQ', -1
|
return '\n图片被小怪兽恰掉啦..!QAQ', -1
|
||||||
|
|
||||||
|
|
||||||
def get_setu(index: str, setu_data: dict, tag: str = None):
|
def get_setu(index: str, setu_data: dict, num: int = 1, tag: str = None, r18: bool = False):
|
||||||
if not os.path.exists(IMAGE_PATH + path):
|
if r18:
|
||||||
os.mkdir(IMAGE_PATH + path)
|
if not os.path.exists(IMAGE_PATH + '_r18'):
|
||||||
length = len(os.listdir(IMAGE_PATH + path))
|
os.mkdir(IMAGE_PATH + '_r18')
|
||||||
|
length = len(os.listdir(IMAGE_PATH + '_r18'))
|
||||||
|
else:
|
||||||
|
if not os.path.exists(IMAGE_PATH + path):
|
||||||
|
os.mkdir(IMAGE_PATH + path)
|
||||||
|
length = len(os.listdir(IMAGE_PATH + path))
|
||||||
if length == 0:
|
if length == 0:
|
||||||
return None, None
|
return None, None
|
||||||
if not index:
|
if not index:
|
||||||
|
|||||||
Reference in New Issue
Block a user