From 450d20280b7db45c736783351befb3da4065a282 Mon Sep 17 00:00:00 2001 From: Drexel2k <13720303+Drexel2k@users.noreply.github.com> Date: Thu, 30 Apr 2020 10:53:30 +0200 Subject: [PATCH] Added original file name to slug http header, so that is shown in Youtube studio. --- VidUp.UI/CommonAssemblyInfo.cs | 6 +++--- VidUp.YouTube/HttpWebRequestCreator.cs | 2 +- VidUp.YouTube/YoutubeUpload.cs | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/VidUp.UI/CommonAssemblyInfo.cs b/VidUp.UI/CommonAssemblyInfo.cs index fc2694e..52c5a18 100644 --- a/VidUp.UI/CommonAssemblyInfo.cs +++ b/VidUp.UI/CommonAssemblyInfo.cs @@ -4,10 +4,10 @@ [assembly: System.Reflection.AssemblyProductAttribute("VidUp")] [assembly: System.Reflection.AssemblyTitleAttribute("VidUp")] [assembly: System.Reflection.AssemblyCompanyAttribute("Drexel Development")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("1.1.0.1")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.1.1.0")] //Shown in Gui/Setup -[assembly: System.Reflection.AssemblyVersionAttribute("1.1.0.1")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.1.0.1")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.1.1.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.1.1.0")] [assembly: System.Reflection.AssemblyCopyright("©2020 Drexel Development")] [assembly: ComVisible(false)] diff --git a/VidUp.YouTube/HttpWebRequestCreator.cs b/VidUp.YouTube/HttpWebRequestCreator.cs index bfd0c66..6efea58 100644 --- a/VidUp.YouTube/HttpWebRequestCreator.cs +++ b/VidUp.YouTube/HttpWebRequestCreator.cs @@ -77,7 +77,7 @@ private static async Task createBasicUploadHttpWebRequest(string request.Headers.Add(HttpRequestHeader.Authorization, "Bearer " + accessToken); //raise limits for large uploads - if (length > 5 * 1024 * 1024) + if (length > 100 * 1024 * 1024) { request.Timeout = int.MaxValue; request.AllowWriteStreamBuffering = false; diff --git a/VidUp.YouTube/YoutubeUpload.cs b/VidUp.YouTube/YoutubeUpload.cs index a0fd0b6..d960008 100644 --- a/VidUp.YouTube/YoutubeUpload.cs +++ b/VidUp.YouTube/YoutubeUpload.cs @@ -71,6 +71,8 @@ public static async Task Upload(Upload upload, long maxUploadInByt { //request upload session/uri HttpWebRequest request = await HttpWebRequestCreator.CreateAuthenticatedUploadHttpWebRequest(YoutubeUpload.uploadEndpoint, "POST", jsonBytes, "application/json; charset=utf-8"); + //slug header adds original video file name to youtube studio + request.Headers.Add("Slug", Path.GetFileName(upload.FilePath)); request.Headers.Add("X-Upload-Content-Length", info.Length.ToString()); request.Headers.Add("X-Upload-Content-Type", "video/*");