Merge branch 'Buerklin-provider' of https://github.com/mkne/Part-DB-server into Buerklin-provider

This commit is contained in:
Marc Kreidler 2025-02-24 09:39:26 +01:00
commit 7454e5045b

View file

@ -128,7 +128,7 @@ class BuerklinProvider implements InfoProviderInterface
}
$response = $this->buerklinClient->request('GET', $url, [
'headers' => [
'Referer' => 'https://www.buerklin.com/product-detail/_' . $matches[2] . '.html'
'Referer' => 'https://www.buerklin.com/de/p/' . $matches[2] . '/'
],
]);
if (preg_match('/(previewPdfUrl): ?("[^"]+wmsc\.buerklin\.com[^"]+\.pdf")/', $response->getContent(), $matches) > 0) {
@ -147,7 +147,7 @@ class BuerklinProvider implements InfoProviderInterface
*/
private function queryByTerm(string $term): array
{
$response = $this->buerklinClient->request('GET', self::ENDPOINT_URL . "/search/global", [
$response = $this->buerklinClient->request('GET', self::ENDPOINT_URL . "products/search/?curr=$this->currency&language=en&pageSize=50&currentPage=0&query=Laser&sort=relevance", [
'headers' => [
'Cookie' => new Cookie('currencyCode', $this->currency)
],
@ -310,7 +310,7 @@ class BuerklinProvider implements InfoProviderInterface
*/
private function getProductShortURL(string $product_code): string
{
return 'https://www.buerklin.com/product-detail/' . $product_code .'.html';
return 'https://www.buerklin.com/de/p/' . $product_code .'/';
}
/**