Hi Eric,
I have created a program that "grabs" a link to any video or audio files that are being played in a browser.
(basic summary of what it looks like)
FiddlerApplication.BeforeResponse += delegate(Fiddler.Session oS)
{
uriAllowedMediaTypes = oS.oResponse["Content-Type"].ToLower().Contains("video") || oS.oResponse["Content-Type"].ToLower().Contains("audio") || oS.oResponse["Content-Type"].ToLower().Contains("media");
if (uriAllowedMediaTypes)
{
uriStr = oS.fullUrl.ToString();
File.AppendAllText(@"C:\Desktop\medialinks.txt", oS.fullUrl + Environment.NewLine);
}
};
So for example I can watch a 1mb size video in my browser and I can then later manually download that video, since I know what the url to download that video is (using a download manager of course).
By the time I have finished the manual download I would of used 2mb data (total, 1mb watching and 1mb download). This was my original plan all along.
I then had a lightbulb moment. I wondered if it was possible to watch the video and while the video is playing I was hoping that my fiddlercore program could "copy" the bytes of the video / audio going through the proxy to my local drive.
This way I can have a backup of all the videos I watch on the internet without using extra bandwidth.
So I would watch the video and automatically have a copy saved locally.
In the end instead of using 2mb like my first example. I would of only used 1mb and still have a local copy of the video.
Is there a way to do this in c#? (and if possible also have a variable which holds the number of bytes that have so far been downloaded).
I did some research but only found ways to save the text response and not much else.
Regards
Hendrik
p.s Would buffering be necessary ?