feat(civitai): add url parsing to cli search tool

Extract model ID from civitai.com URLs pasted as the query argument,
matching the same behavior added to the main search module.
pull/4694/head
CalamitousFelicitousness 2026-03-20 04:33:51 +00:00
parent e7f2b63814
commit 9cf2ab08a0
1 changed files with 5 additions and 0 deletions

View File

@ -113,6 +113,11 @@ def search_civitai(
return []
t0 = time.time()
import re
url_match = re.match(r'https?://civitai\.com/models/(\d+)', query.strip())
if url_match:
query = url_match.group(1)
log.info(f'CivitAI: extracted model id={query} from URL')
dct = { 'query': query }
if len(tag) > 0:
dct['tag'] = tag