mirror of
https://github.com/apachecn/epub-crawler.git
synced 2025-06-07 10:01:11 +00:00
2022-03-15 23:44:44
This commit is contained in:
parent
f71ff1337c
commit
5f30e1c910
@ -107,6 +107,7 @@ def tr_download_page(url, art, imgs):
|
|||||||
art.update(get_article(html, url))
|
art.update(get_article(html, url))
|
||||||
save_article(hash, art)
|
save_article(hash, art)
|
||||||
else:
|
else:
|
||||||
|
print(f'{url} 已存在于本地缓存中')
|
||||||
art.update(cache)
|
art.update(cache)
|
||||||
art['content'] = process_img(
|
art['content'] = process_img(
|
||||||
art['content'], imgs,
|
art['content'], imgs,
|
||||||
|
@ -47,6 +47,7 @@ def tr_download_img(url, imgs, picname):
|
|||||||
data = opti_img(data, config['optiMode'], config['colors']) or b''
|
data = opti_img(data, config['optiMode'], config['colors']) or b''
|
||||||
save_img(hash, config['optiMode'], data)
|
save_img(hash, config['optiMode'], data)
|
||||||
else:
|
else:
|
||||||
|
print(f'{url} 已存在于本地缓存中')
|
||||||
data = cache
|
data = cache
|
||||||
imgs[picname] = data
|
imgs[picname] = data
|
||||||
time.sleep(config['wait'])
|
time.sleep(config['wait'])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user