mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
11.72k stars 954 forks source link

Reddit - Feature Request - Alternate MP4 Download for GIFS #4591

Open sourmilk01 opened 1 year ago

sourmilk01 commented 1 year ago

I feel like punching myself for not noticing until now, but I just realized that my reddit scrapes has been downloading and saving videos as gifs.

I cannot determine why it is doing this; is this how reddit now hosts its own videos? When manually saving a video as an mp4, I noticed that the gif version is several times bigger than mp4. Is the gif version the native 'true' fidelity version and the mp4 a conversion through reddit's UI?

Ultimately, I think I'd like all my files being saved as mp4's to save on space; is there something I'm missing or is there some sort of post-processing I'll have to do?

sourmilk01 commented 1 year ago

Alright, after a little more digging, I think I might have partially answered my own question: for media uploaded as gifs originally, the native format would of course be its original file type, gif.

For whatever reason, reddit offers a preview for gifs as a video mp4. Consider the example below (SFW):

https://www.reddit.com/media?url=https%3A%2F%2Fi.redd.it%2Fo9lo1v0izkqb1.gif

https://www.reddit.com/media?url=https%3A%2F%2Fpreview.redd.it%2Fo9lo1v0izkqb1.gif%3Fwidth%3D788%26format%3Dmp4%26s%3Dd2135e5656e103750f5016a30658e07fdce58caa

The original GIF file size comes out to 14.8MB whereas the previewed mp4 file was decreased to 1.7MB for, in my opinion, not much fidelity loss.

Would there be any way to post-process the file to convert it to mp4 via gallery-dl? Or alternatively, as a feature-request assuming it is not yet implemented, have an option to use the 'preview' URL for the file which would save it as the pre-converted mp4?

mikf commented 1 year ago

gallery-dl uses yt-dlp/youtube-dl to download Reddit videos (see reddit.videos), so maybe something changed with their format selection defaults?

With default settings, videos download as .mp4 for me, by the way.

$ gallery-dl https://old.reddit.com/r/animation_porn/comments/g46owz/critique_needed_ball_through_obstacle_course/
/tmp/_/reddit/animation_porn/g46owz Cri…eeded - Ball through obstacle course.mp4

Would there be any way to post-process the file to convert it to mp4 via gallery-dl? Or alternatively, as a feature-request assuming it is not yet implemented, have an option to use the 'preview' URL for the file which would save it as the pre-converted mp4?

Setting reddit.videos to "ytdl" might work.

sourmilk01 commented 1 year ago

Yeah, that was my mistake, I realized that after checking some pages with known video uploads and comparing it to my problem files and folders.

The thing that bothers me the most was that I was coming across tons of gif files that were dozens or hundreds of megabytes in size that would easily only have been only a few MB if uploaded as an MP4, can only blame the uploader I guess.

Related to/repeat of #4460