2012-02-06 23:28:53 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require cgi
|
|
|
|
source /mod/var/mongoose/lib/setup
|
|
|
|
require ts.class pretty_size
|
|
|
|
|
|
|
|
puts "Content-Type: text/html\r\n\r\n"
|
|
|
|
|
|
|
|
cgi_input
|
|
|
|
#cgi_dump
|
|
|
|
|
|
|
|
set rfile [cgi_get file]
|
|
|
|
set part [cgi_get part -]
|
2012-02-07 00:40:31 +00:00
|
|
|
set parts [cgi_get parts "?"]
|
2012-02-06 23:28:53 +00:00
|
|
|
|
|
|
|
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]
|
|
|
|
|
2012-02-07 00:40:31 +00:00
|
|
|
set ts [ts fetch "$base.part$part.ts"]
|
|
|
|
$ts settitle "$part/$parts. [string range [ts get $title] 0 40]"
|
|
|
|
|