manojkarthick / reddsaver

CLI tool to download saved and upvoted media from Reddit
Apache License 2.0
143 stars 9 forks source link

Feature: Download and merge audio track for videos #30

Closed outergod closed 3 years ago

outergod commented 3 years ago

First of all, thank you for reddsaver!

I appears like right now, reddsaver only downloads the video track for video files, which sadly makes it virtually useless for video downloads as they come without their audio tracks. Other tools like youtube-dl support downloading the audio track and merging the two back to the complete video file, and it would be great if reddsaver supported this, as well. It could be accomplished e.g. by integrating ffmpeg.

manojkarthick commented 3 years ago

Thanks @e-user ! are these videos hosted by Reddit that are missing audio? Also, could you provide links to any sample posts that are missing audio when downloaded?

outergod commented 3 years ago

Wow, you're quick!

Here's one such video: https://old.reddit.com/r/blursedimages/comments/own6pr/blursed_toy/

This is what youtube-dl does to get the audio back:

❯ youtube-dl -f bestvideo+bestaudio https://old.reddit.com/r/blursedimages/comments/own6pr/blursed_toy/
[RedditR] own6pr: Downloading JSON metadata
[Reddit] 8rpd0a6y80f71: Downloading m3u8 information
[Reddit] 8rpd0a6y80f71: Downloading MPD manifest
[download] Destination: Blursed_Toy-8rpd0a6y80f71.fdash-video_1203754.mp4
[download] 100% of 622.12KiB in 00:0020MiB/s ETA 00:00known ETA
[download] Destination: Blursed_Toy-8rpd0a6y80f71.fdash-audio_0_133070.m4a
[download] 100% of 69.18KiB in 00:0065MiB/s ETA 00:00known ETA
[ffmpeg] Merging formats into "Blursed_Toy-8rpd0a6y80f71.mp4"
Deleting original file Blursed_Toy-8rpd0a6y80f71.fdash-video_1203754.mp4 (pass -k to keep)
Deleting original file Blursed_Toy-8rpd0a6y80f71.fdash-audio_0_133070.m4a (pass -k to keep)
manojkarthick commented 3 years ago

Thank you!

manojkarthick commented 3 years ago

Hi @e-user - sorry for the delay! I've added support to merge the audio for reddit videos v.redd.it. It's available in the master branch and crates.io at the moment, I will be releasing it via the other package managers over the next few days. Let me know if you face any issues. Thanks!