Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'content_uri' #56

Open
Hagbear opened this issue May 7, 2023 · 2 comments
Open

KeyError: 'content_uri' #56

Hagbear opened this issue May 7, 2023 · 2 comments

Comments

@Hagbear
Copy link

Hagbear commented May 7, 2023

Hi,

i tried at a new folder and delete all the old stuff, but still i get the same error, with all packs i try.
Why the script think it is already uploaded, the packs folder is empty.
I am confused, what do i wrong?

(.venv) root@xxx:/var/lib/docker/volumes/docker_stickerpicker2/_data/stickerpicker# sticker-import https://t.me/addstickers/xxx
Reuploading XXX with 35 stickers and writing output to web/packs/xxx.json
Reuploading 5481252828116680717..Traceback (most recent call last):
  File "/var/lib/docker/volumes/docker_stickerpicker2/_data/stickerpicker/.venv/lib/python3.9/site-packages/sticker/stickerimport.py", line 85, in reupload_pack
    reuploaded_documents[document.id] = already_uploaded[document.id]
KeyError: 5481252828116680717

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/docker/volumes/docker_stickerpicker2/_data/stickerpicker/.venv/bin/sticker-import", line 8, in <module>
    sys.exit(cmd())
  File "/var/lib/docker/volumes/docker_stickerpicker2/_data/stickerpicker/.venv/lib/python3.9/site-packages/sticker/stickerimport.py", line 165, in cmd
    asyncio.get_event_loop().run_until_complete(main(parser.parse_args()))
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/var/lib/docker/volumes/docker_stickerpicker2/_data/stickerpicker/.venv/lib/python3.9/site-packages/sticker/stickerimport.py", line 157, in main
    await reupload_pack(client, pack, args.output_dir)
  File "/var/lib/docker/volumes/docker_stickerpicker2/_data/stickerpicker/.venv/lib/python3.9/site-packages/sticker/stickerimport.py", line 88, in reupload_pack
    reuploaded_documents[document.id] = await reupload_document(client, document)
  File "/var/lib/docker/volumes/docker_stickerpicker2/_data/stickerpicker/.venv/lib/python3.9/site-packages/sticker/stickerimport.py", line 38, in reupload_document
    mxc = await matrix.upload(data, "image/png", f"{document.id}.png")
  File "/var/lib/docker/volumes/docker_stickerpicker2/_data/stickerpicker/.venv/lib/python3.9/site-packages/sticker/lib/matrix.py", line 90, in upload
    return (await resp.json())["content_uri"]
KeyError: 'content_uri'
@tulir
Copy link
Member

tulir commented May 7, 2023

I think that happens if media uploads on your Matrix homeserver are broken

@Hagbear
Copy link
Author

Hagbear commented May 7, 2023

right! that it was. i generate a new access token and it works great again.
thank you very much :)

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

No branches or pull requests

2 participants