Skip to content

Commit

Permalink
Open Beta v0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
bedtwL committed Jan 9, 2023
1 parent 5f22c94 commit fc1301b
Show file tree
Hide file tree
Showing 22 changed files with 981 additions and 132 deletions.
24 changes: 24 additions & 0 deletions YoutubeEnchanted.Installer/API/APICore.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace YoutubeEnchanted.Installer.API
{
internal class APICore
{
public static void Install()
{
}
public static void CheckInstall()
{
}
public static void Update()
{
}
public static void Uninstall()
{
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="API\APICore.cs" />
<Compile Include="Installer.cs">
<SubType>Form</SubType>
</Compile>
Expand Down
21 changes: 16 additions & 5 deletions YoutubeEnchanted/API/APICore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
using YoutubeExplode.Videos.Streams;
using System.Windows.Forms;
using Vlc.DotNet.Forms;
using System.Net.Http;
using System.Data.Common;

namespace YoutubeEnchanted.API
{
Expand All @@ -31,9 +33,16 @@ public class APICore
public static bool ShowPlayControlMenu = false;
//public static void ResetCore()
//{
//videoPlayCore.Dispose();
//videoPlayCore=new VlcControl() { Dock = DockStyle.Fill, VlcLibDirectory = new System.IO.DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + "VLCLIBx64") };
//videoPlayCore.Dispose();
//videoPlayCore=new VlcControl() { Dock = DockStyle.Fill, VlcLibDirectory = new System.IO.DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory + "VLCLIBx64") };
//}
public static HttpClient HttpClient()
{
HttpClientHandler handler = new HttpClientHandler();
handler.UseCookies= true;
handler.CookieContainer=new System.Net.CookieContainer();
return new System.Net.Http.HttpClient(handler);
}
public static void UpdateURL()
{
try { NOW_URL = UPDATED_LIST[VideoINDEX]; } catch { }
Expand Down Expand Up @@ -64,7 +73,7 @@ public static async void Play(string url,string Topic)
try
{

var youtube = new YoutubeClient();
var youtube = new YoutubeExplode.YoutubeClient(APICore.HttpClient());
var video = await youtube.Videos.GetAsync(url);
var streamManifest = await youtube.Videos.Streams.GetManifestAsync(url);
var streamInfo = streamManifest.GetMuxedStreams().GetWithHighestBitrate();
Expand Down Expand Up @@ -112,10 +121,12 @@ public static async void ParseUrl(string url)
try
{

var youtube = new YoutubeClient();
var youtube = new YoutubeExplode.YoutubeClient(APICore.HttpClient());
var streamManifest = await youtube.Videos.Streams.GetManifestAsync(url);
var streamInfo = streamManifest.GetMuxedStreams().GetWithHighestVideoQuality();
IVideoStreamInfo streamInfo;
try { streamInfo = streamManifest.GetMuxedStreams().GetWithHighestVideoQuality(); } catch(Exception ex) { Program.errorForm = new ErrorUI.Common.UnknowError(ex);Program.error = true; return; }
PARSE_URL = streamInfo.Url;

}
catch (YoutubeExplode.Exceptions.RequestLimitExceededException ex)
{
Expand Down
176 changes: 176 additions & 0 deletions YoutubeEnchanted/ErrorUI/Common/IOError.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions YoutubeEnchanted/ErrorUI/Common/IOError.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace YoutubeEnchanted.ErrorUI.Common
{
public partial class IOError : UserControl
{
public IOError()
{
InitializeComponent();
}
}
}
Loading

0 comments on commit fc1301b

Please sign in to comment.