mirror of
https://github.com/artiemis/artemis.git
synced 2026-02-14 08:31:55 +00:00
fix glens
This commit is contained in:
parent
bf41bbb0ec
commit
57281a976d
@ -10,3 +10,4 @@ disable=
|
|||||||
unspecified-encoding,
|
unspecified-encoding,
|
||||||
broad-exception-caught,
|
broad-exception-caught,
|
||||||
raise-missing-from,
|
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:
|
async def lens_impl(self, ctx: commands.Context[Artemis], url: str | None) -> str:
|
||||||
headers = {"User-Agent": self.bot.user_agent}
|
headers = {"User-Agent": self.bot.user_agent}
|
||||||
cookies = {
|
cookies = self.bot.keys.google
|
||||||
"CONSENT": "PENDING+137",
|
|
||||||
"SOCS": "CAISHAgBEhJnd3NfMjAyMzEwMTItMF9SQzQaAnBsIAEaBgiA48GpBg",
|
|
||||||
}
|
|
||||||
final_data_re = r"\"([\w-]+)\",\[\[(\[\".*?\"\])\]"
|
final_data_re = r"\"([\w-]+)\",\[\[(\[\".*?\"\])\]"
|
||||||
|
|
||||||
cur_time = utils.time("ms")
|
cur_time = utils.time("ms")
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
from .common import read_toml
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
|
from .common import read_toml
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
class Keys:
|
class Keys:
|
||||||
@ -11,6 +12,7 @@ class Keys:
|
|||||||
cloudflare: str
|
cloudflare: str
|
||||||
openai: str
|
openai: str
|
||||||
deepl: str
|
deepl: str
|
||||||
|
google: dict[str, str]
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@ -31,11 +33,11 @@ class Config:
|
|||||||
|
|
||||||
def load_config() -> Config:
|
def load_config() -> Config:
|
||||||
if os.getenv("ENV") == "production":
|
if os.getenv("ENV") == "production":
|
||||||
config = read_toml("config.prod.toml")
|
values = read_toml("config.prod.toml")
|
||||||
else:
|
else:
|
||||||
config = read_toml("config.dev.toml")
|
values = read_toml("config.dev.toml")
|
||||||
|
|
||||||
return Config(**config)
|
return Config(**values)
|
||||||
|
|
||||||
|
|
||||||
config = load_config()
|
config = load_config()
|
||||||
|
|||||||
@ -13,3 +13,6 @@ catbox = "catbox"
|
|||||||
github = "github"
|
github = "github"
|
||||||
cloudflare = "cloudflare"
|
cloudflare = "cloudflare"
|
||||||
openai = "openai"
|
openai = "openai"
|
||||||
|
|
||||||
|
# google cookies for lens API
|
||||||
|
[keys.google]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user