2017-10-10 15 views
-2

Webブラウザーコントローラーからすべてのヘッダーを収集する方法はありますか?私は1つのヘッダーを探し、そこから完全なURLを取得する必要があります。私はすべてのXRHヘッダを収集するために何かを必要とVB.NET Visual Basicヘッダーリーダー

YouTube Vid

、その後、私は私のものを行うことができます。ここでは、私はあなたたちのためにアップロードされたビデオで何を意味するか見ることができます。 VB.NET VB 2017/2015を使用しています。

+0

ようこそ。 Plsはhttp://stackoverflow.com/help/how-to-askとhttp://stackoverflow.com/help/mcveを読んでいます –

+0

_ "本、ツール、ソフトウェアライブラリ、チュートリアルまたはその他のオフサイトリソース**は、批判的な回答やスパムを引き付ける傾向があるため、スタックオーバーフローのトピックではありません。代わりに[問題の説明](http://meta.stackexchange.com/q/139399/)それを解決するためにこれまでに行われています。」_ [トピック上](https://stackoverflow.com/help/on-topic)から。 –

+0

人々は大抵、問題が何であるかを見るためにビデオを見ることはありません。必要なすべての情報を質問自体に入れてください。テキストは理想的で、必要に応じて静止画像を追加します。ありがとう!あなたが "XRHヘッダー"が何であるかを広げることができれば、それは良いでしょう。特定の種類のHTTP要求または応答ヘッダーですか? – halfer

答えて

1

私は自分自身でそれを理解しました...私は時間がかかりました...誰かが何かを見ているなら、ここで同じものが最後にコードしています。スタックオーバーフローへ

Imports System.Text.RegularExpressions 

パブリック・クラスのForm1

Dim URL_ID As String = "" 
Dim URL_PlaylistSource = "" 
Dim URL_chunklist_ As String = "" 
Dim FULL_URL_TO_VIDEO As String = "" 
Dim URL_FOR_FIRST_PART_OF_FILE_GENERATOR As String = "" 
Dim FileToSaveAndOpen As String = "C:/Users/Silver Lab/Desktop/TVplayUrlGenerator.m3u8" 

'/////////// Drag Form 
Private IsDragging As Boolean = False 
Private StartPoint As Point 

Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox_background.MouseDown 
    StartPoint = PictureBox_background.PointToScreen(New Point(e.X, e.Y)) 
    IsDragging = True 
End Sub 

Private Sub PictureBox1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox_background.MouseMove 
    If IsDragging Then 
     Dim EndPoint As Point = PictureBox_background.PointToScreen(New Point(e.X, e.Y)) 
     Me.Left += (EndPoint.X - StartPoint.X) 
     Me.Top += (EndPoint.Y - StartPoint.Y) 
     StartPoint = EndPoint 
    End If 
End Sub 

Private Sub PictureBox_background_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox_background.MouseUp 
    IsDragging = False 
End Sub 
'/////////// END Drag Form /////////// 


'///////////// 
Public Sub ReadStreamSource(ByVal URL As String) 
    Dim StreamSource As String = New System.Net.WebClient().DownloadString(URL) 
    TextBox_SourceCollector.Text = StreamSource 
End Sub 

Private Sub Timer_reader_Tick(sender As Object, e As EventArgs) Handles Timer_reader.Tick 
    If Label_process_ID.Text = 1 Then 
     Timer_reader.Stop() 
     ProgressBar_Process.Value = 15 
     ProgressBar_Process.Visible = True 
     ReadStreamSource("https://playapi.mtgx.tv/v3/videos/stream/" + URL_ID) 

     Exit Sub 
    End If 
    '////////////// 
    If Label_process_ID.Text = 2 Then 
     Timer_reader.Stop() 
     ProgressBar_Process.Value = 39 
     Dim CleanURL As String = TextBox_SourceCollector.Text.Replace("\", "") 
     TextBox_SourceCollector.Text = CleanURL 
     '\\\ 
     Dim regex As Regex = New Regex("https://mtglva010.cloudycdn.services/vod.*./playlist.m3u8") 
     Dim match As Match = regex.Match(CleanURL) 

     If match.Success Then 
      Dim split = match.Value.Split("""") 
      URL_PlaylistSource = split(6) 
      Label_process_ID.Text = Val(3) 
      ReadStreamSource(URL_PlaylistSource) 
     End If 

     Exit Sub 
    End If 
    '////////////// 
    If Label_process_ID.Text = 3 Then 
     Timer_reader.Stop() 
     ProgressBar_Process.Value = 49 
     Dim regex As Regex = New Regex("chunklist_.*m3u8") 
     Dim match As Match = regex.Match(TextBox_SourceCollector.Text) 
     If match.Success Then 
      Label_process_ID.Text = Val(4) 
      URL_chunklist_ = match.Value 
     End If 

     Exit Sub 
    End If 
    '////////////// 
    If Label_process_ID.Text = 4 Then 
     Timer_reader.Stop() 
     ProgressBar_Process.Value = 72 
     Dim regex As Regex = New Regex("https://mtglva010.cloudycdn.services/vod/_definst_.*smil") 
     Dim match As Match = regex.Match(URL_PlaylistSource) 
     If match.Success Then 
      FULL_URL_TO_VIDEO = match.Value & "/" & URL_chunklist_ 
      ReadStreamSource(FULL_URL_TO_VIDEO) 
      URL_FOR_FIRST_PART_OF_FILE_GENERATOR = match.Value & "/media" 
     End If 
     Exit Sub 
    End If 
    '////////////// 
    If Label_process_ID.Text = 5 Then 
     Timer_reader.Stop() 
     ProgressBar_Process.Value = 100 
     Dim GeneratedChunkLIST As String = TextBox_SourceCollector.Text.Replace("media", URL_FOR_FIRST_PART_OF_FILE_GENERATOR) 
     TextBox_SourceCollector.Text = GeneratedChunkLIST 
     Dim ReplaceVersion As String = TextBox_SourceCollector.Text.Replace("#EXT-X-VERSION:4", "#EXT-X-VERSION:3") 
     TextBox_SourceCollector.Text = ReplaceVersion 
     Label_process_ID.Text = Val(0) 
     '///// Save To File 
     Dim myText As String = TextBox_SourceCollector.Text 
     Dim myFile As IO.File 
     Dim SW As IO.StreamWriter 
     SW = myFile.AppendText(FileToSaveAndOpen) 
     SW.Write(myText) 
     SW.Close() 

     My.Computer.Audio.PlaySystemSound(System.Media.SystemSounds.Hand) 
     If MsgBox("File generated on your Desktop Sucessfully" & vbNewLine & "Do You want to Open it?", MsgBoxStyle.YesNo, "Generated Sucessfully.") = MsgBoxResult.Yes Then 
      Process.Start(FileToSaveAndOpen) 
     End If 
     ProgressBar_Process.Visible = False 
     ProgressBar_Process.Value = 0 
    End If 

End Sub 
Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox_SourceCollector.TextChanged 
    If TextBox_SourceCollector.Text.Contains("streams") Then 
     Label_process_ID.Text = Val(2) 
    End If 

    If TextBox_SourceCollector.Text.Contains("chunklist_") Then 
     Label_process_ID.Text = Val(3) 
    End If 

    If TextBox_SourceCollector.Text.Contains("media") Then 
     Label_process_ID.Text = Val(5) 
    End If 
End Sub 

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load 
    Label_process_ID.Text = Val(0) 
    TextBox_InputURL.TabStop = True 
    ProgressBar_Process.Value = 0 
    ProgressBar_Process.Visible = False 
End Sub 

Private Sub TextBox_InputURL_DoubleClick(sender As Object, e As EventArgs) Handles TextBox_InputURL.DoubleClick 
    TextBox_InputURL.SelectAll() 
End Sub 

Private Sub TextBox_InputURL_TextChanged(sender As Object, e As EventArgs) Handles TextBox_InputURL.TextChanged 
    If TextBox_InputURL.Text = Nothing Then 
     PictureBox_ProcessButton.Image = My.Resources.Search_Disable_fw 
     PictureBox_ProcessButton.Cursor = Cursors.Default 
    Else 
     PictureBox_ProcessButton.Image = My.Resources.Search_Enable_fw 
     PictureBox_ProcessButton.Cursor = Cursors.Hand 
    End If 
End Sub 

Private Sub PictureBox_ProcessButton_Click(sender As Object, e As EventArgs) Handles PictureBox_ProcessButton.Click 
    If My.Computer.FileSystem.FileExists(FileToSaveAndOpen) Then 
     My.Computer.FileSystem.DeleteFile(FileToSaveAndOpen) 
    End If 
    If PictureBox_ProcessButton.Cursor = Cursors.Hand Then 
     Timer_countDown.Start() 
     Dim regex As Regex = New Regex("\d+") 
     Dim match As Match = regex.Match(TextBox_InputURL.Text) 
     If match.Success Then 
      URL_ID = (match.Value) 
      Label_URL_ID.Text = URL_ID 
      Label_process_ID.Text = Val(1) 
     End If 
    End If 
End Sub 

Private Sub Timer_countDown_Tick(sender As Object, e As EventArgs) Handles Timer_countDown.Tick 

    If Label_CountDown.Text = 0 Then 
      Timer_reader.Start() 
      Timer_countDown.Stop() 
     Label_CountDown.Text = 1 
    Else 
      Label_CountDown.Text = Label_CountDown.Text - 1 
     End If 

End Sub 
Private Sub Label_process_ID_TextChanged(sender As Object, e As EventArgs) Handles Label_process_ID.TextChanged 
    Timer_countDown.Start() 
End Sub 

Private Sub PictureBox_Exit_MouseLeave(sender As Object, e As EventArgs) Handles PictureBox_Exit.MouseLeave 
    PictureBox_Exit.Image = Nothing 
End Sub 

Private Sub PictureBox_Exit_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox_Exit.MouseMove 
    PictureBox_Exit.Image = My.Resources.Exit_over_fw 
End Sub 

Private Sub PictureBox_minimize_MouseLeave(sender As Object, e As EventArgs) Handles PictureBox_minimize.MouseLeave 
    PictureBox_minimize.Image = Nothing 
End Sub 

Private Sub PictureBox_minimize_MouseMove(sender As Object, e As MouseEventArgs) Handles PictureBox_minimize.MouseMove 
    PictureBox_minimize.Image = My.Resources.min_over_fw 
End Sub 

Private Sub PictureBox_Exit_Click(sender As Object, e As EventArgs) Handles PictureBox_Exit.Click 
    Application.Exit() 
End Sub 

Private Sub PictureBox_minimize_Click(sender As Object, e As EventArgs) Handles PictureBox_minimize.Click 
    Me.WindowState = FormWindowState.Minimized 
End Sub 

Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked 
    Process.Start("https://www.facebook.com/awp3le") 
End Sub 

Private Sub LinkLabel2_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel2.LinkClicked 
    Process.Start("https://www.youtube.com/user/SilverLabETC/featured?view_as=subscriber") 
End Sub 

エンドクラス