adds session_file for missing archivers

pull/72/head
msramalho 2022-11-08 13:59:09 +00:00
rodzic 889eb1d270
commit 629cd586db
4 zmienionych plików z 11 dodań i 2 usunięć

Wyświetl plik

@ -34,6 +34,7 @@ class Config:
def __init__(self):
self.parser = self.get_argument_parser()
self.folder = ""
self.is_docker = bool(os.environ.get("IS_DOCKER", 0))
def parse(self):
self.args = self.parser.parse_args()
@ -152,7 +153,8 @@ class Config:
self.telegram_config = TelethonConfig(
api_id=secrets["telegram"]["api_id"],
api_hash=secrets["telegram"]["api_hash"],
bot_token=secrets["telegram"].get("bot_token", None)
bot_token=secrets["telegram"].get("bot_token", None),
session_file=secrets["telegram"].get("session_file", "./anon")
)
else:
self.telegram_config = None
@ -175,7 +177,8 @@ class Config:
if "vk" in secrets:
self.vk_config = VkConfig(
username=secrets["vk"]["username"],
password=secrets["vk"]["password"]
password=secrets["vk"]["password"],
session_file=secrets["vk"].get("session_file", "./vk_config.v2.json")
)
else:
self.vk_config = None

Wyświetl plik

@ -7,3 +7,4 @@ class TelethonConfig:
api_id: str
api_hash: str
bot_token: str
session_file: str

Wyświetl plik

@ -6,3 +6,4 @@ from dataclasses import dataclass
class VkConfig:
username: str
password: str
session_file: str

Wyświetl plik

@ -50,6 +50,8 @@ secrets:
api_hash: your API hash
# optional, but allows access to more content such as large videos, talk to @botfather
bot_token: your bot-token
# optional, defaults to ./anon, records the telegram login session for future usage
session_file: "secrets/anon"
# twitter configuration - API V2 only
# if you don't provide credentials the less-effective unofficial TwitterArchiver will be used instead
@ -66,6 +68,8 @@ secrets:
vk:
username: "phone number or email"
password: "password"
# optional, defaults to ./vk_config.v2.json, records VK login session for future usage
session_file: "secrets/vk_config.v2.json"
# instagram credentials
instagram: