Post Reply 
playlists changed after minim refresh
26-05-2025, 20:27
Post: #29
RE: playlists changed after minim refresh
I have working server side playlists now. Still couldnt get the path to be completely correct but wrote a quick powershell script to remove the first parts of the path and leave the bits I need:

# Specify your input file here
$InputFile = "C:\xxxx\xxxx\xxxx\xxxx\xxxx.m3u8" # Change this to your actual file path
$OutputFile = C:\xxxx\xxxx\xxxx\xxxx\xxxx.m3u8 # Set to a filename if you want to save to a different file

# Read all lines from the file
$lines = Get-Content -Path $InputFile

# Process lines starting from the third line (index 2)
for ($i = 0; $i -lt $lines.Count; $i++) {
if ($i -lt 2) {
# Keep the first two lines unchanged
continue
}

$line = $lines[$i]

# Check if line has enough characters
if ($line.Length -ge 21) {
# Remove characters 4-21 (indices 3-20)
$lines[$i] = $line.Substring(0, 3) + $line.Substring(21)
}
elseif ($line.Length -gt 3) {
# If line is shorter than 21 chars but longer than 3, remove from char 4 to end
$lines[$i] = $line.Substring(0, 3)
}
# If line has 3 or fewer characters, leave it unchanged
}

# Output the result
if ($OutputFile) {
$lines | Out-File -FilePath $OutputFile -Encoding UTF8
Write-Host "Processed file saved to: $OutputFile"
} else {
# If no output file specified, overwrite the original
$lines | Out-File -FilePath $InputFile -Encoding UTF8
Write-Host "Original file has been updated: $InputFile"
}
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: playlists changed after minim refresh - AnthonyEd - 26-05-2025 20:27

Forum Jump:


User(s) browsing this thread: 2 Guest(s)