maunium / stickerpicker

A fast and simple Matrix sticker picker widget
GNU Affero General Public License v3.0
312 stars 592 forks source link

TypeError: __init__() missing 1 required positional argument: 'hash' #51

Closed Kitanit closed 1 year ago

Kitanit commented 1 year ago

image

Candinya commented 1 year ago

This works for me image

@@ -153,7 +153,7 @@ async def main(args: argparse.Namespace) -> None:
                 return
             input_packs.append(InputStickerSetShortName(short_name=match.group(1)))
         for input_pack in input_packs:
-            pack: StickerSetFull = await client(GetStickerSetRequest(input_pack))
+            pack: StickerSetFull = await client(GetStickerSetRequest(input_pack, hash=0))
             await reupload_pack(client, pack, args.output_dir)
     else:
         parser.print_help()
Kitanit commented 1 year ago
pack: StickerSetFull = await client(GetStickerSetRequest(input_pack, hash=0))

strange

image

Candinya commented 1 year ago

did u rebuild the pack ( like pip install . ) after modifying codes 👀

Kitanit commented 1 year ago

did u rebuild the pack ( like pip install . ) after modifying codes eyes

Yes thanks that solved half the problem, but for some reason even after a completely fresh installation on another server, where there is definitely no sticker, a critical error comes up

image

Candinya commented 1 year ago

KeyError: 'content_uri'

I fixed this by using a new matrix access token in config.json, the old one is just somehow invalid

Kitanit commented 1 year ago

KeyError: 'content_uri'

I fixed this by using a new matrix access token in config.json, the old one is just somehow invalid

strange still a URL error

Hagbear commented 1 year ago

hi, i get a similar error, also after the fix with hash=0

Traceback (most recent call last): File "/var/lib/docker/volumes/docker_stickerpicker/_data/stickerpicker/.venv/bin/sticker-import", line 8, in <module> sys.exit(cmd()) File "/var/lib/docker/volumes/docker_stickerpicker/_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_stickerpicker/_data/stickerpicker/.venv/lib/python3.9/site-packages/sticker/stickerimport.py", line 156, in main pack: StickerSetFull = await client(GetStickerSetRequest(input_pack, hash=0)) TypeError: __init__() got an unexpected keyword argument 'hash'

tulir commented 1 year ago

You probably need to update telethon

Hagbear commented 1 year ago

in my venv enviroment pip install 1.24.0. Is this to old? how can in update? if i delete the venv folder pip create a new one with the same version in it. maybe it is possible to run the python part of stickerpicker in a docker container so it is independent from my docker host.

Bandie commented 1 year ago

Hey,

pip install --upgrade telethon worked for me.

@Hagbear

Hagbear commented 1 year ago

thank you :)

but unfortunately this has only brought me a small step forward. i get a new error now :/

Reuploading 5330259718067719239..Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/sticker/stickerimport.py", line 85, in reupload_pack reuploaded_documents[document.id] = already_uploaded[document.id] KeyError: 5330259718067719239