stickerpicker icon indicating copy to clipboard operation
stickerpicker copied to clipboard

error while importing from telegram

Open lagemeet opened this issue 3 years ago • 7 comments

While importing any stickerpack i got this

Reuploading 1179969546484711763..Traceback (most recent call last):
  File "/home/lagemeet/stickerpicker/.venv/lib/python3.7/site-packages/sticker/stickerimport.py", line 85, in reupload_pack
    reuploaded_documents[document.id] = already_uploaded[document.id]
KeyError: 1179969546484711763

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/lagemeet/stickerpicker/.venv/bin/sticker-import", line 8, in <module>
    sys.exit(cmd())
  File "/home/lagemeet/stickerpicker/.venv/lib/python3.7/site-packages/sticker/stickerimport.py", line 164, in cmd
    asyncio.get_event_loop().run_until_complete(main(parser.parse_args()))
  File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File "/home/lagemeet/stickerpicker/.venv/lib/python3.7/site-packages/sticker/stickerimport.py", line 156, in main
    await reupload_pack(client, pack, args.output_dir)
  File "/home/lagemeet/stickerpicker/.venv/lib/python3.7/site-packages/sticker/stickerimport.py", line 88, in reupload_pack
    reuploaded_documents[document.id] = await reupload_document(client, document)
  File "/home/lagemeet/stickerpicker/.venv/lib/python3.7/site-packages/sticker/stickerimport.py", line 38, in reupload_document
    mxc = await matrix.upload(data, "image/png", f"{document.id}.png")
  File "/home/lagemeet/stickerpicker/.venv/lib/python3.7/site-packages/sticker/lib/matrix.py", line 89, in upload
    return (await resp.json())["content_uri"]
KeyError: 'content_uri'

lagemeet avatar Jun 21 '21 13:06 lagemeet

I have the same error. Did telegram change their APIs?

zoenglinghou avatar Jul 05 '21 11:07 zoenglinghou

Any updates on this issue? It still persists.

tatsumoto-ren avatar Jul 27 '21 22:07 tatsumoto-ren

That error means your homeserver's media repo is broken (e.g. the homeserver URL you entered doesn't route media requests correctly)

tulir avatar Jul 28 '21 06:07 tulir

same error came up for me, when i did not provide the full URL (including "https://") but just the domain name.

bendschs avatar Jul 28 '21 07:07 bendschs

That error means your homeserver's media repo is broken (e.g. the homeserver URL you entered doesn't route media requests correctly)

Thanks. After I switched to another homeserver, the error disappeared.

tatsumoto-ren avatar Jul 28 '21 13:07 tatsumoto-ren

I solved this by replacing the auth token in config.json

TheRealKingS avatar May 12 '22 19:05 TheRealKingS

I had the same issue. Refreshing the auth token (with a sign-out + sign-in) fixed this.

mohsenasm avatar Jan 19 '23 21:01 mohsenasm