Hi,
There are sites like
keepvid.com, where you can type the youtube link
of a site, and you get a download link to download the file, I am
trying to download this file using Flex
private var cml:CompositeMassLoader;
public function DownloadFile(videoURL:String):void
{
//Security.allowDomain("
http://keepvid.com");
cml = new CompositeMassLoader();
cml.massLoader.useCache = true;
cml.addFile(videoURL,LoadableFileType.BINARY);
cml.massLoader.addEventListener(ProgressEvent.PROGRESS,
handleProgress);
cml.massLoader.addEventListener(Event.COMPLETE, handleComplete);
cml.start();
}
private function handleProgress(evt:ProgressEvent):void
{
var infos:ILoadInfo = cml.massLoader.loadInfo;
//var infos:ILoadInfo = evt.target.loadInfo; <-- aussi possible
trace("ratio : "+infos.ratioLoaded);
trace("pourcentage : "+infos.percentLoaded);
trace("vitesse : "+infos.currentSpeed);
trace("vitesse moyenne : "+infos.averageSpeed);
trace("temps écoulé : "+infos.elapsedTime);
trace("temps restant (estimé) : "+infos.remainingTime);
trace("bytes chargés : "+infos.bytesLoaded);
trace("bytes total : "+infos.bytesTotal);
trace("bytes à charger : "+infos.bytesRemaining);
}
private function handleComplete(event:Event):void
{
var file2:ILoadableFile = cml.getFileAt(0);
var ldr:ByteArray = file2.getData();
if(ldr != null)
trace("taille du fichier " + ldr.length);
}
and I am calling :
DownloadFile("
http://keepvid.com/save-video.flv?http%3A%2F
%
2Fv4.lscache8.googlevideo.com%2Fvideoplayback%3Fsparams%3Did
%252Cexpire%252Cip%252Cipbits%252Citag%26itag%3D5%26ip
%3D174.37.202.98%26ipbits%3D0%26sver%3D3%26expire%3D1242489600%26key
%3Dyt1%26signature
%3D77EB2BF84D4FEEBBDAD1B5DB2A5D91BDFD0BE867.C43A9A889D23B4B6F11581873A0EFFD03C129F2E
%26id%3D90f952dc07400cab");
so I get a sandbox violation erro
Thank you
On May 16, 12:15 pm, Cédric Tabin <
tabin.ced...@gmail.com> wrote:
> Hi,
>
> What's the code you're using ??? You may put an xml file on the host
> allowing your site to download your files...
>
> Regards,
> Cedric
>
> On Sat, May 16, 2009 at 12:04 PM, visualcpp <
khkas...@gmail.com> wrote:
>
> > Thank you
>
> > I taked a look to the security class, but it's not solving my problem,
> > I see that there are many plugins and software that download flv
> > videos from youtube like sites?
> > this cannot be done with flash?
> > The security Sandbox make that impossible?
>
> > Thank you again
>
> > On May 16, 11:50 am, Cédric Tabin <
tabin.ced...@gmail.com> wrote:
> > > Hello,
>
> > > This isn't an issue due to Masapi, but from the Flash Player Security
> > > Sandbox. You can bypass that using the Security class :
> > > -
> >
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/system/Security.h...()<
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/system/Security.h...>
> > > -
> >
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/system/Security.h...()<
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/system/Security.h...>
>
> > > Best regards,
> > > Cedric
>
> > > On Sat, May 16, 2009 at 11:38 AM, visualcpp <
khkas...@gmail.com> wrote:
>
> > > > Hi
> > > > I am trying to use the masapi library to download files from another
> > > > domain, my flash is onwww.mydomain.comandI am trying to download a
> > > > file fromwww.anotherdomain.comIget a "SandBox security Violation"?