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

[Reddit] Media Is Downloaded Twice #4649

Closed
ismailnoor819 opened this issue Oct 10, 2023 · 5 comments
Closed

[Reddit] Media Is Downloaded Twice #4649

ismailnoor819 opened this issue Oct 10, 2023 · 5 comments

Comments

@ismailnoor819
Copy link

Possibly related to #4470 . It seems so in the latest update of gallery-dl, media is downloaded twice, first a lower resolution version is downloaded from preview.redd.it, this makes it so that the higher quality version is not downloaded due to having the same filename unless it is from an external hosting site such as redgifs or imgur. In that case it does download again in the higher resolution if you have "'_reddit' in locals()": added, which still keeps the problem of having to deal with those duplicate files.

@mikf
Copy link
Owner

mikf commented Oct 10, 2023

Post an example :)

It works as expected for me with default settings:

$ gallery-dl https://old.reddit.com/r/lavaporn/comments/10f25is/lava_looking_incredibly_smooth_as_it_flows_900x600/
/tmp/_/reddit/lavaporn/10f25is Lava loo…redibly smooth as it flows [900x600].jpg

$ gallery-dl https://old.reddit.com/r/lavaporn/comments/v5bp1g/lava_at_night_4288_1290/
/tmp/_/flickr/Thorology/flickr_4490523929.jpg

@ismailnoor819
Copy link
Author

For sure!
I believe it mainly applies to videos, so maybe try something from redgifs or imgur. Here is an example with my verbose log.
https://gist.github.com/ismailnoor819/370f5467d6ca005fd49b545071398a0b

@ismailnoor819
Copy link
Author

Another example : https://gist.github.com/ismailnoor819/a1f5f152933edf79b0a86c14721b37c6 FYI should have mentioned before but both are NSFW

@ismailnoor819
Copy link
Author

ismailnoor819 commented Oct 10, 2023

Perhaps we could separate the preview.redd.it files separately somehow? Maybe via folder or filename so I could identify them and delete the ones that are also hosted on redgifs. What do you think? @mikf

mikf added a commit that referenced this issue Oct 13, 2023
caused by a failed comment URL
using the main submission's preview as fallback

14af15b
4963bb9
@mikf
Copy link
Owner

mikf commented Oct 13, 2023

Fixed in 8bb7243.
The problem was a wrong fallback URL for URLs from comments. In your examples it tries to download gfycat animations found in a comment, fails, and uses the preview from the main submission as fallback.

@mikf mikf closed this as completed Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants