kopia lustrzana https://github.com/bellingcat/auto-archiver
adds session_file for missing archivers
rodzic
889eb1d270
commit
629cd586db
|
@ -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
|
||||
|
|
|
@ -7,3 +7,4 @@ class TelethonConfig:
|
|||
api_id: str
|
||||
api_hash: str
|
||||
bot_token: str
|
||||
session_file: str
|
||||
|
|
|
@ -6,3 +6,4 @@ from dataclasses import dataclass
|
|||
class VkConfig:
|
||||
username: str
|
||||
password: str
|
||||
session_file: str
|
||||
|
|
|
@ -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:
|
||||
|
|
Ładowanie…
Reference in New Issue