summaryrefslogtreecommitdiffstats
path: root/you
diff options
context:
space:
mode:
authort.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-27 20:26:36 +0200
committert.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-27 20:26:36 +0200
commit011d0babc265acfe35927c898a276ce8b9a261f3 (patch)
treedce934fe1153ec116a863baeca89a1ca590ab9bf /you
parentMerge branch 'main' of https://github.com/xtekky/gpt4free (diff)
downloadgpt4free-011d0babc265acfe35927c898a276ce8b9a261f3.tar
gpt4free-011d0babc265acfe35927c898a276ce8b9a261f3.tar.gz
gpt4free-011d0babc265acfe35927c898a276ce8b9a261f3.tar.bz2
gpt4free-011d0babc265acfe35927c898a276ce8b9a261f3.tar.lz
gpt4free-011d0babc265acfe35927c898a276ce8b9a261f3.tar.xz
gpt4free-011d0babc265acfe35927c898a276ce8b9a261f3.tar.zst
gpt4free-011d0babc265acfe35927c898a276ce8b9a261f3.zip
Diffstat (limited to 'you')
-rw-r--r--you/__init__.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/you/__init__.py b/you/__init__.py
index 6925e79f..8bf31f0d 100644
--- a/you/__init__.py
+++ b/you/__init__.py
@@ -57,8 +57,7 @@ class Completion:
r'(?<=event: youChatSerpResults\ndata:)(.*\n)*?(?=event: )', response.text
).group()
third_party_search_results = re.search(
- r'(?<=event: thirdPartySearchResults\ndata:)(.*\n)*?(?=event: )', response.text
- ).group()
+ r'(?<=event: thirdPartySearchResults\ndata:)(.*\n)*?(?=event: )', response.text).group()
# slots = findall(r"slots\ndata: (.*)\n\nevent", response.text)[0]
text = ''.join(re.findall(r'{\"youChatToken\": \"(.*?)\"}', response.text))
@@ -69,7 +68,7 @@ class Completion:
}
return {
- 'response': text.replace('\\n', '\n').replace('\\\\', '\\'),
+ 'response': text.replace('\\n', '\n').replace('\\\\', '\\').replace('\\"', '"'),
'links': loads(third_party_search_results)['search']['third_party_search_results']
if include_links
else None,