Skip to content
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.
This repository has been archived by the owner on Oct 23, 2019. It is now read-only.

Exception when downloading document #102

Open
onsails opened this issue Jan 2, 2019 · 3 comments
Open

Exception when downloading document #102

onsails opened this issue Jan 2, 2019 · 3 comments

Comments

@onsails
Copy link

onsails commented Jan 2, 2019

python /Users/wb/anaconda3/bin/telegram-export --config-file config.ini
2019-01-02 14:29:43,297 - exporter - INFO - Saving to /Users/wb/tg-export
2019-01-02 14:29:43,437 - telegram_export.downloader - INFO - Getting participants...
2019-01-02 14:29:43,440 - asyncio - ERROR - Task exception was never retrieved
future: <Task finished coro=<Downloader._media_consumer() done, defined at /Users/wb/anaconda3/lib/python3.6/site-packages/telegram_export/downloader.py:305> exception=TypeError("__init__() missing 1 required positional argument: 'file_reference'",)>
Traceback (most recent call last):
  File "/Users/wb/anaconda3/lib/python3.6/site-packages/telegram_export/downloader.py", line 311, in _media_consumer
    bar)
  File "/Users/wb/anaconda3/lib/python3.6/site-packages/telegram_export/downloader.py", line 277, in _download_media
    secret=media_row[2]
TypeError: __init__() missing 1 required positional argument: 'file_reference'
2019-01-02 14:29:43,644 - telegram_export.downloader - INFO - Saved 0 new members, 0 left the chat.
2019-01-02 14:29:43,645 - telegram_export.downloader - INFO - Resuming at 1523913835 (61617)
2019-01-02 14:29:43,884 - exporter - INFO - Closing exporter
My chat: 187 messages [00:00, 414.97 messages/s]Traceback (most recent call last):█████████████████████████████████████| 7/7 [00:00<00:00, 15.71 entities/s, chat=My chat]
  File "/Users/wb/anaconda3/bin/telegram-export", line 2, in <module>
    runpy.run_module("telegram_export", run_name="__main__", alter_sys=True)
  File "/Users/wb/anaconda3/lib/python3.6/runpy.py", line 205, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/Users/wb/anaconda3/lib/python3.6/runpy.py", line 96, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "/Users/wb/anaconda3/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/Users/wb/anaconda3/lib/python3.6/site-packages/telegram_export/__main__.py", line 316, in <module>
    ret = loop.run_until_complete(main(loop)) or 0
  File "/Users/wb/anaconda3/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
    return future.result()
  File "/Users/wb/anaconda3/lib/python3.6/site-packages/telegram_export/__main__.py", line 300, in main
    await exporter.start()
  File "/Users/wb/anaconda3/lib/python3.6/site-packages/telegram_export/exporter.py", line 73, in start
    await self.downloader.start(entity)
  File "/Users/wb/anaconda3/lib/python3.6/site-packages/telegram_export/downloader.py", line 497, in start
    self._dump_messages(history.messages, target)
  File "/Users/wb/anaconda3/lib/python3.6/site-packages/telegram_export/downloader.py", line 136, in _dump_messages
    media_id = self.dumper.dump_media(m.media)
  File "/Users/wb/anaconda3/lib/python3.6/site-packages/telegram_export/dumper.py", line 539, in dump_media
    row['volume_id'] = doc.version
AttributeError: 'Document' object has no attribute 'version'
@Lonami
Copy link
Collaborator

Lonami commented Jan 2, 2019

You installed telethon==1.5 and the library only works with telethon~=1.4.3, but I believe we need to push the change to PyPi.

@lorddusk
Copy link

lorddusk commented Jan 2, 2019

Even when changing to telethon 1.4.3 I still get an error

2019-01-02 16:22:09,172 - telegram_export.downloader - INFO - Getting participants...
2019-01-02 16:22:09,580 - asyncio - ERROR - Task exception was never retrieved
future: <Task finished coro=<Downloader._media_consumer() done, defined at /usr/local/lib/python3.5/dist-packages/telegram_export/downloader.py:305> exception=OSError(22,'Invalid argument')>
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step result = coro.send(None)
File "/usr/local/lib/python3.5/dist-packages/telegram_export/downloader.py", line 311, in _media_consumer bar)
File "/usr/local/lib/python3.5/dist-packages/telegram_export/downloader.py", line 301, in _download_media progress_callback=progress
File "/home/tlan/.local/lib/python3.5/site-packages/telethon/client/downloads.py", line 212, in download_file f = open(file, 'wb')
OSError: [Errno 22] Invalid argument: '/mnt/c/Temp/Telegram/usermedia/November Sierra Delta Hotel Papa/photo/2018-10-11 19:14:52+00:00.60.jpg'

@expectocode
Copy link
Owner

Looks like the filename sanitisation bug. By the way, the Telethon version specifier is now on PyPI, so that shouldn't happen again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants