mirror of
https://github.com/artiemis/artemis.git
synced 2026-02-14 00:21:56 +00:00
fix glens
This commit is contained in:
parent
bf41bbb0ec
commit
57281a976d
@ -10,3 +10,4 @@ disable=
|
||||
unspecified-encoding,
|
||||
broad-exception-caught,
|
||||
raise-missing-from,
|
||||
not-a-mapping,
|
||||
|
||||
@ -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")
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -13,3 +13,6 @@ catbox = "catbox"
|
||||
github = "github"
|
||||
cloudflare = "cloudflare"
|
||||
openai = "openai"
|
||||
|
||||
# google cookies for lens API
|
||||
[keys.google]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user