matthew1232 / stockx-api

Easy access to StockX's unofficial API through promises.
172 stars 67 forks source link

Cannot get image of product #8

Closed pitis closed 4 years ago

pitis commented 4 years ago

When I'm trying to scrape 1 single product, I don't get the image of the product.

pitis commented 4 years ago

So when I'm fethcing product details, i am not receiving the image of the product. I had to manually enter in fetchproductdetails.js and change something.

I see that if I used const image = body.Product.media.imageUrl instead of const image = new URL(product.media.imageUrl, 'https://stockx.com').href

I would receive it. Please update the repo

matthew1232 commented 4 years ago

In the code here

On Tue, Apr 28, 2020 at 9:30 AM Pitis Radu notifications@github.com wrote:

So when I'm fethcing product details, i am not receiving the image of the product.

I see that if I used const image = body.Product.media.imageUrl instead of const image = new URL(product.media.imageUrl, 'https://stockx.com').href

I would receive it. Please update the project

If

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/matthew1232/stockx-api/issues/8#issuecomment-620716655, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMWYGWH32Y4Y2GYWD5YSBG3RO4ADVANCNFSM4MSAZJUA .

matthew1232 commented 4 years ago

In this code

const image = body.Product.media.imageUrl

product is uppercase. That's why you're not getting the image URL.

On Tue, Apr 28, 2020 at 9:30 AM Pitis Radu notifications@github.com wrote:

So when I'm fethcing product details, i am not receiving the image of the product.

I see that if I used const image = body.Product.media.imageUrl instead of const image = new URL(product.media.imageUrl, 'https://stockx.com').href

I would receive it. Please update the project

If

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/matthew1232/stockx-api/issues/8#issuecomment-620716655, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMWYGWH32Y4Y2GYWD5YSBG3RO4ADVANCNFSM4MSAZJUA .

pitis commented 4 years ago

nono, I wanted to tell you that there is a bug and the necessary code for it to work :) now i am getting product image

matthew1232 commented 4 years ago

Was going through my issues and realized I misread this a while back, sorry about that 🤦‍♀️. Pushed a fix to the latest version, thank you submitting an issue about this!