update
This commit is contained in:
@@ -12,7 +12,7 @@ class SupportSC:
|
||||
LIBRARY_LOADING = False
|
||||
try:
|
||||
sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'libsc'))
|
||||
import support.base.support_sc as support_sc
|
||||
import sc
|
||||
LIBRARY_LOADING = True
|
||||
except:
|
||||
pass
|
||||
@@ -21,8 +21,8 @@ class SupportSC:
|
||||
@classmethod
|
||||
def encode(cls, text, mode=0):
|
||||
try:
|
||||
import support.base.support_sc as support_sc
|
||||
return support_sc.encode(text, mode)
|
||||
import sc
|
||||
return sc.encode(text, mode)
|
||||
except Exception as e:
|
||||
logger.error(f'Exception:{str(e)}')
|
||||
logger.error(traceback.format_exc())
|
||||
@@ -32,16 +32,16 @@ class SupportSC:
|
||||
@classmethod
|
||||
def decode(cls, text):
|
||||
try:
|
||||
import support.base.support_sc as support_sc
|
||||
return support_sc.decode(text)
|
||||
import sc
|
||||
return sc.decode(text)
|
||||
except:
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def load_module(cls, module_name, module_code):
|
||||
try:
|
||||
import support.base.support_sc as support_sc
|
||||
mod = support_sc.load_module(module_name, module_code)
|
||||
import sc
|
||||
mod = sc.load_module(module_name, module_code)
|
||||
sys.modules[mod] = mod
|
||||
logger.warning(f"C-LOADING : {module_name}")
|
||||
return mod
|
||||
@@ -65,8 +65,8 @@ class SupportSC:
|
||||
@classmethod
|
||||
def td(self, mediacode, ts, url):
|
||||
try:
|
||||
import support.base.support_sc as support_sc
|
||||
ret = support_sc.td1(mediacode, str(ts), url).strip()
|
||||
import sc
|
||||
ret = sc.td1(mediacode, str(ts), url).strip()
|
||||
ret = re.sub('[^ -~]+', '', ret).strip()
|
||||
return ret
|
||||
except:
|
||||
|
||||
Reference in New Issue
Block a user