From 5622c194f28b0cbe052f9dcea212d2a0b6909c0c Mon Sep 17 00:00:00 2001 From: Mike Nolan Date: Sat, 11 Jun 2022 21:14:29 -0500 Subject: [PATCH] Release --- TYTDProxy/Program.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/TYTDProxy/Program.cs b/TYTDProxy/Program.cs index 9b41df3..f3ca122 100644 --- a/TYTDProxy/Program.cs +++ b/TYTDProxy/Program.cs @@ -19,7 +19,7 @@ public class TYTDProxy RouteServer api_server=new RouteServer(); RouteApi(api_server); MountableServer mountable_server=new MountableServer(static_server); - mountable_server.Mount("/api/",api_server); + mountable_server.Mount("/api",api_server); HttpServerListener listener=new HttpServerListener(new System.Net.IPEndPoint(System.Net.IPAddress.Any,3253),mountable_server); await listener.ListenAsync(token.Token); @@ -99,6 +99,8 @@ public class TYTDProxy var bestMuxed=res.GetMuxedStreams().GetWithHighestVideoQuality(); System.Net.Mime.ContentDisposition contentDisposition=new System.Net.Mime.ContentDisposition(); contentDisposition.FileName = vid.Title; + contentDisposition.DispositionType = System.Net.Mime.DispositionTypeNames.Inline; + ctx.ResponseHeaders.Add("Content-Disposition",contentDisposition.ToString()); await ctx.SendStreamAsync(await Youtube.Videos.Streams.GetAsync(bestMuxed),$"file.{bestMuxed.Container.Name}"); } } @@ -113,6 +115,9 @@ public class TYTDProxy var bestVideoOnly=res.GetVideoOnlyStreams().GetWithHighestVideoQuality(); System.Net.Mime.ContentDisposition contentDisposition=new System.Net.Mime.ContentDisposition(); contentDisposition.FileName = vid.Title; + contentDisposition.DispositionType = System.Net.Mime.DispositionTypeNames.Inline; + ctx.ResponseHeaders.Add("Content-Disposition",contentDisposition.ToString()); + await ctx.SendStreamAsync(await Youtube.Videos.Streams.GetAsync(bestVideoOnly),$"file.{bestVideoOnly.Container.Name}"); } } @@ -127,7 +132,10 @@ public class TYTDProxy var bestAudioOnly=res.GetAudioOnlyStreams().GetWithHighestBitrate(); System.Net.Mime.ContentDisposition contentDisposition=new System.Net.Mime.ContentDisposition(); contentDisposition.FileName = vid.Title; - await ctx.SendStreamAsync(await Youtube.Videos.Streams.GetAsync(bestAudioOnly),$"file.{bestAudioOnly.Container.Name}"); + + contentDisposition.DispositionType = System.Net.Mime.DispositionTypeNames.Inline; + ctx.ResponseHeaders.Add("Content-Disposition",contentDisposition.ToString()); + await ctx.SendStreamAsync(await Youtube.Videos.Streams.GetAsync(bestAudioOnly),$"file.{bestAudioOnly.Container.Name}"); } } public class DummyStr : IStreamInfo