增加直播转换工具
This commit is contained in:
parent
a4068725a6
commit
41e6793919
@ -596,4 +596,10 @@ def admin_lives_web():
|
||||
print(lives)
|
||||
lsg = storage_service()
|
||||
zb_player = lsg.getItem('ZB_PLAYER','1')
|
||||
return render_template('lives.html',ver=getLocalVer(),lives=lives,zb_player=zb_player)
|
||||
return render_template('lives.html',ver=getLocalVer(),lives=lives,zb_player=zb_player)
|
||||
|
||||
@admin.route('/tools')
|
||||
def admin_tools():
|
||||
if not verfy_token():
|
||||
return R.failed('请登录后再试')
|
||||
return render_template('tools.html', ver=getLocalVer())
|
||||
@ -1,3 +1,6 @@
|
||||
###### 2023/11/25
|
||||
- [X] 3.9.49beta8 增加直播转换小工具
|
||||
|
||||
###### 2023/11/23
|
||||
- [X] 3.9.49beta6 检测升级逻辑优化,增加强制下载逻辑开关
|
||||
- [X] 3.9.49beta7 增加网页直播的播放器选择功能
|
||||
|
||||
@ -1 +1 @@
|
||||
3.9.49beta7
|
||||
3.9.49beta8
|
||||
1
static/js/pinyin-pro.js
Normal file
1
static/js/pinyin-pro.js
Normal file
File diff suppressed because one or more lines are too long
282
static/js/tools.js
Normal file
282
static/js/tools.js
Normal file
File diff suppressed because one or more lines are too long
@ -313,9 +313,13 @@
|
||||
location.href = '/admin/lives'
|
||||
});
|
||||
$('#lives_web').click(function () {
|
||||
location.href = '/admin/lives_web'
|
||||
open('/admin/lives_web');
|
||||
});
|
||||
|
||||
$('#live_tools').click(function (){
|
||||
open('/admin/tools');
|
||||
})
|
||||
|
||||
$("summary").click(function() {
|
||||
// console.log('summary被点击');
|
||||
const details = $('details');
|
||||
@ -380,6 +384,7 @@
|
||||
<li><a href="javascript:void(0);" class="funcbtn" id="use_py">已{% if pystate=='1' %}启用{% else %}关闭{% endif %}py源</a></li>
|
||||
<li><a href="javascript:void(0);" class="funcbtn" id="lives">直播源列表</a></li>
|
||||
<li><a href="javascript:void(0);" class="funcbtn" id="lives_web">网页在线直播</a></li>
|
||||
<li><a href="javascript:void(0);" class="funcbtn" id="live_tools">转换工具</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
|
||||
241
templates/tools.html
Normal file
241
templates/tools.html
Normal file
@ -0,0 +1,241 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>drpy小工具-{{ver}}</title>
|
||||
<meta name="description" content="particles.js is a lightweight JavaScript library for creating particles.">
|
||||
<meta name="author" content="道长"/>
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<link rel="stylesheet" media="screen" href="/static/css/admin.css">
|
||||
<link rel="icon" href="/static/img/logo.png" type="image/x-icon">
|
||||
<script src="/static/js/jquery.min.js"></script>
|
||||
<script src="/static/js/common.js"></script>
|
||||
<script src="/static/js/grey.js"></script>
|
||||
<link rel="stylesheet" href="/static/plugin/layui/css/layui.css">
|
||||
<script src="/static/plugin/layui/layui.js"></script>
|
||||
<script src="/static/js/pinyin-pro.js"></script>
|
||||
<script src="/static/js/tools.js"></script>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.long_text {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
overflow-x: scroll;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.hide{
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
function init() {
|
||||
var dest = document.getElementById("source");
|
||||
dest.addEventListener("dragover", function (ev) {
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
}, false);
|
||||
|
||||
dest.addEventListener("dragend", function (ev) {
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
}, false);
|
||||
|
||||
dest.addEventListener("drop", function (ev) {
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
|
||||
var file = ev.dataTransfer.files[0];
|
||||
var reader = new FileReader();
|
||||
|
||||
if (file.type.substr(0, 4) != "text") {
|
||||
dest.innerHTML = "暂不支持此类文件的预览";
|
||||
dest.style.background = "white";
|
||||
} else if (file.type.substr(0, 4) == "text") {
|
||||
|
||||
reader.readAsText(file);
|
||||
reader.onload = function (f) {
|
||||
dest.innerHTML = "<pre>" + this.result + "</pre>";
|
||||
dest.style.background = "white";
|
||||
}
|
||||
} else {
|
||||
dest.innerHTML = "暂不支持此类文件的预览";
|
||||
dest.style.background = "white";
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
//设置页面属性,不执行默认处理(拒绝被拖放)
|
||||
document.ondragover = function (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
;
|
||||
document.ondrop = function (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
window.onload = init;
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function dl() {
|
||||
const data = document.getElementById("res").innerHTML.replace(/<br>/g, '\n');
|
||||
if (data.indexOf("EXTM3U") != -1) {
|
||||
var tt = "m3u"
|
||||
} else {
|
||||
var tt = "txt"
|
||||
}
|
||||
const blob = new Blob([data], {
|
||||
type: "text/plain"
|
||||
})
|
||||
const a = document.createElement("a")
|
||||
a.href = URL.createObjectURL(blob)
|
||||
a.download = "yourtv." + tt
|
||||
a.click()
|
||||
URL.revokeObjectURL(a.href)
|
||||
a.remove();
|
||||
}
|
||||
|
||||
function copyText() {
|
||||
var text = document.getElementById("res").innerHTML;
|
||||
var input = document.createElement('textarea')
|
||||
input.innerHTML = text.replace(/<br>/g, "\n")
|
||||
input.setAttribute('readonly', 'readonly')
|
||||
document.body.appendChild(input)
|
||||
input.select();
|
||||
//选中文本
|
||||
document.execCommand("copy");
|
||||
document.body.removeChild(input);
|
||||
layer.msg('复制成功');
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function readSingleFile(e) {
|
||||
var file = e.target.files[0];
|
||||
if (!file) {
|
||||
return;
|
||||
}
|
||||
var reader = new FileReader();
|
||||
reader.onload = function (e) {
|
||||
var contents = e.target.result;
|
||||
displayContents(contents);
|
||||
}
|
||||
;
|
||||
reader.readAsText(file);
|
||||
}
|
||||
|
||||
function displayContents(contents) {
|
||||
var element = document.getElementById('source');
|
||||
element.textContent = contents;
|
||||
}
|
||||
|
||||
window.onload = function () {
|
||||
document.getElementById('file-input').addEventListener('change', readSingleFile, false);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="layui-form layuimini-form layuimini-container layui-form-pane container" lay-filter="scripts">
|
||||
<div class="layui-tab">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this">直播转换工具</li>
|
||||
<li>更多</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<input type="file" id="file-input" class="layui-hide"/>
|
||||
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
|
||||
<legend>直播类文本文件上传(txt|m3u8|m3u)文件</legend>
|
||||
<legend id="file_info"></legend>
|
||||
</fieldset>
|
||||
|
||||
<div class="layui-btn-container">
|
||||
<button type="button" class="layui-btn" id="file_select"><i class="layui-icon"></i>上传文件
|
||||
</button>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label" for="action">超级直播格式</label>
|
||||
<div class="layui-input-block">
|
||||
<select id="action" name="action" lay-filter="action">
|
||||
<!-- <option value=""></option>-->
|
||||
<option>112114-muziling</option>
|
||||
<option>112114-yuanban</option>
|
||||
<option>tvming-yuanban</option>
|
||||
<option>cntv-yuanban</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item layui-form-text">
|
||||
<div class="layui-input-block">
|
||||
<label class="layui-form-label required" for="source">文本区域</label>
|
||||
<textarea id="source" name="source" class="layui-textarea"
|
||||
placeholder="请粘贴文本内容"
|
||||
rows='16' cols='86'></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<button type="button" class="layui-btn layui-btn-normal" onclick="trans()">超级直播</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal" onclick="tran2m3u()">m3u格式</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal" onclick="tran2m3ugroup()">m3u分组</button>
|
||||
<button type="button" class="layui-btn layui-btn-normal" onclick="m3u2txt()">m3u2txt</button>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="layui-form-item">
|
||||
<button class="layui-btn hide" id="copytext" onclick="copyText()">一键复制</button>
|
||||
<button class="layui-btn hide" id="downtext" onclick="dl()">一键下载</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p id="res" name="res" class="long_text"></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="layui-tab-item">
|
||||
<h3>更多功能开发中...</h3>
|
||||
<hr/>
|
||||
<h3>下方是推荐链接</h3>
|
||||
<p class="layui-elem-quote"><a href="https://guihet.com/tvlistconvert.html" target="_blank">黑鸟博客转换工具</a></p>
|
||||
<p class="layui-elem-quote"><a href="https://wwi.lanzoup.com/i3CCw1fxlxla" target="_blank">IPTV Checker</a></p>
|
||||
<p class="layui-elem-quote"><a href="https://epg.112114.xyz/" target="_blank">EPG小工具</a></p>
|
||||
<p class="layui-elem-quote"><a href="http://epg.51zmt.top:8000/" target="_blank">EPG节目信息</a></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['upload', 'element', 'layer'], function () {
|
||||
var $ = layui.jquery
|
||||
, upload = layui.upload
|
||||
, element = layui.element
|
||||
, layer = layui.layer;
|
||||
|
||||
$('#file_select').click(function () {
|
||||
$('#file-input').click();
|
||||
});
|
||||
|
||||
$('#file-input').change(function () {
|
||||
//获取选择的文件信息
|
||||
let file = this.files[0];
|
||||
//执行上传操作
|
||||
if (file) {
|
||||
console.log(file);
|
||||
$('#file_info').text(`文件名:${file.name},体积:${(file.size / 1024).toFixed(2)}kb`);
|
||||
} else {
|
||||
$('#file_info').text('未选择文件');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
3303
txt/lives/zb_drpy.m3u
Normal file
3303
txt/lives/zb_drpy.m3u
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user