Skip to content
This repository was archived by the owner on Oct 23, 2019. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5fef92c

Browse files
author
Juan Velasco
committedMar 10, 2019
Updates TE to handle ChannelPrivateError.
1 parent ea59a9e commit 5fef92c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎telegram_export/downloader.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import tqdm
1111
from telethon import utils
12-
from telethon.errors import ChatAdminRequiredError
12+
from telethon.errors import ChatAdminRequiredError, ChannelPrivateError
1313
from telethon.tl import types, functions
1414

1515
from . import utils as export_utils
@@ -401,7 +401,10 @@ async def start(self, target_id):
401401
self._running = True
402402
self._incomplete_download = None
403403
target_in = await self.client.get_input_entity(target_id)
404-
target = await self.client.get_entity(target_in)
404+
try:
405+
target = await self.client.get_entity(target_in)
406+
except ChannelPrivateError:
407+
__log__.info('Entity is a private channel. Continue download.')
405408
target_id = utils.get_peer_id(target)
406409

407410
found = self.dumper.get_message_count(target_id)

0 commit comments

Comments
 (0)
This repository has been archived.