-2
有没有一种方法可以从Web浏览器控制器收集所有头文件?我需要查找一个标题并从中获取完整的网址。在这里,你可以看到我的意思是在我上传了你们VIDEO:VB.NET Visual Basic头文件读取器
我需要的东西收集所有XRH头,然后我可以做我的东西。我正在使用VB.NET VB 2017/2015。
有没有一种方法可以从Web浏览器控制器收集所有头文件?我需要查找一个标题并从中获取完整的网址。在这里,你可以看到我的意思是在我上传了你们VIDEO:VB.NET Visual Basic头文件读取器
我需要的东西收集所有XRH头,然后我可以做我的东西。我正在使用VB.NET VB 2017/2015。
好吧,我想我的自我...我花了一段时间...如果有人正在寻找同样的东西,这是在最后的代码我做了什么和如何。
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
末级
欢迎堆栈溢出。请阅读http://stackoverflow.com/help/how-to-ask和http://stackoverflow.com/help/mcve –
_“问题要求我们**推荐或找到一本书,工具,软件库,教程或其他非现场资源**是堆栈溢出的主题,因为它们倾向于吸引自以为是的答案和垃圾邮件,相反,[描述问题](http://meta.stackexchange.com/q/139399/)以及到目前为止已经完成解决它。“_ - 从[On-topic](https://stackoverflow.com/help/on-topic)。 –
人们大多不会看视频,看看问题是什么 - 请将所有必要的信息放入问题本身。文字很理想,并根据需要添加静止图像。谢谢!如果您可以扩展“XRH标题”的内容,那就太好了。它是一种特定类型的HTTP请求或响应头? – halfer