mirror of
https://github.com/FujiwaraChoki/MoneyPrinter.git
synced 2024-10-04 03:27:11 +03:00
Fix keywords parsing of Pexels video finding (#258)
Fix to keep bracket squares for Json parsing.
This commit is contained in:
parent
d066b70972
commit
6c99d1398a
@ -209,7 +209,7 @@ def get_search_terms(video_subject: str, amount: int, script: str, ai_model: str
|
||||
|
||||
except (json.JSONDecodeError, ValueError):
|
||||
# Get everything between the first and last square brackets
|
||||
response = response[response.find("[") + 1:response.rfind("]")]
|
||||
response = response[response.find("["):response.rfind("]") + 1]
|
||||
|
||||
print(colored("[*] GPT returned an unformatted response. Attempting to clean...", "yellow"))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user