Compare commits
No commits in common. "05dbeff1ae4a98e748fdd6c208c40b88a726edcf" and "5883ce8c82bea819800772e28a67c751d70c99fa" have entirely different histories.
05dbeff1ae
...
5883ce8c82
@ -36,7 +36,7 @@ async def check_if_exists(url):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
async def write_badchannel(b):
|
async def write_goodchannel(b):
|
||||||
debug(f'write badchannels({b.url})')
|
debug(f'write badchannels({b.url})')
|
||||||
env = ServerEnv()
|
env = ServerEnv()
|
||||||
dbname = env.get_module_dbname('iptv')
|
dbname = env.get_module_dbname('iptv')
|
||||||
@ -62,57 +62,6 @@ async def write_badchannel(b):
|
|||||||
${url}$,
|
${url}$,
|
||||||
${media_type}$,
|
${media_type}$,
|
||||||
${download_date}$,
|
${download_date}$,
|
||||||
'1'
|
|
||||||
)"""
|
|
||||||
r = b.copy()
|
|
||||||
r['media_type'] = 'iptv'
|
|
||||||
r['id'] = getID()
|
|
||||||
if not r.get('tv_group'):
|
|
||||||
r['tv_group'] = r.get('group-title','')[:500]
|
|
||||||
if not r.get('tv_name'):
|
|
||||||
r['tv_name'] = r.get('name','')[:500]
|
|
||||||
if not r.get('logo_url'):
|
|
||||||
r['logo_url'] = r.get('tvg-logo',None)
|
|
||||||
if r['logo_url'] and len(r['logo_url']) > 1000:
|
|
||||||
r['logo_url'] = None
|
|
||||||
if len(r['url']) >= 1000:
|
|
||||||
return
|
|
||||||
dt = datetime.now()
|
|
||||||
r['download_date'] = '%d-%02d-%02d' % (dt.year,dt.month,dt.day)
|
|
||||||
await sor.sqlExe(sql,r)
|
|
||||||
await sor.C('badchannels', {
|
|
||||||
'id': getID(),
|
|
||||||
'channelid': r['id']
|
|
||||||
})
|
|
||||||
|
|
||||||
async def write_goodchannel(b):
|
|
||||||
debug(f'write goodchannels({b.url})')
|
|
||||||
env = ServerEnv()
|
|
||||||
dbname = env.get_module_dbname('iptv')
|
|
||||||
db = DBPools()
|
|
||||||
async with db.sqlorContext(dbname) as sor:
|
|
||||||
sql = """insert into iptvchannels
|
|
||||||
(
|
|
||||||
id,
|
|
||||||
tv_group,
|
|
||||||
tv_name,
|
|
||||||
logo_url,
|
|
||||||
url,
|
|
||||||
media_type,
|
|
||||||
channel_delay,
|
|
||||||
download_date,
|
|
||||||
del_flg
|
|
||||||
)
|
|
||||||
values
|
|
||||||
(
|
|
||||||
${id}$,
|
|
||||||
${tv_group}$,
|
|
||||||
${tv_name}$,
|
|
||||||
${logo_url}$,
|
|
||||||
${url}$,
|
|
||||||
${media_type}$,
|
|
||||||
${channel_delay}$,
|
|
||||||
${download_date}$,
|
|
||||||
'0'
|
'0'
|
||||||
)"""
|
)"""
|
||||||
query = """select * from iptvchannels where url=${url}$"""
|
query = """select * from iptvchannels where url=${url}$"""
|
||||||
@ -146,9 +95,7 @@ async def load_url_iptv(url):
|
|||||||
|
|
||||||
if len(newchannels) > 0:
|
if len(newchannels) > 0:
|
||||||
debug('%d new channels' % len(newchannels))
|
debug('%d new channels' % len(newchannels))
|
||||||
good, bad = await test_channels(newchannels,
|
good, bad = await test_channels(newchannels, if_ok=write_goodchannel)
|
||||||
if_failed=write_badchannel,
|
|
||||||
if_ok=write_goodchannel)
|
|
||||||
debug(f'{len(good)} new channels add {len(bad)} channels exists')
|
debug(f'{len(good)} new channels add {len(bad)} channels exists')
|
||||||
else:
|
else:
|
||||||
debug(f'{url} return None')
|
debug(f'{url} return None')
|
||||||
|
|||||||
43
wwwroot/channelinfo.ui
Normal file
43
wwwroot/channelinfo.ui
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"widgettype":"HBox",
|
||||||
|
"options":{
|
||||||
|
"cwidth":22,
|
||||||
|
"cheight":3
|
||||||
|
},
|
||||||
|
"subwidgets":[
|
||||||
|
{
|
||||||
|
"widgettype":"Image",
|
||||||
|
"options":{
|
||||||
|
"cwidth":1.5,
|
||||||
|
"cheight":1,5,
|
||||||
|
"url":"{{params_kw.logo_url}}",
|
||||||
|
"default_url":"{{entire_url('/imgs/tv.png')}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widgettype":"Title6",
|
||||||
|
"options":"{
|
||||||
|
"css":"filler",
|
||||||
|
"text":"{{params_kw.tv_name}}",
|
||||||
|
"wrap":true,
|
||||||
|
"halign":"left"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
"binds":[
|
||||||
|
{
|
||||||
|
"wid":"self",
|
||||||
|
"event":"click",
|
||||||
|
"actiontype":"urlwidgt",
|
||||||
|
"target":"PopupWindow",
|
||||||
|
"popup_options":{
|
||||||
|
},
|
||||||
|
"options":{
|
||||||
|
"params":{
|
||||||
|
"id":"{{params_kw.id}}"
|
||||||
|
},
|
||||||
|
"url":"{{params_kw.click_url or entire_url('play.ui')}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
56
wwwroot/channels.ui
Normal file
56
wwwroot/channels.ui
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
{
|
||||||
|
"id":"channel_list",
|
||||||
|
"widgettype":"Tabular",
|
||||||
|
"options":{
|
||||||
|
"data_url":"{{entire_url('/api/channels.dspy')}}",
|
||||||
|
"noheader":true,
|
||||||
|
"row_options":{
|
||||||
|
"fields":[
|
||||||
|
{
|
||||||
|
"name":"logo_url",
|
||||||
|
"cwidth":2,
|
||||||
|
"cheight":2,
|
||||||
|
"uitype":"icon",
|
||||||
|
"label":"Icon",
|
||||||
|
"value":"${logo_url}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name":"tv_name",
|
||||||
|
"uitype":"str",
|
||||||
|
"lable":"Channel",
|
||||||
|
"cwidth":50,
|
||||||
|
"value":"${tv_name}"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"alters":{
|
||||||
|
"logo_url":{
|
||||||
|
"cwidth":2.5
|
||||||
|
},
|
||||||
|
"tv_name":{
|
||||||
|
"cwidth":20
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"cheight":2.5,
|
||||||
|
"width":"100%"
|
||||||
|
},
|
||||||
|
"page_rows":80,
|
||||||
|
"cache_limit":5
|
||||||
|
},
|
||||||
|
"binds":[
|
||||||
|
{
|
||||||
|
"wid":"self",
|
||||||
|
"event":"row_selected",
|
||||||
|
"actiontype":"urlwidget",
|
||||||
|
"target":"PopupWindow",
|
||||||
|
"popup_options":{
|
||||||
|
"archor":"cc",
|
||||||
|
"width":"90%",
|
||||||
|
"height":"90%"
|
||||||
|
},
|
||||||
|
"options":{
|
||||||
|
"url":"{{entire_url('play.ui')}}",
|
||||||
|
"params":{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"widgettype":"MdWidget",
|
|
||||||
"options":{
|
|
||||||
"md_url":"{{entire_url('iptvsource.md')}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
1
wwwroot/index.dspy
Normal file
1
wwwroot/index.dspy
Normal file
@ -0,0 +1 @@
|
|||||||
|
return "noting in here"
|
||||||
34
wwwroot/index.old.ui
Normal file
34
wwwroot/index.old.ui
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"widgettype":"VBox",
|
||||||
|
"options":{
|
||||||
|
"width":"100%",
|
||||||
|
"height":"100%"
|
||||||
|
},
|
||||||
|
"subwidgets":[
|
||||||
|
{
|
||||||
|
"widgettype":"urlwidget",
|
||||||
|
"options":{
|
||||||
|
"url":"{{entire_url('header.ui')}}"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":"center",
|
||||||
|
"widgettype":"Filler",
|
||||||
|
"options":{},
|
||||||
|
"subwidgets":[
|
||||||
|
{
|
||||||
|
"widgettype":"urlwidget",
|
||||||
|
"options":{
|
||||||
|
"url":"{{entire_url('iptv.ui')}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widgettype":"urlwidget",
|
||||||
|
"options":{
|
||||||
|
"url":"{{entire_url('bottom.ui')}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
wwwroot/newest/.index.ui.swp
Normal file
BIN
wwwroot/newest/.index.ui.swp
Normal file
Binary file not shown.
11
wwwroot/play_with_channelid.ui
Normal file
11
wwwroot/play_with_channelid.ui
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{% set d = get_channel_by_id(id) %}
|
||||||
|
{
|
||||||
|
"id":"myplayer",
|
||||||
|
"widgettype":"Video",
|
||||||
|
"options":{
|
||||||
|
"channel_id":"{{d.id}}",
|
||||||
|
"title":"{{d.tv_name}}"
|
||||||
|
"type":"application/x-mpegURL",
|
||||||
|
"url":"{{d.url}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -28,7 +28,7 @@
|
|||||||
"label":"搜索频道",
|
"label":"搜索频道",
|
||||||
"url":"{{entire_url('iptvchannels.ui')}}"
|
"url":"{{entire_url('iptvchannels.ui')}}"
|
||||||
},
|
},
|
||||||
{% if int(params_kw._is_mobile) == 0 %}
|
{% if params_kw._is_mobile != '1' %}
|
||||||
{
|
{
|
||||||
"name":"tv_mode",
|
"name":"tv_mode",
|
||||||
"label":"电视模式",
|
"label":"电视模式",
|
||||||
|
|||||||
@ -1,46 +0,0 @@
|
|||||||
{
|
|
||||||
"widgettype":"IconbarPage",
|
|
||||||
"options":{
|
|
||||||
"bar_at": "top",
|
|
||||||
"bar_opts":{
|
|
||||||
"margin": "10px",
|
|
||||||
"rate":1.5,
|
|
||||||
"tools":[
|
|
||||||
{
|
|
||||||
"name":"channelsearch",
|
|
||||||
"icon":"{{entire_url('/imgs/channelsearch.svg')}}",
|
|
||||||
"tip":"Search Channel by enter channel name",
|
|
||||||
"dynsize": true,
|
|
||||||
"content":{
|
|
||||||
"widgettype":"urlwidget",
|
|
||||||
"options":{
|
|
||||||
"url":"{{entire_url('searchchannels')}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},{
|
|
||||||
"name":"newestchannels",
|
|
||||||
"icon":"{{entire_url('/imgs/newestchannels.svg')}}",
|
|
||||||
"tip":"show newest channels",
|
|
||||||
"dynsize": true,
|
|
||||||
"content":{
|
|
||||||
"widgettype":"urlwidget",
|
|
||||||
"options":{
|
|
||||||
"url":"{{entire_url('newest')}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
"name":"declare",
|
|
||||||
"icon":"{{entire_url('/imgs/declare.svg')}}",
|
|
||||||
"tip":"show declaration",
|
|
||||||
"dynsize": true,
|
|
||||||
"content":{
|
|
||||||
"widgettype":"urlwidget",
|
|
||||||
"options":{
|
|
||||||
"url":"{{entire_url('declare.ui')}}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user