如何从 C# 中的嵌入 url 获取视频文件流
How to get video file stream from embed url in c#
我试过下面的代码,但视频没有播放。
var httpClient = new HttpClient();
var data = await httpClient.GetByteArrayAsync(new Uri("http://www.youtube.com/embed/iRFE-sKOp4I"));
var file = await KnownFolders.MusicLibrary.CreateFileAsync("myfile.mp4", CreationCollisionOption.ReplaceExisting);
var targetStream = await file.OpenAsync(FileAccessMode.ReadWrite);
await targetStream.AsStreamForWrite().WriteAsync(data, 0, data.Length);
await targetStream.FlushAsync();
targetStream.Dispose();
哪位大侠帮我看看怎么保存下载..谢谢
我同意@x...,如果你想从 Youtube 下载视频,你需要安装 YoutubeExtractor。
But with that same code i can't to download different website videos.
我用视频下载 uri“http://video.ch9.ms/ch9/9b56/4f2d0b4d-ea37-4525-8833-128ad6e69b56/uwp01SeriesIntro.mp4”测试了您的代码,它工作正常。
Actually I want to download openload.co/embed/EHmDelqNx94 video is there any possibility..
我刚刚看了这个视频,我发现这是一个名为 openload 的网站,并且这个网站服务可以免费无限制地共享,但是你需要使用 develop Api of it. For downloading, you can refer to the download APIs here。
the video url appears after click on play button, is there any way to handle click event by httpclient or any other clients
从本站的官方文档中,我找到了这个:
get a download link by using download ticket.
可以参考Download Link.
更新:
i tried openload api, but when get download link it showing captcha error, can you please help me for this
我刚刚重现了你的问题,这是因为你的下载源不是public源,需要验证。下载时获取Download Ticket
,虽然Api说API-Login
和API-Key
不是必需的,但需要使用完整路径https://api.openload.co/1/file/dlticket?file={file}&login={login}&key={key}
获取经过验证的票,那么你可以使用这张票来下载URL。
我试过下面的代码,但视频没有播放。
var httpClient = new HttpClient();
var data = await httpClient.GetByteArrayAsync(new Uri("http://www.youtube.com/embed/iRFE-sKOp4I"));
var file = await KnownFolders.MusicLibrary.CreateFileAsync("myfile.mp4", CreationCollisionOption.ReplaceExisting);
var targetStream = await file.OpenAsync(FileAccessMode.ReadWrite);
await targetStream.AsStreamForWrite().WriteAsync(data, 0, data.Length);
await targetStream.FlushAsync();
targetStream.Dispose();
哪位大侠帮我看看怎么保存下载..谢谢
我同意@x...,如果你想从 Youtube 下载视频,你需要安装 YoutubeExtractor。
But with that same code i can't to download different website videos.
我用视频下载 uri“http://video.ch9.ms/ch9/9b56/4f2d0b4d-ea37-4525-8833-128ad6e69b56/uwp01SeriesIntro.mp4”测试了您的代码,它工作正常。
Actually I want to download openload.co/embed/EHmDelqNx94 video is there any possibility..
我刚刚看了这个视频,我发现这是一个名为 openload 的网站,并且这个网站服务可以免费无限制地共享,但是你需要使用 develop Api of it. For downloading, you can refer to the download APIs here。
the video url appears after click on play button, is there any way to handle click event by httpclient or any other clients
从本站的官方文档中,我找到了这个:
get a download link by using download ticket.
可以参考Download Link.
更新:
i tried openload api, but when get download link it showing captcha error, can you please help me for this
我刚刚重现了你的问题,这是因为你的下载源不是public源,需要验证。下载时获取Download Ticket
,虽然Api说API-Login
和API-Key
不是必需的,但需要使用完整路径https://api.openload.co/1/file/dlticket?file={file}&login={login}&key={key}
获取经过验证的票,那么你可以使用这张票来下载URL。