StreamReader readStream = new StreamReader(receiveStream, encode) Pipes the stream to a higher level stream reader with the required encoding format. Stream receiveStream = myHttpWebResponse.GetResponseStream() Įncoding encode = ("utf-8") Gets the stream associated with the response. HttpWebResponse myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse() Sends the HttpWebRequest and waits for the response. HttpWebRequest myHttpWebRequest = (HttpWebRequest)WebRequest.Create(RealURL) Creates an HttpWebRequest with the specified URL.
![youtube 404 not found youtube 404 not found](https://i.ytimg.com/vi/3VNPAj-2gnc/maxresdefault.jpg)
we get newly create link into string RealURL WebResponse MyResponse = MyRequest.GetResponse() WebRequest MyRequest = HttpWebRequest.Create(URL) Now we will send request to server which will create new link.
![youtube 404 not found youtube 404 not found](https://i.ytimg.com/vi/bWdzL7SQxD0/maxresdefault.jpg)
String VideoId = URL.Substring(URL.IndexOf('=') + 1) First of all we will change our utube link to our desired format. Protected void btnSubmit_Click(object sender, EventArgs e) Protected void Page_Load(object sender, EventArgs e)
#Youtube 404 not found code#
The ASP.NET page ind its code are as following : Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724 Page.RaisePostBackEvent(NameValueCollection postData) +35 Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 _Click(Object sender, EventArgs e) in d:\dzhosts\localuser\xxxxxx\.(EventArgs e) +9628722 Source File: d:\dzhosts\localuser\xxxxxxxxxx\Line: 25 Line 27: // we get newly create link into string RealURL Line 25: WebResponse MyResponse = MyRequest.GetResponse() Line 24: WebRequest MyRequest = HttpWebRequest.Create(URL) Line 23: // Now we will send request to server which will create new link. Please review the stack trace for more information about the error and where it originated in the code.Įxception Details: : The remote server returned an error: (404) Not Found. The remote server returned an error: (404) Not Found.ĭescription: An unhandled exception occurred during the execution of the current web request.
#Youtube 404 not found download#
I used the following asp.net page and its code which by them I can download Youtube as a video file