ignore video preview

pull/273/head
butaixianran 2024-01-13 22:50:46 +08:00
parent bba0b515a1
commit 7f5707c0e1
3 changed files with 9 additions and 1 deletions

View File

@ -226,6 +226,9 @@ Since v1.5.5, we've already optimized the SHA256 function to the top. So the onl
# Change Log # Change Log
## v1.9.1
* Ignore video preview from civitai
## v1.9.0 ## v1.9.0
* support civitai API key for downloading. Check document for detail * support civitai API key for downloading. Check document for detail

View File

@ -347,6 +347,11 @@ def get_preview_image_by_model_path(model_path:str, max_size_preview, skip_nsfw_
if skip_nsfw_preview: if skip_nsfw_preview:
util.printD("Skip NSFW image") util.printD("Skip NSFW image")
continue continue
preview_type = img_dict.get("type")
if preview_type != "image":
util.printD(f"Unsupported preview type: {preview_type}, ignore.")
continue
if "url" in img_dict.keys(): if "url" in img_dict.keys():
img_url = img_dict["url"] img_url = img_dict["url"]

View File

@ -6,7 +6,7 @@ import requests
import shutil import shutil
version = "1.9.0" version = "1.9.1"
def_headers = {'User-Agent': 'Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148', def_headers = {'User-Agent': 'Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
"Authorization": ""} "Authorization": ""}