kopia lustrzana https://github.com/bellingcat/auto-archiver
logs
rodzic
cf4be2f339
commit
9159f0abd5
|
@ -101,6 +101,7 @@ class TelethonArchiver(Archiver):
|
||||||
url = item.get_url()
|
url = item.get_url()
|
||||||
# detect URLs that we definitely cannot handle
|
# detect URLs that we definitely cannot handle
|
||||||
match = self.link_pattern.search(url)
|
match = self.link_pattern.search(url)
|
||||||
|
logger.debug(f"TELETHON: {match=}")
|
||||||
if not match: return False
|
if not match: return False
|
||||||
|
|
||||||
is_private = match.group(1) == "/c"
|
is_private = match.group(1) == "/c"
|
||||||
|
@ -109,6 +110,7 @@ class TelethonArchiver(Archiver):
|
||||||
|
|
||||||
result = Metadata()
|
result = Metadata()
|
||||||
|
|
||||||
|
logger.debug(f"TELETHON STARTING")
|
||||||
# NB: not using bot_token since then private channels cannot be archived: self.client.start(bot_token=self.bot_token)
|
# NB: not using bot_token since then private channels cannot be archived: self.client.start(bot_token=self.bot_token)
|
||||||
with self.client.start():
|
with self.client.start():
|
||||||
try:
|
try:
|
||||||
|
@ -120,6 +122,7 @@ class TelethonArchiver(Archiver):
|
||||||
logger.error(f"Could not fetch telegram {url}. This error may be fixed if you setup a bot_token in addition to api_id and api_hash (but then private channels will not be archived, we need to update this logic to handle both): {e}")
|
logger.error(f"Could not fetch telegram {url}. This error may be fixed if you setup a bot_token in addition to api_id and api_hash (but then private channels will not be archived, we need to update this logic to handle both): {e}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
logger.debug(f"TELETHON GOT POST {post=}")
|
||||||
if post is None: return False
|
if post is None: return False
|
||||||
logger.info(f"fetched telegram {post.id=}")
|
logger.info(f"fetched telegram {post.id=}")
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue