Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error since today #7

Open
RBenhamza opened this issue Aug 1, 2022 · 11 comments
Open

Error since today #7

RBenhamza opened this issue Aug 1, 2022 · 11 comments

Comments

@RBenhamza
Copy link

Hello there ! First of all, thank you for this wrapper, it's been very usefull for me and my friends.
Then I made a bot that scan some page basing on the search tag you give him and then play a sound when a new article is posted on it, here is the code for the first request I send:
image

And everything was fine until today, but now, when I to use it, I have this error :
image

Could you please tell me if something is wrong or how to fix it ? thank you

@Felicien410
Copy link

yess same ! thanks for all !

@reusteur73
Copy link

Hi,
I come to bring my personal experience.

I just noticed that I can run the following program without error:

from pyVinted import Vinted

def get_p():
    vinted = Vinted()
    

    items = vinted.items.search("https://www.vinted.fr/vetement?order=newest_first&currency=EUR",10,1)
    for item in items:
        vinted_id = item.id
        title = item.title
        photo = item.photo
        brand = item.brand_title
        price = item.price
        url = item.url
        print(url,title, price, brand)
get_p()

Only with python3.6
When I run it with python3.9+ I get the same error as you.

Here are the outputs I have:

C:/Users/maloa/AppData/Local/Programs/Python/Python39/python.exe c:/Users/maloa/Documents/scrapeVIN-master/test.py
Traceback (most recent call last):
  File "c:\Users\maloa\Documents\scrapeVIN-master\test.py", line 16, in <module>
    get_prods()
  File "c:\Users\maloa\Documents\scrapeVIN-master\test.py", line 7, in get_prods
    items = vinted.items.search("https://www.vinted.fr/vetement?order=newest_first&currency=EUR",10,1)
  File "C:\Users\maloa\AppData\Local\Programs\Python\Python39\lib\site-packages\pyVinted\items\items.py", line 34, in search
    raise err
  File "C:\Users\maloa\AppData\Local\Programs\Python\Python39\lib\site-packages\pyVinted\items\items.py", line 25, in search
    response.raise_for_status()
  File "C:\Users\maloa\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\models.py", line 953, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://www.vinted.fr/api/v2/catalog/items?search_text=&catalog_ids=&color_ids=&brand_ids=&size_ids=&material_ids=&status_ids=&country_ids=&city_ids=&is_for_swap=&currency=EUR&price_to=&price_from=&page=1&per_page=10&order=newest_first
PS C:\Users\maloa\Documents\scrapeVIN-master>
b:/Python/Python36_64/python.exe c:/Users/maloa/Documents/scrapeVIN-master/test.py
Cookies set!
https://www.vinted.fr/dzieci/gry-i-zabawki/zabawki-kuchenne/2128719857-forno-con-suoni-e-timer Forno con suoni e timer  10.0 Vintage
https://www.vinted.fr/dzieci/ubrania-dla-dziewczynek/pizamy/jednoczesciowe/2128719850-lot-pyjama-coton Lot Pyjama coton  4.0 Kiabi
https://www.vinted.fr/men/clothes/activewear/tracksuits/2128719806-greyblack-trapstar-tracksuit-size-s Grey/black trapstar tracksuit size S  68.0 Trapstar
https://www.vinted.fr/divertissement/livres/litterature-and-fiction/policiers-and-thrillers/2128719753-libro-alessandro-davenia Libro Alessandro D’avenia 8.0
https://www.vinted.fr/kobiety/ubrania/sukienki/krotkie-sukienki/2128719732-primark-knight-wear-dress Primark knight wear dress 5.0 Primark
https://www.vinted.fr/dzieci/ubranka-dla-chlopcow/swetry-i-bluzy/zapinane-swetry/2128719728-gilet-chaud-perou Gilet chaud Pérou  12.0 perou
https://www.vinted.fr/kobiety/ubrania/topy-koszulki-i-t-shirty/inne/2128719725-haut-marron haut marron 2.0 sans marque
https://www.vinted.fr/dzieci/ubrania-dla-dziewczynek/dziew-ubranka-niemowlece/zestawy/2128719654-robe Robe 👗  1.0 Tape à l'œil
https://www.vinted.fr/men/clothes/jumpers-and-sweaters/hoodies-and-sweatshirts/2128719651-pull-en-maille pull en maille 8.0 Zara

Have a great day !

@SajidZakaria
Copy link

Any update on this?

@reusteur73
Copy link

reusteur73 commented Aug 24, 2022

Yes, I'm pretty sure it's related to the python version.
I tested under several environments (Windows and Debian),
on both I noticed that python3.6.6 worked.
Every time I run the script with higher python (I tested with python3.9 and python3.10) (on both environments) it didn't work, and returned me the error quoted above.
I think it is imperative to use python3.6.6 or lower (not tested) for the script to work.
I don't have a solution on my side to make it work on higher versions of python.
Have a great day.

@herissondev
Copy link
Owner

I guys ! Sorry for not replying I was on vacation. I will look into this in the following week.
I think the error is due to python request "saving" some infos which is probably making vinted blocking us.

@massiou
Copy link

massiou commented Aug 30, 2022

I have just tested with python3.7.6 and request==2.19.1 and it worked fine !

@sunr4y
Copy link

sunr4y commented Oct 17, 2022

any updates?

@sunr4y
Copy link

sunr4y commented Oct 20, 2022

@aime-risson

@jantongo
Copy link

Works OK with python 3.9.2 and requests==2.19.1. Failed with newer requests (2.23.1 maybe).

@jantongo
Copy link

jantongo commented Jan 4, 2023

Updated to python 3.11.1 and still worked.

Then upgraded requests to 2.28.1. Still worked.
Then upgraded charset-normalizer to 2.1.1. Still worked.
Then upgraded idna to 3.4. Still worked.
Then upgraded urllib3 to 1.26.13. And crashed!

The most recent working version for urllib3 is 1.24.3.

@2IIZ
Copy link

2IIZ commented Mar 7, 2023

pip install --force-reinstall -v "urllib3 ==1.21.1" worked like a charm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants