laggykiller / sticker-convert

Convert (animated) stickers to/from WhatsApp, Telegram, Signal, Line, Kakao, Viber, Discord, iMessage. Written in Python.
GNU General Public License v2.0
286 stars 16 forks source link

Exception/TypeError when trying to convert Telegram Stickers to Signal #141

Closed jmbreuer closed 6 months ago

jmbreuer commented 6 months ago

I'm trying to convert this sticker pack: https://t.me/addstickers/cupiman

Downloading/opening the Telegram sticker pack fails with:

Skip moving old files in input directory as input source is empty
Moving old files in output directory to /home/jmbreuer/tmp/stickers_output/archive_2024-07-04_23-21-24
Downloading...
##### EXCEPTION #####
Function: <function DownloadTelegram.start at 0x7f50cff7a3e0>
Arguments: ['https://t.me/addstickers/cupiman', PosixPath('/home/jmbreuer/tmp/stickers_input'), 'CredOption(REDACTED)']
Traceback (most recent call last):
  File "/home/jmbreuer/.local/share/virtualenvs/sticker-convert-ZmNzh-O_/lib/python3.11/site-packages/sticker_convert/job.py", line 118, in worker
    results = work_func(*work_args, cb_queue, cb_return)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jmbreuer/.local/share/virtualenvs/sticker-convert-ZmNzh-O_/lib/python3.11/site-packages/sticker_convert/downloaders/download_telegram.py", line 130, in start
    return downloader.download_stickers_telegram()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jmbreuer/.local/share/virtualenvs/sticker-convert-ZmNzh-O_/lib/python3.11/site-packages/sticker_convert/downloaders/download_telegram.py", line 38, in download_stickers_telegram
    return anyio.run(self.save_stickers)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jmbreuer/.local/share/virtualenvs/sticker-convert-ZmNzh-O_/lib/python3.11/site-packages/anyio/_core/_eventloop.py", line 68, in run
    return asynclib.run(func, *args, **backend_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jmbreuer/.local/share/virtualenvs/sticker-convert-ZmNzh-O_/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 204, in run
    return native_run(wrapper(), debug=debug)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/jmbreuer/.local/share/virtualenvs/sticker-convert-ZmNzh-O_/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 199, in wrapper
    return await func(*args)
           ^^^^^^^^^^^^^^^^^
  File "/home/jmbreuer/.local/share/virtualenvs/sticker-convert-ZmNzh-O_/lib/python3.11/site-packages/sticker_convert/downloaders/download_telegram.py", line 57, in save_stickers
    sticker_set: StickerSet = await bot.get_sticker_set(
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jmbreuer/.local/share/virtualenvs/sticker-convert-ZmNzh-O_/lib/python3.11/site-packages/telegram/ext/_extbot.py", line 1753, in get_sticker_set
    return await super().get_sticker_set(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jmbreuer/.local/share/virtualenvs/sticker-convert-ZmNzh-O_/lib/python3.11/site-packages/telegram/_bot.py", line 394, in decorator
    result = await func(self, *args, **kwargs)  # skipcq: PYL-E1102
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jmbreuer/.local/share/virtualenvs/sticker-convert-ZmNzh-O_/lib/python3.11/site-packages/telegram/_bot.py", line 5431, in get_sticker_set
    return StickerSet.de_json(result, self)  # type: ignore[return-value]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jmbreuer/.local/share/virtualenvs/sticker-convert-ZmNzh-O_/lib/python3.11/site-packages/telegram/_files/sticker.py", line 329, in de_json
    return super()._de_json(data=data, bot=bot, api_kwargs=api_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jmbreuer/.local/share/virtualenvs/sticker-convert-ZmNzh-O_/lib/python3.11/site-packages/telegram/_telegramobject.py", line 463, in _de_json
    raise exc
  File "/home/jmbreuer/.local/share/virtualenvs/sticker-convert-ZmNzh-O_/lib/python3.11/site-packages/telegram/_telegramobject.py", line 460, in _de_json
    obj = cls(**data, api_kwargs=api_kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: StickerSet.__init__() missing 2 required positional arguments: 'is_animated' and 'is_video'
#####################
No files to compress
Exporting...
An error occured while exporting stickers
An error occured during this run.
laggykiller commented 6 months ago

You need to wait for upstream

https://github.com/laggykiller/sticker-convert/issues/140

laggykiller commented 6 months ago

Problem fixed, try 2.8.4