-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Feature request] Download button #83
Comments
Should be also possible to download a video in selected quality (resolution and format). |
it should be a setting for the admin so he can decide for his mirror. |
I'm not quite sure what you mean @elypter, you'll have to clarify. As an update to this, I plan on adding a download button similar to Hooktube's, where you can select one of the streams to download. I'm also looking into automatically muxing video and audio for 1080p and above, although that will require the client to have JS enabled. |
i meant that someone who wants to use the source to host this project himself then that person should have the choice to add a download button or not. i personally would love to have a download button but some people might not be comfortable with it. |
That's an interesting thought. I'm wondering why someone would be uncomfortable with having a download button? It would serve the same files provided used by the player, and if they're hosting it they can always just pull out the code that provides the button. |
in some peoples mind streaming and downloading are fundamentally different things, especially for politicians, although it is basically the same. i just think it is better turn those things into settings so you can update easily. its not a big deal, just a something that came to mind. |
I created a userscript for Tampermonkey called Invidious Downloader which adds a download button next to the listen mode button. It requires Tampermonkey because of GM_download not existing in Greasemonkey and the one in Violentmonkey doesn't work with EventListeners. |
@erupete does it work for DASH videos, e.g. 1080p ones? |
@dimqua not at the moment, only audio files and pre-muxed videos |
Looks good! Added to the list of extensions with 3a44cfd. The issue with DASH videos was the main delay in why this hasn't been added to the site itself. My plan is to use something like videojs/mux.js to combine the separate streams in the browser so that users don't need to use an external tool (e.g. ffmpeg). |
@omarroth comimg here to give my 👍 too. I'd love to have an option to download either the mp3 or pre-muxed videos so I can listen/watch offline on my mobile device while on the go. Thanks for building Invidious by the way! |
Added with fb535ad. Unfortunately there's no way (that I've found) to mux the audio and video streams in the browser in a way that can be downloaded by user. Currently you can download video-only, audio-only, or any of the pre-muxed versions. The default filename of the download is the same as the default template for youtube-dl, This functionality relies on proxying videos through the site, so it's another test for how much bandwidth would likely be used for #34. Since the videos themselves are proxied, you should also be able to download videos that have region-blocks, see #92. You will also likely need to do a hard refresh to pull updated versions of |
@omarroth is it possible to implement this feature without proxying videos? And since the videos are proxied, can't them be pre-muxed on Invidious instance? |
CORS prevents loading resources directly from YouTube. As far as I am aware, the only way to implement this feature is by proxying everything. I would rather not mux them server-side, since it's generally quite CPU and memory intensive. |
@omarroth does CloudTube and HookTube proxying them too? |
could it work if both files were downloaded to localstorage and then merged? i think that is how those downloads on mega.nz work |
See a similar conversation on proxying in #177, which also links to explanations on how FreeTube and CloudTube do things. HookTube now uses the embedded player after receiving a C&D from YouTube, so there's no need for it to proxy anything. It also never appeared to support higher than 720p, see the FAQ page at https://hooktube.com for an explanation why. There's a difference between merging two chunks of data and muxing them in the way that is required here. I have yet to find a solution that is able to do that. MediaSources come very close, but they unfortunately are not able to extend to this use case, see w3c/media-source#209. |
@omarroth well, if CloudTube's approach isn't ideal for playing DASH videos, it probably doesn't mean it's bad for downloading them, right? |
I'm not quite sure what you're asking, but as far as I know it isn't possible to use that approach for downloading videos, since browsers have stricter controls on downloading media than they do on playing it. |
Since the original functionality has been implemented I'm going to close this. For pre-muxed versions or any extensions to this functionality I would recommend opening a new issue. |
Removed JS from download button with 1692f76. It now proxies the direct links with |
Why are |
Would you mind clarifying or providing the script you're using? Are you referring to |
Yeah. Used to be just a regular googlevideo Script relies on a userstyle as well: |
Download button is for embeds only, obviously. |
The reason Assuming you have an |
Guess those are some good reasons. I must not have tried to download anything in a while if that wasn't a recent change. The method I was using was super simple and used to work. I don't really know how to implement the workaround you're suggesting. |
I did try this briefly previously, but I used the exact syntax provided in the example, minus the curly brackets where I inserted the correct strings. Wasn't working, so I got irritated and gave up on it. Finally got around to giving it another try, and removing the hashtags makes it work as advertised. Probably should've figured that just by looking at it. Anyway, cool feature, and thanks for the heads up. |
I'm getting "Administrator has disabled this endpoint" now. |
@omarroth What's the word on this? Did you disable it intentionally, or can it be fixed? |
See #883. It's been disabled intentionally. I'll look into providing them in a way that doesn't use as much bandwidth. |
I know it's as simple as right-click/save-as, but a download button would be a good look. Tbh, I don't even recall the last time I downloaded a YT vid, but seeing the option when YT goes out of their way to make it difficult is pretty satisfying.
I've played around a little with userscripts, and the best I could do was utilize
GM_download
, which converts to a blob. It works, but it'll be slow with larger files, and probably has limits size-wise. Most places I searched, the more reliable method consistently suggested would be on your end, using PHP.The text was updated successfully, but these errors were encountered: