Func RecreateM3U ( ByRef $m3uFile, ByRef $xmlfile, $hProgress, ByRef $TVFilter, ByRef $ExtraFilter )
$sChannelName = StringSplit($m3uFile[1], ",")
$sChannelData = StringSplit($sChannelName[1], " ")
Local $hTemp = FileOpen("new_playlist.m3u", 1)
FileWriteLine($hTemp, "#EXTM3U")
$Ubound = Ubound($m3uFile) - 1
$ProgressStep = Int(($Ubound * 1) / 100)
$Counter = $ProgressStep
$Progress = 0
For $i = 1 to $Ubound step 1
If $Counter = 0 Then
$Counter = $ProgressStep
$Progress += 1
GUICtrlSetData($hProgress, $Progress)
Else
$Counter -=1
EndIF
If StringLeft($m3uFile[$i], 8) = '#EXTINF:' Then
If StringLeft($m3uFile[$i+1], 10) = 'http://lol' Then ContinueLoop
$sChannelName = StringSplit($m3uFile[$i], ",")
$2ndIndex = $sChannelName[0]
$sChannelData = StringSplit($sChannelName[$2ndIndex-1], " ")
$Index = $sChannelData[0]
;If $Index > 15 Then _ArrayDisplay($sChannelData)
If StringLeft($sChannelData[$Index], 28) = 'group-title="Entertainments"' Then
If $TVFilter[0] = False Then ContinueLoop
$ChannelID = EPGSearch($xmlfile, $sChannelName[$2ndIndex])
If IsString($ChannelID) Then
If StringLeft($m3uFile[$i], 20) = '#EXTINF:-1 tvg-id=""' Then
$ssstring = StringTrimLeft($m3uFile[$i], 20)
FileWriteLine($hTemp, '#EXTINF:-1 tvg-id="' & $ChannelID & '"' & $ssstring)
FileWriteLine($hTemp, $m3uFile[$i+1])
Else
$ssstring = StringTrimLeft($m3uFile[$i], 25)
FileWriteLine($hTemp, '#EXTINF:-1 tvg-id="' & $ChannelID & '"' & $ssstring)
FileWriteLine($hTemp, $m3uFile[$i+1])
EndIf
ContinueLoop
Else
FileWriteLine($hTemp, $m3uFile[$i])
FileWriteLine($hTemp, $m3uFile[$i+1])
ContinueLoop
EndIf
EndIf
If StringLeft($sChannelData[$Index], 21) = 'group-title="Culture"' Then