bugfix
This commit is contained in:
parent
6f2c07909d
commit
10ebb5e070
0
iptv/__init__.py
Normal file
0
iptv/__init__.py
Normal file
@ -10,7 +10,7 @@ from appPublic.streamhttpclient import StreamHttpClient
|
|||||||
from appPublic.uniqueID import getID
|
from appPublic.uniqueID import getID
|
||||||
from appPublic.log import debug
|
from appPublic.log import debug
|
||||||
from sqlor.dbpools import DBPools
|
from sqlor.dbpools import DBPools
|
||||||
import m3u
|
from iptv import m3u
|
||||||
|
|
||||||
async def download(url):
|
async def download(url):
|
||||||
client = StreamHttpClient()
|
client = StreamHttpClient()
|
||||||
|
|||||||
15
iptv/init.py
15
iptv/init.py
@ -1,16 +1,17 @@
|
|||||||
|
from ahserver.serverenv import ServerEnv
|
||||||
from iptv.downloadchannels import load_url_iptv
|
from iptv.downloadchannels import load_url_iptv
|
||||||
from iptv.m3u8test import kickout_badchannels
|
from iptv.m3u8test import kickout_badchannels
|
||||||
|
|
||||||
async def get_channel_by_id(id):
|
async def get_channel_by_id(id):
|
||||||
db = DBPools()
|
db = DBPools()
|
||||||
env = ServerEnv()
|
env = ServerEnv()
|
||||||
dbname = env.get_module_dbname('iptv')
|
dbname = env.get_module_dbname('iptv')
|
||||||
async with db.sqlorContext(dbname) as sor:
|
async with db.sqlorContext(dbname) as sor:
|
||||||
recs = await sor.R('iptvchannels', {'id':id, 'del_flg':'0'})
|
recs = await sor.R('iptvchannels', {'id':id, 'del_flg':'0'})
|
||||||
if len(recs) < 1:
|
if len(recs) < 1:
|
||||||
return None
|
return None
|
||||||
return recs[0]
|
return recs[0]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def load_iptv():
|
def load_iptv():
|
||||||
env = ServerEnv()
|
env = ServerEnv()
|
||||||
|
|||||||
@ -14,7 +14,7 @@ async def test_channels(channels):
|
|||||||
except ClientConnectionError as e:
|
except ClientConnectionError as e:
|
||||||
c.error_code = 499
|
c.error_code = 499
|
||||||
badchannels.append(c)
|
badchannels.append(c)
|
||||||
except Exception as e
|
except Exception as e:
|
||||||
debug(f'{c.url}, {e}')
|
debug(f'{c.url}, {e}')
|
||||||
c.errorcode = x.status_code
|
c.errorcode = x.status_code
|
||||||
badchannels.append(c)
|
badchannels.append(c)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user