dotnet-campus / dotnetCampus.FileDownloader

The repo includes the file download library and the file download tool.
MIT License
62 stars 16 forks source link

如何处理不带Content-Length等链接下载? #55

Open yinghualuowu opened 1 year ago

yinghualuowu commented 1 year ago

比如有一些直播流的视频链接,不存在长度标记,但可以下载。如果把下载的文件改成对应视频文件是可以打开的. 以下截图是谷歌浏览器下载和fiddler抓包。直播链接只在直播时有效,所以无法提供实时的下载链接 image image

lindexi commented 1 year ago

@yinghualuowu 这不支持分段下载哦,直接下就好

yinghualuowu commented 1 year ago

https://github.com/dotnet-campus/dotnetCampus.FileDownloader/blob/dca9c34d93fa67a2e6059ab235df0d87d450c660/src/dotnetCampus.FileDownloader/SegmentFileDownloader.cs#L215 想使用 dotnetCampus.FileDownloader 实现flv直播流下载功能,但内部有判断 if (contentLength <= 0) 有尝试注释掉该判断,但还是会莫名其妙的提示下载完成.

lindexi commented 1 year ago

@yinghualuowu 这时不太合适用这个库哦,现在这个库只有分段下载的功能,还在逐步加上