Removed dots from logs
This commit is contained in:
parent
1e52155255
commit
62ad0c1607
@ -51,7 +51,7 @@ async def extract_html_from_chatgpt_response(returned_string: str) -> Union[str,
|
|||||||
except Exception:
|
except Exception:
|
||||||
match = returned_string.split("<html>")
|
match = returned_string.split("<html>")
|
||||||
if len(match) > 1:
|
if len(match) > 1:
|
||||||
logging.info("No valid HTML found, trying to parse...")
|
logging.info("No valid HTML found, trying to parse")
|
||||||
html = "<html>" + match[1]
|
html = "<html>" + match[1]
|
||||||
html_match = html.split("</html>")
|
html_match = html.split("</html>")
|
||||||
possible_html = html_match[0] + "</html>"
|
possible_html = html_match[0] + "</html>"
|
||||||
@ -86,7 +86,7 @@ async def get_random_topic() -> str:
|
|||||||
topics = completion.choices[0].message.content.split(",")
|
topics = completion.choices[0].message.content.split(",")
|
||||||
|
|
||||||
if len(topics) < 5:
|
if len(topics) < 5:
|
||||||
logging.info(f"The topics is too short: {topics}. Retrying...")
|
logging.info(f"The topics is too short: {topics}. Retrying")
|
||||||
return await get_random_topic()
|
return await get_random_topic()
|
||||||
|
|
||||||
logging.info(f"The topics list is: {topics}")
|
logging.info(f"The topics list is: {topics}")
|
||||||
@ -181,7 +181,7 @@ async def get_chatgpt_html_response(topic: str = None, count: int = 0) -> str:
|
|||||||
html = await extract_html_from_chatgpt_response(response)
|
html = await extract_html_from_chatgpt_response(response)
|
||||||
|
|
||||||
if not html:
|
if not html:
|
||||||
logging.info(f"No HTML was found. The response was {response}. Retrying...")
|
logging.info(f"No HTML was found. The response was {response}. Retrying")
|
||||||
return await get_chatgpt_html_response(topic, count)
|
return await get_chatgpt_html_response(topic, count)
|
||||||
|
|
||||||
pattern = r'src="([^"]*)"'
|
pattern = r'src="([^"]*)"'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user