boberle / vinted-downloader

Download pages and pictures from Vinted
MIT License
10 stars 3 forks source link

Files are overwritten #6

Closed Mi-Pe closed 6 months ago

Mi-Pe commented 7 months ago

Subsequently downloaded images are titled "photo_.jpg", and after downloading photos of more items in a row, previous files are overwritten. Is there a way to prevent it? Probably best would be to add the item name as part of the image file title - that would also help organize files. Otherwise, we have to manually rename files after each download.

boberle commented 7 months ago

Yes, I know, this is a bit annoying. Is it OK if I add an option --save-in-dir that creates a directory using the item name and put the pictures inside? Or do you prefer adding the name of the item in the picture name?

Mi-Pe commented 7 months ago

You mean it would be a subdirectory of the specified download folder, right? If so, then yes, that's a good solution! Even better if it takes you less time than renaming files.

boberle commented 7 months ago

Yes, this is it. I'll do it this morning (Paris time).

Mi-Pe commented 7 months ago

No rush needed, thanks a lot!

boberle commented 7 months ago

It's done. You can update the package with:

pip install --upgrade vinted-downloader

Then, to save in a subdir of the current directory, use:

python3 vinted_downloader.py --save-in-dir "https://www.vinted.fr/items/1234-item-title"

This will save the pictures in ./1234-item-title.

If you want to save in ./my-ouput/1234-item-title for example, add the -o my-output option:

python3 vinted_downloader.py -o my-output --save-in-dir "https://www.vinted.fr/items/1234-item-title"

The directories are created automatically if they don't already exist.

Mi-Pe commented 7 months ago

Thanks for the upgrade, but it's not working for me. Upgraded the script, run the <python3 vinted_downloader.py --save-in-dir "URL"> command, and I get this error:

-2024-mar-17-002

which means "cannot" in broken Polish (it's not even a full phrase) and it returns to the folder. No files are created. I tried uninstalling Python, rebooting PC, and installing Python again, along with the vinted downloader, but the result is the same. Do you have any idea what might be the reason?

boberle commented 7 months ago

Oh, sorry, it should be python, not python3, on Windows. I guess want it "cannot" do is finding python3...

Mi-Pe commented 7 months ago

-2024-mar-17-012 Since I installed the vinted-downloader script, it doesn't matter from what folder I run the command prompt, right? The error appears even if I run the command from the Downloads folder, or the folder where I store the ZIP installers.

boberle commented 7 months ago

Oh, yeah, my bad:

python -m vinted_downloader --save-in-dir "URL"

I'm really sorry, but I've mixed Linux/Windows, sources/not sources when copy-pasting.

Mi-Pe commented 7 months ago

Haha, no problem! Third time lucky, as they say. Without you, I wouldn't do it at all, so thanks a lot! Closing the issue.