home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
General Forums
OffTopic
Little help from .NET Programmers please....
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="cheetah05" data-source="post: 273997" data-attributes="member: 19628"><p>Basically i am trying to create a MP plugin to accommodate BBC iPlayer, then download and viewing of the higher quality x264 encodes.</p><p></p><p>I am following this guide here to download a video via a web request: <a href="http://beebhack.wikia.com/wiki/Beebhack#Overview_of_video_request_process" target="_blank">linky!</a></p><p></p><p>But I get an error in the headers instead of a redirect and I'm assuming i am doing something wrong.</p><p></p><p>What I should be getting is a message box of a header which has a redirect in it. I have checked and the header data i start with is not incorrect, as far as i can see.</p><p></p><p>I am working in C#, but rewrote it in VB as there is more chance of getting a response that way as VB programmers can try.......</p><p></p><p>If you are going to try out the code, you need to be from the UK as BBC only lets UK viewers watch the streams. I was hoping people could notice what was wrong without actually running the code though.</p><p></p><p>[code]</p><p>Imports System.Net</p><p>Imports System.Text.RegularExpressions</p><p></p><p>Public Class Form1</p><p></p><p> Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load</p><p></p><p> GetVideoLink("b00c0cd1")</p><p></p><p> End Sub</p><p></p><p> Private Sub GetVideoLink(ByVal ProgramID As String)</p><p></p><p> Dim WebRequest1 As HttpWebRequest = WebRequest.Create("http://www.bbc.co.uk/iplayer/page/item/" & ProgramID & ".shtml")</p><p> WebRequest1.UserAgent = "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3"</p><p></p><p> Dim WebResponse1 As HttpWebResponse = WebRequest1.GetResponse()</p><p></p><p> Dim CookieData As String = Regex.Match(WebResponse1.Headers.ToString(), "Set-Cookie: (.+?);").Groups(1).Value.ToString()</p><p></p><p> WebResponse1.Close()</p><p></p><p> Dim rnd As Random = New Random()</p><p></p><p> Dim WebRequest2 As HttpWebRequest = WebRequest.Create("http://www.bbc.co.uk/mediaselector/3/auth/iplayer_streaming_http_mp4/" & ProgramID & "?" & rnd.Next(0, 1000000).ToString())</p><p> WebRequest2.AllowAutoRedirect = False</p><p> WebRequest2.Accept = "*/*"</p><p> WebRequest2.Headers.Set(HttpRequestHeader.Cookie, CookieData)</p><p> WebRequest2.UserAgent = "Apple iPhone v1.1.4 CoreMedia v1.0.0.4A102"</p><p> WebRequest2.KeepAlive = False</p><p> WebRequest2.AddRange(0, 1)</p><p></p><p> Dim WebResponse2 As HttpWebResponse = WebRequest2.GetResponse()</p><p></p><p> MessageBox.Show(WebResponse2.Headers.ToString())</p><p></p><p> WebResponse2.Close()</p><p></p><p> End Sub</p><p></p><p>End Class</p><p>[/code]</p><p></p><p>Thanks.</p></blockquote><p></p>
[QUOTE="cheetah05, post: 273997, member: 19628"] Basically i am trying to create a MP plugin to accommodate BBC iPlayer, then download and viewing of the higher quality x264 encodes. I am following this guide here to download a video via a web request: [url=http://beebhack.wikia.com/wiki/Beebhack#Overview_of_video_request_process]linky![/url] But I get an error in the headers instead of a redirect and I'm assuming i am doing something wrong. What I should be getting is a message box of a header which has a redirect in it. I have checked and the header data i start with is not incorrect, as far as i can see. I am working in C#, but rewrote it in VB as there is more chance of getting a response that way as VB programmers can try....... If you are going to try out the code, you need to be from the UK as BBC only lets UK viewers watch the streams. I was hoping people could notice what was wrong without actually running the code though. [code] Imports System.Net Imports System.Text.RegularExpressions Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load GetVideoLink("b00c0cd1") End Sub Private Sub GetVideoLink(ByVal ProgramID As String) Dim WebRequest1 As HttpWebRequest = WebRequest.Create("http://www.bbc.co.uk/iplayer/page/item/" & ProgramID & ".shtml") WebRequest1.UserAgent = "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3" Dim WebResponse1 As HttpWebResponse = WebRequest1.GetResponse() Dim CookieData As String = Regex.Match(WebResponse1.Headers.ToString(), "Set-Cookie: (.+?);").Groups(1).Value.ToString() WebResponse1.Close() Dim rnd As Random = New Random() Dim WebRequest2 As HttpWebRequest = WebRequest.Create("http://www.bbc.co.uk/mediaselector/3/auth/iplayer_streaming_http_mp4/" & ProgramID & "?" & rnd.Next(0, 1000000).ToString()) WebRequest2.AllowAutoRedirect = False WebRequest2.Accept = "*/*" WebRequest2.Headers.Set(HttpRequestHeader.Cookie, CookieData) WebRequest2.UserAgent = "Apple iPhone v1.1.4 CoreMedia v1.0.0.4A102" WebRequest2.KeepAlive = False WebRequest2.AddRange(0, 1) Dim WebResponse2 As HttpWebResponse = WebRequest2.GetResponse() MessageBox.Show(WebResponse2.Headers.ToString()) WebResponse2.Close() End Sub End Class [/code] Thanks. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
General Forums
OffTopic
Little help from .NET Programmers please....
Contact us
RSS
Top
Bottom