Iridium icon indicating copy to clipboard operation
Iridium copied to clipboard

Implement ability to save videos

Open ParticleCore opened this issue 6 years ago • 13 comments

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.

ParticleCore avatar Oct 21 '19 20:10 ParticleCore

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 avatar Oct 26 '19 17:10 erkinalp

@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.

ParticleCore avatar Oct 26 '19 18:10 ParticleCore

There are 3 types of streams served by YouTube that can be saved:

  1. Audio/Video only
  2. Audio and Video
  3. 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.

ParticleCore avatar Oct 28 '19 13:10 ParticleCore

FYI premium streams are DASH-only and live streams are RTP-only.

erkinalp avatar Oct 28 '19 16:10 erkinalp

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.

ss1

ParticleCore avatar Nov 08 '19 00:11 ParticleCore

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

Metal-Snake avatar Nov 08 '19 19:11 Metal-Snake

@Diskutant That's the first plan, but more compact, three options: Audio only, Video only and Audio + Video

ss2

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.

ParticleCore avatar Nov 08 '19 20:11 ParticleCore

You could list the bitrate and encoding for audio streams.

erkinalp avatar Nov 09 '19 09:11 erkinalp

@erkinalp Like the quality for the video streams I'd show the bitrate for audio streams. That's a good solution.

ParticleCore avatar Nov 09 '19 11:11 ParticleCore

The basic page UI is finished at this point, there should be no changes until the feature is released

ss1

ParticleCore avatar Nov 13 '19 00:11 ParticleCore

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.

ParticleCore avatar Nov 17 '19 17:11 ParticleCore

The latest version added the permission request for downloading but still no actual download functionality.

erkinalp avatar Mar 15 '20 19:03 erkinalp

@erkinalp https://github.com/ParticleCore/Iridium/releases/tag/1.2.5

ParticleCore avatar Mar 15 '20 20:03 ParticleCore

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.

ParticleCore avatar Dec 07 '23 15:12 ParticleCore