curl on http://jamesfengcao.gitee.io/uweb/tags/curl/ Recent content in curl on Hugo -- gohugo.io en-us 利用文件预处理预览/查看/播放一切可下载资源 http://jamesfengcao.gitee.io/uweb/filecap/ Mon, 01 Jan 0001 00:00:00 +0000 http://jamesfengcao.gitee.io/uweb/filecap/ 技巧等级:中级 文件预处理配置文件为/sdcard/uweb/default.filecap,每行格式如下: [文件后缀]:[mimetype]:[处理命令] 其中文件后缀可允许最多两段后缀,譬如"txt.xz","html.gz"。 mimetype表示命令处理后的输出内容格式。 处理命令与default.cmds相同,主要可能用到如下替换: %u(网址或文件路径)、%U(编码以后的网址)、%c(当前网址cookie)、%p(密码保护网站中的密码,curl格式)。 利用文件预处理,超微浏览器现在可以预览/查看/播放一切可下载资源,并且可以利用不同网站在线服务预览不同的文件,而手机上一个应用都不用装。 配置/sdcard/uweb/default.filecap如下: 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' m3u8:text/html:echo '<video controls width=100% height=100%<source src="%u"</video' 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.