redone hybrid mode, fixes

redone hybrid mode for EXT-X-VERSION:3 and EXT-X-VERSION:5
fix beta crunchyroll issue
This commit is contained in:
hama3254 2021-04-25 16:26:45 +02:00
parent b659133761
commit a4efe9fea0
13 changed files with 440 additions and 375 deletions

Binary file not shown.

View File

@ -535,9 +535,13 @@ Public Class Anime_Add
End Using
Catch ex As Exception
Debug.WriteLine("error- getting EpisodeJson data")
'Exit Sub
Exit Sub
End Try
Main.CrBetaMassEpisodes = EpisodeJson
Dim EpisodeSplit() As String = EpisodeJson.Split(New String() {Chr(34) + "episode" + Chr(34) + ":" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
For i As Integer = 1 To EpisodeSplit.Count - 1
Dim EpisodeSplit2() As String = EpisodeSplit(i).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)

View File

@ -84,7 +84,7 @@ Public Class CRD_List_Item
If Service = "AoD" Then
MetroStyleManager1.Style = MetroColorStyle.LightGreen
ServiceSleep = 1000
ServiceSleep = 500
ElseIf Service = "FM" Then
MetroStyleManager1.Style = MetroColorStyle.DarkPurple
Else
@ -453,47 +453,10 @@ Public Class CRD_List_Item
#Region "Download Cache"
Public WithEvents WC_TS As WebClient
Private Sub TS_DownloadAsync(ByVal DL_URL As String, ByVal DL_Pfad As String)
HybrideLog = HybrideLog + vbNewLine + DL_Pfad + " - " + DL_URL
Try
'Dim wc_ts As New WebClient
WC_TS = New WebClient
WC_TS.DownloadFile(New Uri(DL_URL), DL_Pfad)
Catch ex As Exception
Debug.WriteLine("Download error #1: " + DL_Pfad)
Try
Dim wc_ts As New WebClient
wc_ts.DownloadFile(New Uri(DL_URL), DL_Pfad)
Catch ex2 As Exception
FailedCount = FailedCount + 1
If Item_ErrorTolerance = 0 Then
ElseIf FailedCount >= Item_ErrorTolerance Then
FailedSegments.Add(New FailedSegemtsWithURL(DL_Pfad, DL_URL))
Failed = True
StatusRunning = False
bt_pause.BackgroundImage = My.Resources.main_pause_play
Me.Invoke(New Action(Function()
Label_percent.Text = "Missing segment detected, retry or resume with the play button"
Return Nothing
End Function))
End If
Debug.WriteLine("Download error #2: " + DL_Pfad + vbNewLine + ex2.ToString + vbNewLine + DL_URL)
End Try
End Try
End Sub
Private Function TS_StatusAsync(ByVal prozent As Integer, ByVal di As IO.DirectoryInfo, ByVal pausetime As Integer)
'Dim Now As Date = Date.Now
Dim FinishedSize As Double = 0
Dim AproxFinalSize As Double = 0
@ -502,22 +465,14 @@ Public Class CRD_List_Item
Dim aryFi As IO.FileInfo() = di.GetFiles("*.*")
Dim fi As IO.FileInfo
For Each fi In aryFi
FinishedSize = FinishedSize + fi.Length 'Math.Round(fi.Length / 1048576, 2, MidpointRounding.AwayFromZero).ToString()
FinishedSize = FinishedSize + fi.Length
Next
Catch ex As Exception
End Try
''Thread.Sleep(1000)
''Pause(1)
If prozent > 0 Then
AproxFinalSize = Math.Round((FinishedSize / 1048576) * 100 / prozent, 2, MidpointRounding.AwayFromZero).ToString() ' Math.Round( / 1048576, 2, MidpointRounding.AwayFromZero).ToString()
End If
'Dim duration As TimeSpan = Date.Now - di.CreationTime
'Dim TimeinSeconds As Integer = duration.Hours * 3600 + duration.Minutes * 60 + duration.Seconds
'TimeinSeconds = TimeinSeconds - pausetime
'Dim DataRate As Double = FinishedSize / TimeinSeconds
'Dim DataRateString As String = Math.Round(DataRate, 2, MidpointRounding.AwayFromZero).ToString()
Dim duration As TimeSpan = Date.Now - LastDate
Dim TimeinMilliSeconds As Integer = duration.Seconds * 1000 + duration.Milliseconds
@ -538,10 +493,6 @@ Public Class CRD_List_Item
LastDataRate1 = DataRate
Dim DataRateString As String = Math.Round(DataRateFinal, 2, MidpointRounding.AwayFromZero).ToString()
'Debug.WriteLine("----------------")
'Debug.WriteLine(SinceLast)
'Debug.WriteLine(TimeinMilliSeconds)
'Debug.WriteLine(DataRate)
If prozent > 100 Then
prozent = 100
ElseIf prozent < 0 Then
@ -558,15 +509,37 @@ Public Class CRD_List_Item
Catch ex As Exception
End Try
End If
'RaiseEvent UpdateUI(Filename, prozent, FinishedSize, AproxFinalSize, Color.FromArgb(247, 140, 37), DataRateString + "MB\s")
Return Nothing
End Function
#Region "ThreadChecker"
Private Sub CheckThreadCount()
For w As Integer = 0 To Integer.MaxValue
If StatusRunning = False Then
'MsgBox(True.ToString)
Thread.Sleep(5000)
PauseTime = PauseTime + 5
ElseIf ThreadList.Count > Threads Then
Thread.Sleep(50)
Else
Thread.Sleep(ServiceSleep)
Exit For
End If
Next
End Sub
#End Region
Private Function GetFullUri(ByVal MainUri As String, ByVal CurrentPath As String)
Dim path As String = Nothing
If InStr(CurrentPath, "../") Then
If InStr(CurrentPath, "https://") Then
path = CurrentPath
ElseIf InStr(CurrentPath, "../") Then
Dim countDot() As String = CurrentPath.Split(New String() {"./"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim c() As String = New Uri(MainUri).Segments
@ -585,8 +558,10 @@ Public Class CRD_List_Item
Return path
End Function
#Region "v4"
Private Function ProcessV4(ByVal InputData As String, ByVal Folder As String) As String
Private Function ProcessV4(ByVal url As String, ByVal InputData As String, ByVal Folder As String) As String
If Not Directory.Exists(Path.GetDirectoryName(Folder)) Then
' Nein! Jetzt erstellen...
@ -607,18 +582,27 @@ Public Class CRD_List_Item
Dim di As New IO.DirectoryInfo(Folder)
Dim m3u8FileContent As String = Nothing
Dim Client As New WebClient
Client.Encoding = Encoding.UTF8
Client.Headers.Add(My.Resources.ffmpeg_user_agend.Replace(Chr(34), ""))
Dim m3u8Text As String = InputData
Dim m3u8Key() As String = m3u8Text.Split(New String() {"URI=" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim m3u8Key2() As String = m3u8Key(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Client.DownloadFile(m3u8Key2(0), KeyFilePath)
Dim StreamFile() As String = m3u8Text.Split(New String() {"https://"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim StreamFile2() As String = StreamFile(2).Split(New String() {vbLf}, System.StringSplitOptions.RemoveEmptyEntries)
Dim DownloadFile As String = "https:\\" + StreamFile2(0)
Dim KeyFileDL = New Thread(Sub() Me.TS_DownloadAsync(GetFullUri(url, m3u8Key2(0)), KeyFilePath))
KeyFileDL.Start()
Dim DownloadFile As String = Nothing
Dim FileUrl() As String = InputData.Split(New String() {vbLf}, System.StringSplitOptions.RemoveEmptyEntries)
For line As Integer = 0 To FileUrl.Count - 1
If CBool(InStr(FileUrl(line), "#EXT-X-BYTERANGE:")) = True Then
DownloadFile = GetFullUri(url, FileUrl(line + 1))
Exit For
End If
Next
'Dim StreamFile() As String = m3u8Text.Split(New String() {"https://"}, System.StringSplitOptions.RemoveEmptyEntries)
'Dim StreamFile2() As String = StreamFile(2).Split(New String() {vbLf}, System.StringSplitOptions.RemoveEmptyEntries)
'Dim DownloadFile As String = "https:\\" + StreamFile2(0)
Dim text() As String = m3u8Text.Split(New String() {vbLf}, System.StringSplitOptions.RemoveEmptyEntries)
Dim zeile As String
@ -627,16 +611,9 @@ Public Class CRD_List_Item
For i As Integer = 0 To text.Count - 1
zeile = text(i)
CheckThreadCount()
For w As Integer = 0 To Integer.MaxValue
If StatusRunning = False Then
'MsgBox(True.ToString)
Thread.Sleep(5000)
PauseTime = PauseTime + 5
ElseIf ThreadList.Count > Threads Then
Thread.Sleep(50)
ElseIf Canceld = True Then
If Canceld = True Then
For www As Integer = 0 To Integer.MaxValue
If ThreadList.Count > 0 Then
Thread.Sleep(250)
@ -654,16 +631,9 @@ Public Class CRD_List_Item
Exit For
End If
Next
Return Nothing
Return "Canceld"
Exit Function
Else
Thread.Sleep(ServiceSleep)
Exit For
End If
Next
If zeile.Contains("#EXT-X-BYTERANGE:") Then
Dim Zeile2 As String = zeile.Replace("#EXT-X-BYTERANGE:", "")
Dim Zeile3() As String = Zeile2.Split(New String() {"@"}, System.StringSplitOptions.RemoveEmptyEntries)
@ -698,7 +668,6 @@ Public Class CRD_List_Item
Next
My.Computer.FileSystem.WriteAllText(Application.StartupPath + "\m3u8FileContent.txt", m3u8FileContent, False)
Dim utf8WithoutBom As New System.Text.UTF8Encoding(False)
Using sink As New StreamWriter(Folder + "\index.m3u8", False, utf8WithoutBom)
@ -764,15 +733,164 @@ Public Class CRD_List_Item
End Sub
#End Region
#Region "v3/v5"
Public WithEvents WC_TS As WebClient
Private Function ProcessV3(ByVal url As String, ByVal InputData As String, ByVal Folder As String) As String
If Not Directory.Exists(Path.GetDirectoryName(Folder)) Then
' Nein! Jetzt erstellen...
Try
Directory.CreateDirectory(Path.GetDirectoryName(Folder))
Catch ex As Exception
Debug.WriteLine("folder issue")
Return "Error"
Exit Function
End Try
End If
Dim LoadedKeys As New List(Of String)
LoadedKeys.Add("Nothing")
Dim KeyFileCache As String = Nothing
Dim textLenght() As String = InputData.Split(New String() {vbLf}, System.StringSplitOptions.RemoveEmptyEntries)
Dim Fragments() As String = InputData.Split(New String() {".ts"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim FragmentsInt As Integer = Fragments.Count - 2
Dim Count As Integer = 0
Dim m3u8FileContent As String = Nothing
Dim di As New IO.DirectoryInfo(Folder)
For i As Integer = 0 To textLenght.Length - 1
CheckThreadCount()
If Canceld = True Then
For www As Integer = 0 To Integer.MaxValue
If ThreadList.Count > 0 Then
Thread.Sleep(250)
Else
Try
System.IO.Directory.Delete(HybridModePath, True)
Catch ex As Exception
End Try
Me.Invoke(New Action(Function()
ProgressBar1.Value = 0
Label_percent.Text = "canceled -%"
bt_pause.BackgroundImage = My.Resources.main_pause_play
Return Nothing
End Function))
Exit For
End If
Next
Return "Canceld"
Exit Function
End If
If InStr(textLenght(i), ".ts") Then
Dim File As String = Folder + String.Format("{0:00000}", Count)
Dim curi As String = GetFullUri(url, textLenght(i))
Dim Evaluator = New Thread(Sub() Me.TS_DownloadAsync(curi, File))
Evaluator.Start()
ThreadList.Add(Evaluator)
m3u8FileContent = m3u8FileContent + File + vbLf
Dim FragmentsFinised = Count * 100 / FragmentsInt
Dim Update = New Thread(Sub() Me.TS_StatusAsync(FragmentsFinised, di, PauseTime))
Update.Start()
Count = Count + 1
ElseIf textLenght(i) = "#EXT-X-PLAYLIST-TYPE:VOD" Then
ElseIf InStr(textLenght(i), "URI=" + Chr(34)) Then
Dim KeyLine As String = textLenght(i)
Dim KeyFileUri() As String = KeyLine.Split(New String() {"URI=" + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim KeyFileUri2() As String = KeyFileUri(1).Split(New String() {Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Dim KeyFileUri3 As String = GetFullUri(url, KeyFileUri2(0))
If LoadedKeys.Item(LoadedKeys.Count - 1) = KeyFileUri3 Then
KeyLine = KeyFileUri(0) + "URI=" + Chr(34) + KeyFileCache + Chr(34)
Else
Dim KeyFile As String = Einstellungen.GeräteID() + ".key"
KeyFileCache = KeyFile
Dim Evaluator = New Thread(Sub() Me.TS_DownloadAsync(KeyFileUri3, Application.StartupPath + "\" + KeyFile))
Evaluator.Start()
LoadedKeys.Add(KeyFileUri3)
If KeyFileUri2.Count > 1 Then
KeyLine = KeyFileUri(0) + "URI=" + Chr(34) + KeyFileCache + Chr(34) + KeyFileUri2(1)
Else
KeyLine = KeyFileUri(0) + "URI=" + Chr(34) + KeyFileCache + Chr(34)
End If
End If
m3u8FileContent = m3u8FileContent + KeyLine + vbLf
Else
m3u8FileContent = m3u8FileContent + textLenght(i) + vbLf
End If
Next
Dim utf8WithoutBom As New System.Text.UTF8Encoding(False)
Using sink As New StreamWriter(Folder + "\index.m3u8", False, utf8WithoutBom)
sink.WriteLine(m3u8FileContent)
End Using
Return Folder + "\index.m3u8"
End Function
Private Sub TS_DownloadAsync(ByVal DL_URL As String, ByVal DL_Pfad As String)
HybrideLog = HybrideLog + vbNewLine + DL_Pfad + " - " + DL_URL
Try
'Dim wc_ts As New WebClient
WC_TS = New WebClient
WC_TS.DownloadFile(New Uri(DL_URL), DL_Pfad)
Catch ex As Exception
Debug.WriteLine("Download error #1: " + DL_Pfad)
Try
Dim wc_ts As New WebClient
wc_ts.DownloadFile(New Uri(DL_URL), DL_Pfad)
Catch ex2 As Exception
FailedCount = FailedCount + 1
If Item_ErrorTolerance = 0 Then
ElseIf FailedCount >= Item_ErrorTolerance Then
FailedSegments.Add(New FailedSegemtsWithURL(DL_Pfad, DL_URL))
Failed = True
StatusRunning = False
bt_pause.BackgroundImage = My.Resources.main_pause_play
Me.Invoke(New Action(Function()
Label_percent.Text = "Missing segment detected, retry or resume with the play button"
Return Nothing
End Function))
End If
Debug.WriteLine("Download error #2: " + DL_Pfad + vbNewLine + ex2.ToString + vbNewLine + DL_URL)
End Try
End Try
End Sub
#End Region
Public Function DownloadHybrid(ByVal DL_URL As String, ByVal DL_Pfad As String, ByVal Filename As String) As String
Dim Folder As String = Einstellungen.GeräteID()
Dim DL_URL_old As String = DL_URL
Dim PauseTime As Integer = 0
Dim Pfad2 As String = Path.GetDirectoryName(DL_Pfad.Replace(Chr(34), "")) + "\" + Folder + "\"
Dim di As New IO.DirectoryInfo(Pfad2)
Dim m3u8_url As String() = DL_URL.Split(New [Char]() {Chr(34)})
Dim m3u8FFmpeg As String = Nothing
HybridModePath = Pfad2
Dim InuputStreams As String() = DL_URL.Split(New String() {"-i " + Chr(34)}, System.StringSplitOptions.RemoveEmptyEntries)
Me.Invoke(New Action(Function()
@ -794,10 +912,31 @@ Public Class CRD_List_Item
Try
Dim InputData As String = InputClient.DownloadString(InputURL(0))
If InStr(InputData, "#EXT-X-VERSION:3") Then
If CBool(InStr(InputData, "RESOLUTION=")) = True And CBool(InStr(InputData, "#EXT-X-BYTERANGE:")) = False Then 'master m3u8 no fragments
Dim index_m3u8() As String = InputData.Split(New String() {vbLf}, System.StringSplitOptions.RemoveEmptyEntries)
If TargetReso = 42 Then
TargetReso = 1080
End If
For line As Integer = 0 To index_m3u8.Count - 1
If CBool(InStr(index_m3u8(line), "x" + TargetReso.ToString)) = True Then
InputData = InputClient.DownloadString(GetFullUri(InputURL(0), index_m3u8(line + 1)))
InputURL(0) = index_m3u8(line + 1)
Exit For
End If
Next
End If
If InStr(InputData, "#EXT-X-VERSION:3") Or InStr(InputData, "#EXT-X-VERSION:5") Then
ProcessV3(InputURL(0), InputData, Pfad2)
DL_URL = DL_URL.Replace("-i " + Chr(34) + InputURL(0), "-allowed_extensions ALL " + "-i " + Chr(34) + Pfad2 + "index.m3u8")
ElseIf InStr(InputData, "#EXT-X-VERSION:4") Then
ProcessV4(InputData, Pfad2 + "Stream-" + int.ToString + "\")
ProcessV4(InputURL(0), InputData, Pfad2 + "Stream-" + int.ToString + "\")
DL_URL = DL_URL.Replace("-i " + Chr(34) + InputURL(0), "-allowed_extensions ALL " + "-i " + Chr(34) + Pfad2 + "Stream-" + int.ToString + "\index.m3u8")
Else
'write string to file
@ -809,9 +948,14 @@ Public Class CRD_List_Item
DL_URL = DL_URL.Replace(InputURL(0), SubsFile)
End If
Catch ex As Exception
Debug.WriteLine(ex.ToString)
DL_URL = DL_URL_old
End Try
If Canceld = True Then
Return Nothing
Exit Function
End If
Next
@ -830,7 +974,7 @@ Public Class CRD_List_Item
If InStr(DL_URL, " -headers " + My.Resources.ffmpeg_user_agend) Then
If CBool(InStr(DL_URL, " -headers " + My.Resources.ffmpeg_user_agend)) = True And CBool(InStr(DL_URL, "https:\\")) = False Then
DL_URL = DL_URL.Replace(" -headers " + My.Resources.ffmpeg_user_agend, "")
End If
@ -1163,7 +1307,7 @@ Public Class CRD_List_Item
Private Sub Label_Anime_Click(sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label_Anime.Click, PB_Thumbnail.Click, Label_Reso.Click, Label_percent.Click, ProgressBar1.Click, Label_website.Click, Me.Click
If e.Button = MouseButtons.Right Then
' MsgBox("Right Button Clicked")
'MsgBox("Right Button Clicked")
ContextMenuStrip1.ContextMenu.Show(Me, MousePosition)
End If

View File

@ -311,14 +311,8 @@ Public Class GeckoFX
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'Main.WebbrowserURL = WebBrowser1.Url.ToString
'Main.WebbrowserText = WebBrowser1.Document.Body.OuterHtml
'Main.WebbrowserTitle = WebBrowser1.DocumentTitle
'Main.GrappURL()
Try
My.Computer.Clipboard.SetText(WebBrowser1.Url.ToString)
'My.Computer.Clipboard.SetText(WebBrowser1.Document.Cookie)
MsgBox("copied: " + Chr(34) + WebBrowser1.Url.ToString + Chr(34))
Catch ex As Exception
End Try
@ -395,7 +389,7 @@ Public Class GeckoFX
Main.MangaListItemAdd(Main.RemoveExtraSpaces(NameDLFinal), Thumbnail, BaseURL3, ImageList)
ElseIf InStr(WebBrowser1.Url.ToString, "cr-cookie-ui.php") Then
MsgBox(WebBrowser1.Document.Body.InnerHtml)
'MsgBox(WebBrowser1.Document.Body.InnerHtml)
Else
Main.m3u8List.Clear()
Main.mpdList.Clear()
@ -455,7 +449,7 @@ Public Class GeckoFX
End If
If CBool(InStr(requesturl, ".js")) = True Then
Debug.WriteLine(requesturl)
'Debug.WriteLine(requesturl)
End If
If CBool(InStr(requesturl, "https://beta-api.crunchyroll.com/")) And CBool(InStr(requesturl, "streams?")) Then
If Main.b = False Then
@ -463,6 +457,7 @@ Public Class GeckoFX
Exit Sub
End If
ElseIf CBool(InStr(requesturl, "https://beta-api.crunchyroll.com/")) And CBool(InStr(requesturl, "seasons?series_id=")) Then
'Debug.WriteLine(requesturl)
If Main.b = False Then
'Main.WebbrowserURL = WebBrowser1.Url.ToString
Main.GetBetaSeasons(requesturl)
@ -470,7 +465,9 @@ Public Class GeckoFX
End If
End If
'If CBool(InStr(requesturl, "https://beta-api.crunchyroll.com/")) And CBool(InStr(requesturl, "episodes?")) Then
' Debug.WriteLine(requesturl)
'End If
If ScanTrue = True Then
If InStr(requesturl, ".m3u8") Then

View File

@ -1851,7 +1851,7 @@ Public Class Main
End Using
Catch ex As Exception
Debug.WriteLine("error- getting name data")
'Exit Sub
Exit Sub
End Try
My.Computer.Clipboard.SetText(ObjectJson)
@ -2440,22 +2440,7 @@ Public Class Main
Dim ZeileReso2() As String = ZeileReso(0).Split(New String() {"x"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim ZeileReso3() As String = e.Data.Split(New String() {": Video:"}, System.StringSplitOptions.RemoveEmptyEntries)
Dim ZeileReso4() As String = ZeileReso3(0).Split(New String() {"Stream #"}, System.StringSplitOptions.RemoveEmptyEntries)
'If ResoAvalibe = Nothing Then
' ResoAvalibe = ZeileReso2(ZeileReso2.Count - 1).Trim + ":--:" + ZeileReso4(1)
'Else
ResoAvalibe = ResoAvalibe + vbNewLine + ZeileReso2(ZeileReso2.Count - 1).Trim + ":--:" + ZeileReso4(1)
'End If
'ElseIf InStr(e.Data, "Duration: N/A, bitrate: N/A") Then
'ElseIf InStr(e.Data, "Duration: ") Then
' Dim ZeitGesamt As String() = e.Data.Split(New String() {"Duration: "}, System.StringSplitOptions.RemoveEmptyEntries)
' Dim ZeitGesamt2 As String() = ZeitGesamt(1).Split(New [Char]() {System.Convert.ToChar(".")})
' NetworkScanTime = ZeitGesamt2(0)
' Dim ZeitGesamt2 As String() = ZeitGesamt(1).Split(New [Char]() {System.Convert.ToChar(".")})
' Dim ZeitGesamtSplit() As String = ZeitGesamt2(0).Split(New [Char]() {System.Convert.ToChar(":")})
' MsgBox(ZeitGesamt2(0))
' ZeitGesamtInteger = CInt(ZeitGesamtSplit(0)) * 3600 + CInt(ZeitGesamtSplit(1)) * 60 + CInt(ZeitGesamtSplit(2))
ElseIf InStr(e.Data, "At least one output file must be specified") Then
ResoSearchRunning = False
End If
@ -3384,7 +3369,6 @@ Public Class Main
c = c.Replace("balken1.png", Balken)
Dim CC As String = "cc.png"
c = c.Replace("cc1.png", CC)
'My.Computer.FileSystem.WriteAllText(Application.StartupPath + "\WebInterface\index.html", c, False)
HTML = c
Catch ex As Exception
'Debug.WriteLine(ex.ToString)
@ -3392,71 +3376,7 @@ Public Class Main
End Try
End Sub
#Region "server"
'Dim tcpListener As TcpListener
'Public Sub ServerStart()
' Try
' Dim hostName As String = "localhost" 'Dns.GetHostName()
' Dim Adresscount As Integer
' For i As Integer = 0 To Dns.GetHostEntry(hostName).AddressList.Count - 1
' If Dns.GetHostEntry(hostName).AddressList(i).ToString = "127.0.0.1" Then
' Adresscount = i
' End If
' Next
' If Adresscount = Nothing Then
' MsgBox("http server start failed")
' Exit Sub
' End If
' Dim serverIP As IPAddress = Dns.GetHostEntry(hostName).AddressList(Adresscount) 'Dns.Resolve(hostName).AddressList(0) 'New IPAddress("localhost") '
' Dim Port As String = StartServer
' tcpListener = New TcpListener(serverIP, Int32.Parse(Port))
' tcpListener.Start()
' Debug.WriteLine("Web server started at: " & serverIP.ToString() & ":" & Port)
' ProcessThread()
' Catch abort As ThreadAbortException
' Exit Sub
' MsgBox(abort.ToString())
' Catch ex As Exception
' MsgBox(ex.ToString())
' End Try
'End Sub
'Public Sub ProcessThread()
' Dim ServerRunning = True
' Dim clientSocket As Socket
' While ServerRunning = True
' Try
' clientSocket = tcpListener.AcceptSocket
' clientSocket.ReceiveBufferSize = 1048576
' ' Socket Information
' 'Dim clientInfo As IPEndPoint = CType(clientSocket.RemoteEndPoint, IPEndPoint)
' 'Debug.WriteLine("Client: " + clientInfo.Address.ToString() + ":" + clientInfo.Port.ToString())
' ' Set Thread for each Web Browser Connection
' Dim clientThread As New Thread(Sub() Me.ProcessRequest(clientSocket))
' clientThread.Start()
' Catch ex As Exception
' Debug.WriteLine(ex.ToString())
' Try
' clientSocket.Close()
' Catch ex2 As Exception
' End Try
' ServerRunning = False
' Exit Sub
' End Try
' End While
' 'New AsyncCallback(AddressOf DoAcceptSocketCallback), listener
'End Sub
Dim ListOfThread As New List(Of Thread)

View File

@ -16,7 +16,7 @@ Public Class Einstellungen
Private Sub Einstellungen_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Label6.Text = "You have: v" + Application.ProductVersion.ToString + " Beta-U1"
Label6.Text = "You have: v" + Application.ProductVersion.ToString + " Beta-U2"
BackgroundWorker1.RunWorkerAsync()