fix glens

This commit is contained in:
artie 2024-11-04 17:18:01 +01:00
parent bf41bbb0ec
commit 57281a976d
4 changed files with 11 additions and 8 deletions

View File

@ -10,3 +10,4 @@ disable=
unspecified-encoding,
broad-exception-caught,
raise-missing-from,
not-a-mapping,

View File

@ -87,10 +87,7 @@ class OCR(commands.Cog):
async def lens_impl(self, ctx: commands.Context[Artemis], url: str | None) -> str:
headers = {"User-Agent": self.bot.user_agent}
cookies = {
"CONSENT": "PENDING+137",
"SOCS": "CAISHAgBEhJnd3NfMjAyMzEwMTItMF9SQzQaAnBsIAEaBgiA48GpBg",
}
cookies = self.bot.keys.google
final_data_re = r"\"([\w-]+)\",\[\[(\[\".*?\"\])\]"
cur_time = utils.time("ms")

View File

@ -1,7 +1,8 @@
import os
from .common import read_toml
from dataclasses import dataclass
from .common import read_toml
@dataclass
class Keys:
@ -11,6 +12,7 @@ class Keys:
cloudflare: str
openai: str
deepl: str
google: dict[str, str]
@dataclass
@ -31,11 +33,11 @@ class Config:
def load_config() -> Config:
if os.getenv("ENV") == "production":
config = read_toml("config.prod.toml")
values = read_toml("config.prod.toml")
else:
config = read_toml("config.dev.toml")
values = read_toml("config.dev.toml")
return Config(**config)
return Config(**values)
config = load_config()

View File

@ -13,3 +13,6 @@ catbox = "catbox"
github = "github"
cloudflare = "cloudflare"
openai = "openai"
# google cookies for lens API
[keys.google]