thefakequake / pypartpicker

A Python package that can be used to fetch information from PCPartPicker on products and parts lists.
MIT License
18 stars 8 forks source link

User (Saved) Parts Lists Not Supported #7

Closed lukadd16 closed 3 years ago

lukadd16 commented 3 years ago

On to a more code-oriented issue now...

Looking at the codebase it seems like your regex along with other logic contained within parts list-related functions only check for URLs that contain /list/. However, this does not account for saved parts lists which go by the format /user/myusername/saved/id/ (unless you choose to edit this parts list in which case PCPP proceeds to convert it to a normal /list/). This leads to a plain Exception being thrown (which you might want to change to a ValueError or choose to create a custom exception class called IllegalArgumentException that inherits ValueError) even though in theory the underlying code could support such a list.

Is there any reason why saved parts lists couldn't be supported? If there aren't any reasons against, then I want to ask if the team was already aware of this "bug" and further when we can hope to see it fixed (which I can help with if needed).

thefakequake commented 3 years ago

I completely forget these existed, I'm not great with ReGex and my friend Bogdan was actually the one who made it. If you can make a ReGex that fixes the issue then go ahead and send a PR and I'll merge.