Example link:
https://www.reddit.com/r/formula1/comments/7qn3db/one_of_my_favourite_slow_motion_images_of_the/
in the HTML source of the link above, I find what might be a direct link to the video, but it redirects to the link with the comments and the video.
https://v.redd.it/s0tmbazdv3a01
More examples for unit testing found at https://www.reddit.com/domain/v.redd.it/
v.redd.it videos seem to only be available through HLS/m3u8 and DASH/mpd:
https://github.com/rg3/youtube-dl/blob/1d1d60f6dd4d7c33dc690ff5c68fdab11e6c0af7/youtube_dl/extractor/reddit.py#L32-L38
gallery-dl is not going to support any video manifests, so unless there is an obvious way to get a direct link to those videos, this is not going to to happen.
You could always just use --write-unsupported and call youtube-dl on the resulting file to get these videos.
Nevermind ... there is apparently a direct link in reddit's JSON response (see this reddit thread), but this wouldn't contain any audio.
If this is OK for you, then I'm just going to use this.
I'd personally prefer to use youtube-dl if it means I get the audio.
Doing a hella necrobump here, but can this be re-evaulated?
Seeing how we're using youtube-dl for twitter, why can't we do the same here? Having to parse the unsupported_files.txt log all the time and strapping it to youtube-dl gets tiring, would be nice if was at the very least an option to use ytdl.
https://github.com/Kattus/scripts/blob/6c7d609c0ffd290337579fe51290320496175b89/redditsaved.sh#L19-L24
It seems that this is also still an open issue in youtube-dl, by the way.
Issue here: https://github.com/ytdl-org/youtube-dl/issues/14748
(Plus some closed duplicates)
So this is probably something that should be addressed if properly fixed upstream.
Videos from Reddit submissions (e.g. https://www.reddit.com/r/formula1/comments/7qn3db/one_of_my_favourite_slow_motion_images_of_the/) will now get downloaded with the youtube-dl downloader (https://github.com/mikf/gallery-dl/commit/ae07f92f7ee0584172a39dfdf9dd3af661d510aa).
Should I also add an extractor that recognizes v.redd.it URLs directly and only forwards them to youtube-dl? I initially decided against it, because you can just use youtube-dl itself if you've went through the trouble of getting a v.redd.it URL from a video post ...
Should I also add an extractor that recognizes v.redd.it URLs directly and only forwards them to youtube-dl? I initially decided against it, because you can just use youtube-dl itself if you've went through the trouble of getting a v.redd.it URL from a video post ...
Exactly, I think the Reddit post URLs should be enough.
Getting the video works great, however the filename seems all messed up, I see in your commit it's trying (I think) to get the ID and title, that does work when having downloader.ytdl.outtmpl unset, but since I have that set for twitter for example (and honestly, would like for reddit too), it breaks.
With downloader.ytdl.outtmpl set to default:
0tydvhnj00e41-0tydvhnj00e41.mp4
Unset:
ewecdv literally the whole school turned into barbarians.mp4
pure youtube-dl:
literally the whole school turned into barbarians-0tydvhnj00e41.mp4
tl;dr: breaks with downloader.ytdl.outtmpl set.
EDIT: Realised for twitter we get extractor.twitter.videos = "ytdl" can we get this for reddit? :3
https://github.com/mikf/gallery-dl/commit/dff33b260c062fc04a080a041509934256b5f651
You can set videos to "ytdl" to invoke youtube-dl on the submission URL instead of the corresponding v.redd.it URL, but it will now also produce the "pure youtube-dl" filename with downloader.ytdl.outtmpl set to default and videos set to true.
"videos": "ytdl" is only useful if you want to use a custom output template for youtube-dl.
Aye, that works great, thanks! Looks like it's time to retire my script then.
Most helpful comment
https://github.com/mikf/gallery-dl/commit/dff33b260c062fc04a080a041509934256b5f651
You can set
videosto"ytdl"to invoke youtube-dl on the submission URL instead of the corresponding v.redd.it URL, but it will now also produce the "pure youtube-dl" filename withdownloader.ytdl.outtmplset todefaultandvideosset totrue."videos": "ytdl"is only useful if you want to use a custom output template for youtube-dl.