In v1.2.1, LCSC fetching is broken, as the download function uses 'requests' rather than 'cloudscraper', causing requests to fail.
Fix
Replace the following lines starting at 137:
response = requests.get(url)
data_json = response.json()
return data_json
with
import cloudscraper
scraper = cloudscraper.create_scraper()
response = scraper.get(
url,
headers=headers,
timeout=timeout,
)
response.raise_for_status()
data_json = response.json()
return data_json
You can move the import to the top if you feel like it...
This fixes the test api method
update line 137 to:
'productIntroEn': '100pF C0G ±5% 25V 0201 Ceramic Capacitors RoHS',
tested, this works
sorry for lack of formatting, I had to write this in a rush!
In v1.2.1, LCSC fetching is broken, as the download function uses 'requests' rather than 'cloudscraper', causing requests to fail.
Fix
tools.py
Replace the following lines starting at 137:
with
You can move the import to the top if you feel like it...
lcsc_api.py
This fixes the test api method
update line 137 to:
tested, this works
sorry for lack of formatting, I had to write this in a rush!