string host = "http://youtube.com/v/";
string end = ".flv";
WebClient Client = new WebClient ();
StreamReader sr = new StreamReader(@"ids.txt");
string line;
do
{
line = sr.ReadLine();
Client.DownloadFile(host+line+end,line+end);
}
while (line !=null);
sr.Close();
工作正常,但晚于我将运行flv / video这给了我这个错误>
An error occurred when the file plays in Windows Media Player
为什么,我做错了什么?
答案 0 :(得分:5)
这是一个FLV(Flash视频)文件。并非所有版本的Windows Media Player都可以播放FLV文件。如果您没有正确设置,则需要FLV player。要在WMP中播放,您可以尝试:WMP FLV Playing
答案 1 :(得分:1)
VLC(http://www.videolan.org/vlc/)在打几乎所有事情方面也做得很好。
作为额外的奖励,您可以在下载过程中开始观看,因为vlc不会尝试锁定文件
答案 2 :(得分:1)
您需要使用FLV播放器。默认情况下,Windows Media Player不会播放FLV文件。
我自己并没有尝试过,而是基于快速的谷歌搜索,但如果你绝对需要使用Windows Media Player,你可以尝试安装FLV编解码器(只需搜索谷歌,你会发现一些)。我相信VLC也会开箱即用FLV。