2012-02-07 00:17:33 +00:00
|
|
|
#!/mod/bin/jimsh
|
|
|
|
|
|
|
|
package require sqlite3
|
|
|
|
package require cgi
|
2012-05-21 20:23:41 +00:00
|
|
|
source /mod/webif/lib/setup
|
2012-02-07 00:17:33 +00:00
|
|
|
require ts.class
|
|
|
|
|
2013-02-09 22:46:15 +00:00
|
|
|
header
|
2012-02-07 00:17:33 +00:00
|
|
|
|
|
|
|
set rfile [cgi_get file]
|
|
|
|
set ts [ts fetch $rfile]
|
|
|
|
set dir [file dirname $rfile]
|
|
|
|
set len [$ts duration 1]
|
2013-03-07 21:41:38 +00:00
|
|
|
lassign [$ts dlnaloc "127.0.0.1"] url
|
2012-02-07 00:17:33 +00:00
|
|
|
|
|
|
|
puts "
|
|
|
|
<link href=/css/jquery.progressbar.css rel=stylesheet type=text/css />
|
|
|
|
<script type=text/javascript src=/js/jquery.progressbar.js></script>
|
|
|
|
<script type=text/javascript src=decrypt.js></script>
|
|
|
|
|
|
|
|
<fieldset class=cleft>
|
|
|
|
<legend>Decrypt in-place</legend>
|
|
|
|
|
|
|
|
<table class=keyval cellpadding=5>
|
|
|
|
<tr><th>File:</th><td>$rfile</td></tr>
|
|
|
|
<tr><th>Length:</th><td>[clock format $len -format "%T"]</td></tr>
|
|
|
|
<tr><th>DLNA URL</th><td>$url</td></tr>
|
|
|
|
</table>
|
|
|
|
"
|
|
|
|
|
|
|
|
if {$url eq ""} {
|
|
|
|
puts "This file has not been indexed by the media server.
|
|
|
|
Cannot decrypt."
|
|
|
|
puts "Have you enabled <i>Content Sharing</i> in the Humax menus?"
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2012-02-22 19:09:46 +00:00
|
|
|
if {![system is_listening 9000]} {
|
|
|
|
puts "The Humax media server is not running, cannot decrypt."
|
|
|
|
puts "Have you enabled <i>Content Sharing</i> in the Humax menus?"
|
|
|
|
puts "It can sometimes turn itself off so it's worth double checking."
|
|
|
|
puts "If it is on then try turning sharing off and on again."
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2012-02-07 00:17:33 +00:00
|
|
|
puts "
|
|
|
|
|
|
|
|
<span class=hidden id=params
|
|
|
|
dir=\"[cgi_quote_url $dir]\"
|
|
|
|
file=\"[cgi_quote_url $rfile]\"
|
|
|
|
></span>
|
|
|
|
|
|
|
|
<div id=decryptdiv style=\"padding: 1em\">
|
|
|
|
<button id=decryptit>Perform decryption</button>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id=progressdiv class=hidden>
|
|
|
|
Decrypting: <div id=progressbar></div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<button id=back class=hidden>Back to media list</button>
|
|
|
|
|
|
|
|
<div id=output class=pre style=\"margin-top: 10px\"></div>
|
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
"
|
|
|
|
|