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

Vsco ripping name conflict #197

Open
xxAlex7 opened this issue Jul 28, 2024 · 2 comments
Open

Vsco ripping name conflict #197

xxAlex7 opened this issue Jul 28, 2024 · 2 comments

Comments

@xxAlex7
Copy link

xxAlex7 commented Jul 28, 2024

  • Ripme version: 2.1.9
  • Java version: 17
  • Operating system: W11

Expected Behavior

Download a profile and update it regularly

Actual Behavior

If the "Preserve order" option is disabled, several files are not downloaded because they have the same name

If the "Preserve order" option is enabled, all files are downloaded normally

However, I would like to use it with the "Preserve order" option disabled because I want to update a profile. If I use it with the "Preserve order" option enabled, several files are downloaded again but with a different name because several media were added and the order of the files changed. The name of the media is the posting date (vsco_MMDDYY). If two or more media were added on the same day, the download only works correctly with the "Preserve order" option enabled.

@soloturn
Copy link

soloturn commented Dec 29, 2024

in the code this is the flag: download.save_order then it puts a prefix. if not it takes the filename from url like below. there is a unit test, which you can run using intellij e.g. and also set a debugger to see how it constructs the filename.

    private String fileNameFromURL(URL url) {
        String saveAs = url.toExternalForm();
        if (saveAs.substring(saveAs.length() - 1).equals("/")) { saveAs = saveAs.substring(0,saveAs.length() - 1) ;}
        saveAs = saveAs.substring(saveAs.lastIndexOf('/')+1);
        if (saveAs.indexOf('?') >= 0) { saveAs = saveAs.substring(0, saveAs.indexOf('?')); }
        if (saveAs.indexOf('#') >= 0) { saveAs = saveAs.substring(0, saveAs.indexOf('#')); }
        if (saveAs.indexOf('&') >= 0) { saveAs = saveAs.substring(0, saveAs.indexOf('&')); }
        if (saveAs.indexOf(':') >= 0) { saveAs = saveAs.substring(0, saveAs.indexOf(':')); }
        return saveAs;
    }

if you could give an example url where this is as you describe?

@xxAlex7
Copy link
Author

xxAlex7 commented Dec 29, 2024

if you could give an example url where this is as you describe?

Here is an example, these two photos were posted on the same day, so they have the same name (vsco_102423.jpg):
https://vsco.co/vijaysarathy/media/6537e8c0ea8b60391cd7fa30
https://vsco.co/vijaysarathy/media/6537e8d5ea8b60391cd7fa31

Imagine the situation, a profile posts a photo in the morning and I download this profile in the morning, in the evening the profile posts another photo and I want to update the profile that I downloaded in the morning with this new photo posted at night, I can't, because the photo that was posted at night will replace the photo that was posted in the morning that I downloaded, because both have the same name.

A possible solution to this problem:

Use the URL name as the file name, changing from vsco_102423.jpg to 6537e8c0ea8b60391cd7fa30.jpg and 6537e8d5ea8b60391cd7fa31.jpg (Example of the two photos I posted above)

Using the profile I provided as an example, when the "Preserve order" option is enabled, 1,104 photos are downloaded, with "Preserve order" disabled, 1,037 are downloaded. Several media are missing because they were posted on the same day and one overlaps the other, because they all have the same name.

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

2 participants