yaqwsx / jlcparts

Better parametric search for components available for JLC PCB assembly
https://yaqwsx.github.io/jlcparts/
MIT License
538 stars 51 forks source link

Preferred extended parts - free assembly #95

Closed maksz42 closed 8 months ago

maksz42 commented 11 months ago

I was upset because lmv321 became an extended part but then I saw this in jlcpcb's browser : Screenshot_20230924_230731 Looks like now there is a whole subset of extended parts that they don't charge a fee to assemble? Here is a list of these: https://jlcpcb.com/parts/basic_parts Screenshot_20230924_231050 Would be great to have this in jlcparts :+1:

yaqwsx commented 10 months ago

At the moment, is seems that JLCPCB doesn't provide this flag via their API.

brianbienvenu commented 8 months ago

I've just found this issue too. Potentially a baked-in list of the Basic/EP item codes would suffice. My understanding is that these shouldn't change very often, to provide design stability. (That said, sometimes they do - C2293 was previously Basic and is now Extended.)

maksz42 commented 8 months ago

Looks like all preferred parts can be obtained with a single request (additional requests may be needed to get cookies, tokens, etc) There are currently 300 preferred parts and more and more are getting moved from basic to preferred category. We can request all preferred parts using "pageSize" field image And the response contains a list of all preferred parts. image So an additional step could be added during the database build process to mark those parts as preferred. @yaqwsx What do you think?

yaqwsx commented 8 months ago

@maksz42: This looks good! But I prefer if you post it as text instructions to obtain the data. It is not particularly easy to deduce it from your screenshots.

Implementation-wise: I suggest adding a new component table column in the cache DB preferred. We add a new update step where we remove all preferred flags and set it only for the newly fetched components. When we build data tables from the cache DB, we will infer whether components are basic, preferred, or extended.

maksz42 commented 8 months ago

@yaqwsx I opened a PR. Since it's only a single request and I can't test it on cache DB, I added it to buildtables. So you'll need to change that if you want to keep this task offline. I just took the API from https://jlcpcb.com/parts/basic_parts and removed headers and fields that seem like they don't matter. First we need to obtain xsrf token and then query jlcpcb for preferred parts.

yaqwsx commented 8 months ago

Implemented in bb8f3311.