Skip to content

Commit

Permalink
Upgraded to Telethon 1.6.2 #30
Browse files Browse the repository at this point in the history
Fixed NoneType to any kind of InputPeer problem #29 #24
  • Loading branch information
Kosat committed Mar 23, 2019
1 parent 9309f5a commit a36f4c2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
author_email='[email protected]',
url='https://github.com/Kosat/telegram-messages-dump',
download_url='https://github.com/Kosat/telegram-messages-dump/releases',
install_requires=['telethon==0.19.1.6'],
install_requires=['telethon==1.6.2'],
packages=['telegram_messages_dump', "telegram_messages_dump.exporters"],
classifiers=[
'Environment :: Console',
Expand Down
2 changes: 1 addition & 1 deletion telegram_messages_dump/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

__version__ = '0.3.5'
__version__ = '0.4'
2 changes: 1 addition & 1 deletion telegram_messages_dump/exporters/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def extract_message_data(msg):
name = name.strip()
if not name:
name = '???'
is_sent_by_bot = sender.bot
is_sent_by_bot = getattr(sender, 'bot', None)
else:
name = '???'

Expand Down
10 changes: 3 additions & 7 deletions telegram_messages_dump/telegram_dumper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from collections import deque
from getpass import getpass
from time import sleep
from telethon import TelegramClient
from telethon import TelegramClient, sync
from telethon.errors import FloodWaitError, SessionPasswordNeededError, UsernameNotOccupiedError, UsernameInvalidError
from telethon.tl.functions.contacts import ResolveUsernameRequest
from telegram_messages_dump.utils import sprint
Expand All @@ -33,8 +33,7 @@ def __init__(self, session_user_id, settings, metadata, exporter):
super().__init__(session_user_id,
settings.api_id,
settings.api_hash,
proxy=None,
update_workers=1)
proxy=None)

# Settings as specified by user or defaults or from metadata
self.settings = settings
Expand Down Expand Up @@ -115,10 +114,7 @@ def _init_connect(self):
""" Connect to the Telegram server and Authenticate. """
sprint('Connecting to Telegram servers...')
if not self.connect():
sprint('Initial connection failed. Retrying...')
if not self.connect():
sprint('Could not connect to Telegram servers.')
return
sprint('Initial connection failed.')

# Then, ensure we're authorized and have access
if not self.is_user_authorized():
Expand Down
4 changes: 2 additions & 2 deletions travis-scripts/install.linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ echo pwd
pwd

#Build for Linux
pip install -I telethon==0.19.1.6
pip install -I telethon==1.6.2
pyinstaller -F -n telegram-messages-dump \
-c ./telegram_messages_dump/__main__.py \
--hidden-import telegram_messages_dump.exporters.text \
--hidden-import telegram_messages_dump.exporters.jsonl \
--hidden-import telegram_messages_dump.exporters.csv

#Setup build env for Windows: pyinstaller+telethon
# wine pip install -I telethon==0.19.1.6
# wine pip install -I telethon==1.6.2
# wine pip install pyinstaller
# wine pyinstaller -n telegram-messages-dump.exe --onefile --clean --win-private-assemblies -c --noconfirm --log-level=WARN ./telegram_messages_dump/__main__.py --hidden-import telegram_messages_dump.exporters.text --hidden-import telegram_messages_dump.exporters.jsonl --hidden-import telegram_messages_dump.exporters.csv

Expand Down
2 changes: 1 addition & 1 deletion travis-scripts/install.macos.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

#Install telethon:
pip3 install -I telethon==0.19.1.6
pip3 install -I telethon==1.6.2
pyinstaller -n telegram-messages-dump --noconsole --onefile \
--hidden-import telegram_messages_dump.exporters.text \
--hidden-import telegram_messages_dump.exporters.jsonl \
Expand Down

0 comments on commit a36f4c2

Please sign in to comment.