Iridium
Iridium copied to clipboard
Implement ability to save videos
This feature will be bare-bones, meaning it won't have encoding/splicing/converting capabilities, but there are options for making that part easier in the future if the solutions found are not too complex.
The download options will list the files and formats that are available, with options for default settings to be set. For example, default quality and default file format.
Since this might be a feature that is very big there won't be a milestone until development has reached an almost complete stage.
YouTube sends audio and video streams separately. There are three different formats: *3GPP+MP3 (240p only) *MPEG 4(AVC+AAC) *OGG(WebM+Opus) Not all videos are available in all formats. The separate audio/video nature makes it very easy to extract an audio-only copy if requested.
@erkinalp I understand those, the struggle at the moment is experimenting the best way to display the available options for the user to choose from.
I'm experimenting with a button that shows the list of available formats for download and if the user clicks the button it will download a predefined (in the extension settings) video and/or audio.
There are 3 types of streams served by YouTube that can be saved:
- Audio/Video only
- Audio and Video
- Stream
For 1. these are listed as adaptive_fmts and are used for DASH (Dynamic Adaptive Streaming over HTTP) playback
For 2. these are listed as url_encoded_fmt_stream_map and are legacy-type streams which are strictly used for devices that are not capable of DASH playback
For 3. these are RTP based streams and might not be worth spending the time to find a way to download them due to the inherit complications the complexity of download an on-demand video brings.
All of these can be signature controlled meaning there is a key + algorithm combination in the .js source code that allows a signature to be decoded for each stream.
The availability at the moment for the save feature will be limited to the streams available in points 1. and 2.
The save feature will by no means be available for paid protected content such as movies.
FYI premium streams are DASH-only and live streams are RTP-only.
Getting there, the biggest challenge now is building a proper UI for stream selection. Rough layout is already laid out, next up is finding the best way to organize Audio only, Video only and Audio + Video streams.

next up is finding the best way to organize Audio only, Video only and Audio + Video streams.
How about 3 buttons? Like so:
2160p <A+V Icon> <V Icon> <A Icon> 1080P <A+V Icon> <V Icon> <A Icon>
and so on
@Diskutant That's the first plan, but more compact, three options: Audio only, Video only and Audio + Video

Then each one would display something along the lines of the image posted in my previous reply.
Works for Video streams, however for Audio only I'm still wondering what will be the best way to list them given the available information.
You could list the bitrate and encoding for audio streams.
@erkinalp Like the quality for the video streams I'd show the bitrate for audio streams. That's a good solution.
The basic page UI is finished at this point, there should be no changes until the feature is released

This feature is being actively worked on, the current delay was related to finding a way to download the file instead of opening it and allow the user to enter a file name format with plain javascript, but this is not possible due to CORS since the streams are not hosted in the same server as the one the videos are being played on.
This means the extension will need a new permission downloads in order for this part to work correctly.
One other thing left forgotten is the ability to also download the closed captions.
The latest version added the permission request for downloading but still no actual download functionality.
@erkinalp https://github.com/ParticleCore/Iridium/releases/tag/1.2.5
Parking this one for now. I'm very interested in adding it, but will require a lot of time investment and there are other higher priority items that are simpler to work on at this moment.