webif/var/mongoose/html/browse/chunk/extract.jim
hummypkg 22320536ee browse relocation, system class improvements, safe_delete improvements, auto expire, utf-8, ...
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1420 2a923420-c742-0410-a762-8d5b09965624
2013-02-25 22:31:54 +00:00

36 lines
680 B
Plaintext
Executable File

#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require ts.class pretty_size
httpheader
set rfile [cgi_get file]
set part [cgi_get part -]
set parts [cgi_get parts "?"]
if {$part eq "-"} exit
set start $(($part - 1) * 45 * 600 - 600)
set end $($part * 45 * 600 + 600)
puts "START: $start"
puts "END: $end"
set ts [ts fetch $rfile]
set base [file rootname $rfile]
set cmd [list /mod/bin/nicesplice -in $base -out "$base.part$part"]
if {$start > 0} { lappend cmd -cut 0 $start }
lappend cmd -cut $end 9999999
puts "CMD: ($cmd)"
puts [exec {*}$cmd]
set ts [ts fetch "$base.part$part.ts"]
$ts settitle "$part/$parts. [string range [ts get $title] 0 40]"