- #@&cls&powershell "type '%~0'|out-string|iex"&pause&exit
- $srt='字幕.srt'
- $s=[timespan]::FromSeconds(5)
- sc -enc utf8 $srt $(
- type $srt|%{
- if($_ -match '-->'){
- $a=$_ -replace ',','.' -split '\s+-->\s+'
- $f=[datetime]$a[0]
- $l=[datetime]$a[1]
- if($l-$f -gt $s){'{0:HH:mm:ss,fff} --> {1:HH:mm:ss,fff}' -f $f,($f+$s)}else{$_}
- }else{$_}
- }
- )
复制代码
|