2019-04-27 08:01:38 +00:00
|
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head><meta name="generator" content="Hexo 3.8.0">
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
|
<meta name="google-site-verification" content="xBT4GhYoi5qRD5tr338pgPM5OWHHIDR6mNg1a3euekI">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
|
|
<meta name="description" content="">
|
|
|
|
|
<meta name="keyword" content="">
|
2020-03-13 14:56:23 +00:00
|
|
|
|
<link rel="shortcut icon" href="/uWeb/img/favicon.ico">
|
2019-04-27 08:01:38 +00:00
|
|
|
|
|
|
|
|
|
<title>
|
|
|
|
|
|
|
|
|
|
利用文件预处理预览/查看/播放一切可下载资源
|
|
|
|
|
|
|
|
|
|
</title>
|
|
|
|
|
|
|
|
|
|
<!-- Custom CSS -->
|
2020-03-13 14:56:23 +00:00
|
|
|
|
<link rel="stylesheet" href="/uWeb/css/aircloud.css">
|
2019-04-27 08:01:38 +00:00
|
|
|
|
<link href="//at.alicdn.com/t/font_620856_pl6z7sid89qkt9.css" rel="stylesheet" type="text/css">
|
|
|
|
|
<!-- ga & ba script hoook -->
|
|
|
|
|
<script></script>
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
|
|
<div class="site-nav-toggle" id="site-nav-toggle">
|
|
|
|
|
<button>
|
|
|
|
|
<span class="btn-bar"></span>
|
|
|
|
|
<span class="btn-bar"></span>
|
|
|
|
|
<span class="btn-bar"></span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="index-about">
|
|
|
|
|
<i> </i>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="index-container">
|
|
|
|
|
|
|
|
|
|
<div class="index-left">
|
|
|
|
|
|
|
|
|
|
<div class="nav" id="nav">
|
|
|
|
|
<div class="contents" id="nav-content">
|
|
|
|
|
<ul>
|
|
|
|
|
<li>
|
2020-03-13 14:56:23 +00:00
|
|
|
|
<a href="/uWeb/">
|
2019-04-27 08:01:38 +00:00
|
|
|
|
<i class="iconfont icon-shouye1"></i>
|
2020-02-27 03:14:10 +00:00
|
|
|
|
<span>HOME</span>
|
2019-04-27 08:01:38 +00:00
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
2020-03-13 14:56:23 +00:00
|
|
|
|
<a href="/uWeb/tags">
|
2019-04-27 08:01:38 +00:00
|
|
|
|
<i class="iconfont icon-biaoqian1"></i>
|
2020-02-27 03:14:10 +00:00
|
|
|
|
<span>TAGS</span>
|
2019-04-27 08:01:38 +00:00
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
2020-03-13 14:56:23 +00:00
|
|
|
|
<a href="/uWeb/archives">
|
2019-04-27 08:01:38 +00:00
|
|
|
|
<i class="iconfont icon-guidang2"></i>
|
2020-02-27 03:14:10 +00:00
|
|
|
|
<span>ARCHIVES</span>
|
2019-04-27 08:01:38 +00:00
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="toc" class="toc-article">
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="search-field" id="search-field">
|
|
|
|
|
<div class="search-container">
|
|
|
|
|
<div class="search-input">
|
|
|
|
|
<span id="esc-search"> <i class="icon-fanhui iconfont"></i></span>
|
|
|
|
|
<input id="search-input">
|
2020-02-27 03:14:10 +00:00
|
|
|
|
<span id="begin-search">search</span>
|
2019-04-27 08:01:38 +00:00
|
|
|
|
</div>
|
|
|
|
|
<div class="search-result-container" id="search-result-container">
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="index-about-mobile">
|
|
|
|
|
<i> </i>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="index-middle">
|
|
|
|
|
<!-- Main Content -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="post-container">
|
|
|
|
|
<div class="post-title">
|
|
|
|
|
利用文件预处理预览/查看/播放一切可下载资源
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="post-meta">
|
2020-02-27 03:14:10 +00:00
|
|
|
|
<span class="attr">Post:<span>2019-06-05 17:55:34</span></span>
|
2019-04-27 08:01:38 +00:00
|
|
|
|
|
2020-02-27 03:14:10 +00:00
|
|
|
|
<span class="attr">Tags:/
|
2019-04-27 08:01:38 +00:00
|
|
|
|
|
2020-03-13 14:56:23 +00:00
|
|
|
|
<a class="tag" href="/uWeb/tags/#termux" title="termux">termux</a>
|
2019-04-27 08:01:38 +00:00
|
|
|
|
<span>/</span>
|
|
|
|
|
|
2020-03-13 14:56:23 +00:00
|
|
|
|
<a class="tag" href="/uWeb/tags/#curl" title="curl">curl</a>
|
2019-04-27 08:01:38 +00:00
|
|
|
|
<span>/</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
<div class="post-content ">
|
|
|
|
|
<p>技巧等级:中级</p>
|
2019-06-05 10:00:15 +00:00
|
|
|
|
<p>文件预处理配置文件为/sdcard/uweb/default.filecap,每行格式如下:<br>[文件后缀]:[mimetype]:[处理命令]</p>
|
|
|
|
|
<p>其中文件后缀可允许最多两段后缀,譬如”txt.xz”,”html.gz”。<br>mimetype表示命令处理后的输出内容格式。<br>处理命令与<a href="../cmd">default.cmds</a>相同,主要可能用到如下替换:<br>%u(网址或文件路径)、%U(编码以后的网址)、%c(当前网址cookie)、%p(密码保护网站中的密码,curl格式)。</p>
|
2019-04-27 08:01:38 +00:00
|
|
|
|
<p>利用文件预处理,<a href="..">超微浏览器</a>现在可以预览/查看/播放一切可下载资源,并且可以利用不同网站在线服务预览不同的文件,而手机上一个应用都不用装。</p>
|
2019-06-05 10:00:15 +00:00
|
|
|
|
<p>配置/sdcard/uweb/default.filecap如下:</p>
|
2019-04-27 08:01:38 +00:00
|
|
|
|
<pre><code>txt:text/html:curl %p "%u"
|
|
|
|
|
mp3:text/html:echo '<audio controls width=100% height=100%><source src="%u"></audio>'
|
|
|
|
|
m4b:text/html:echo '<audio controls width=100% height=100%><source src="%u"></audio>'
|
2019-12-16 01:43:38 +00:00
|
|
|
|
m3u8:text/html:echo '<video controls width=100% height=100%><source src="%u"></video>'
|
2019-04-27 08:01:38 +00:00
|
|
|
|
mp4:text/html:echo '<video controls width=100% height=100%><source src="%u"></video>'
|
|
|
|
|
mkv:text/html:echo '<video controls width=100% height=100%><source src="%u"></video>'
|
|
|
|
|
doc::am start --user 0 -a android.intent.action.VIEW -d 'https://view.officeapps.live.com/op/view.aspx?src=%U'
|
|
|
|
|
xls::am start --user 0 -a android.intent.action.VIEW -d 'https://view.officeapps.live.com/op/view.aspx?src=%U'
|
|
|
|
|
ppt::am start --user 0 -a android.intent.action.VIEW -d 'https://view.officeapps.live.com/op/view.aspx?src=%U'
|
|
|
|
|
docx::am start --user 0 -a android.intent.action.VIEW -d 'https://view.officeapps.live.com/op/view.aspx?src=%U'
|
|
|
|
|
xlsx::am start --user 0 -a android.intent.action.VIEW -d 'https://view.officeapps.live.com/op/view.aspx?src=%U'
|
|
|
|
|
pptx::am start --user 0 -a android.intent.action.VIEW -d 'https://view.officeapps.live.com/op/view.aspx?src=%U'
|
|
|
|
|
xz:text/plain:curl %p "%u"|xz -d --</code></pre>
|
|
|
|
|
|
|
|
|
|
<p>长按窗口按钮,勾选“文件预处理”,重启浏览器。则点击下载按钮时上述文件类型会自动预览。</p>
|
|
|
|
|
<p>如果用户配置中处理命令用到curl,则需要安装<a href="../gnuplot">Termux</a>,并在Termux中安装curl (“apt install curl”)。<br>如果用户不安装Termux,则上述配置命令中的”am”需要全部路径,需用”/system/bin/am”替换。</p>
|
|
|
|
|
<p>以上配置使用了微软服务预览office文档,微软服务必需当前UA为PC,否则会出现空白页面。有条件的用户建议使用google docs (“<a href="http://docs.google.com/gview?embedded=true&url="" target="_blank" rel="noopener">http://docs.google.com/gview?embedded=true&url="</a>) 服务替换。</p>
|
|
|
|
|
<p>若使用手机应用预览文件,则docx处理命令可改为:</p>
|
|
|
|
|
<pre>am start --user 0 -a android.intent.action.VIEW -d "%u" -t "application/docx"</pre>
|
|
|
|
|
|
|
|
|
|
<p>其余常见文件的类型名:<br>application/msword<br>application/msexcel<br>application/pdf</p>
|
|
|
|
|
<p>目前已知服务:<br>google docs, 功能强大,可查看几乎一切文档,但 “我的所爱在山腰,想要得到山太高。”</p>
|
|
|
|
|
<p>微软office, 可预览office文档,ua必须是pc。</p>
|
|
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
<div id="comment-container">
|
|
|
|
|
</div>
|
|
|
|
|
<div id="disqus_thread"></div>
|
|
|
|
|
|
|
|
|
|
<div id="lv-container">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<footer class="footer">
|
|
|
|
|
<ul class="list-inline text-center">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</footer>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
// We expose some of the variables needed by the front end
|
|
|
|
|
window.hexo_search_path = ""
|
2020-03-13 14:56:23 +00:00
|
|
|
|
window.hexo_root = "/uWeb/"
|
2019-04-27 08:01:38 +00:00
|
|
|
|
window.isPost = true
|
|
|
|
|
</script>
|
2020-03-13 14:56:23 +00:00
|
|
|
|
<script src="/uWeb/js/index.js"></script>
|
2019-04-27 08:01:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</html>
|