lasscat / namemcpy

Namemc api wrapper made in python
MIT License
14 stars 4 forks source link

"ValueError: list.remove(x): x not in list" #6

Closed m42km closed 3 years ago

m42km commented 3 years ago

  File ".........", line 343, in _run_event

    await coro(*args, **kwargs)
  File "....\main.py", line 51, in on_message
    skin = api.playerSkins(username=message.content.split()[2])
  File "..........\namemc.py", line 286, in playerSkins
    skin_hash_list.remove('javascript:void(0)') # just have to get rid of something that stays in the code idk y
ValueError: list.remove(x): x not in list

Please help, I tried fixing the issue myself but nothing really worked.

lasscat commented 3 years ago

I'll look into it.

lasscat commented 3 years ago

Question, can you give me the code you were using in that segment so I can see what caused the issue.

m42km commented 3 years ago

Question, can you give me the code you were using in that segment so I can see what caused the issue.

Unfortunately I can't really show much of my code since I am using a new API now, but I did add api = namemc.namepy() to the beginning of my code and message.content.split()[2] was a valid Minecraft username.

m42km commented 3 years ago

I'm pretty sure the issue resides in where you try removing javascript:void(0) from skin_hash_list, but it's actually not always there. Also noticed it only worked with my skin and no one else's?

lasscat commented 3 years ago

Ok I found that this issue occurs when the player has many amount of skins

lasscat commented 3 years ago

When a player has a large amount of skins it will not display the javascript error I will fix this

lasscat commented 3 years ago

Fixed will be rolling out the update!

lasscat commented 3 years ago

Fixed

m42km commented 3 years ago

Thank you! I was really confused why it only worked on my skin, lol

lasscat commented 3 years ago

Sadly there is an bug where it does not show all the skins if you have a large amount of skins currently I will have to fix.

lasscat commented 3 years ago

Its probably the scraping as when you do it, it does not show all the skins but I know of a fix on how I can fix this

m42km commented 3 years ago

May I ask why you have to scrape it and not get it directly from the API? After all this is an API wrapper

lasscat commented 3 years ago

Sadly, namemc or mojang api does not offer these features with there api so I have to resort to scraping.

m42km commented 3 years ago

Alright, I guess that's understandable.

lasscat commented 3 years ago

Yea I want them to add more api features. :/