And back to videolib.

This commit is contained in:
Master Kwoth 2016-02-02 23:41:13 +01:00
parent b2f43f4f72
commit baaba53a06
3 changed files with 10 additions and 10 deletions

View File

@ -12,7 +12,7 @@ using System.Diagnostics;
using NadekoBot.Extensions;
using System.Threading;
using Timer = System.Timers.Timer;
using YoutubeExtractor;
using VideoLibrary;
namespace NadekoBot.Classes.Music {
public enum StreamState {
@ -51,14 +51,14 @@ namespace NadekoBot.Classes.Music {
}
private void ResolveStreamLink() {
VideoInfo video = null;
Video video = null;
try {
if (OnResolving != null)
OnResolving();
Console.WriteLine("Resolving video link");
video = DownloadUrlResolver.GetDownloadUrls(Searches.FindYoutubeUrlByKeywords(Query))
.Where(v => v.AdaptiveType == AdaptiveType.Audio)
video = YouTube.Default.GetAllVideos(Searches.FindYoutubeUrlByKeywords(Query))
.Where(v => v.AdaptiveKind == AdaptiveKind.Audio)
.OrderByDescending(v => v.AudioBitrate)
.FirstOrDefault();
@ -74,7 +74,7 @@ namespace NadekoBot.Classes.Music {
return;
}
musicStreamer = new MusicStreamer(this, video.DownloadUrl);
musicStreamer = new MusicStreamer(this, video.Uri);
if (OnQueued != null)
OnQueued();
return;

View File

@ -73,6 +73,10 @@
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="libvideo, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\VideoLibrary.1.3.3\lib\portable-net45+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10\libvideo.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Manatee.Json, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c267f67a39449c62, processorArchitecture=MSIL">
<HintPath>..\packages\Manatee.Json.3.2.1\lib\net45\Manatee.Json.dll</HintPath>
<Private>True</Private>
@ -128,10 +132,6 @@
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="YoutubeExtractor, Version=0.10.10.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\YoutubeExtractor.0.10.10\lib\net35\YoutubeExtractor.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Classes\Music\MusicControls.cs" />

View File

@ -11,5 +11,5 @@
<package id="Parse" version="1.6.2" targetFramework="net452" />
<package id="RestSharp" version="105.2.3" targetFramework="net452" />
<package id="taglib" version="2.1.0.0" targetFramework="net452" />
<package id="YoutubeExtractor" version="0.10.10" targetFramework="net452" />
<package id="VideoLibrary" version="1.3.3" targetFramework="net452" />
</packages>