diff --git a/crawl/spiders/__init__.py b/crawl/spiders/__init__.py index 511755e..13946ff 100644 --- a/crawl/spiders/__init__.py +++ b/crawl/spiders/__init__.py @@ -21,13 +21,13 @@ from crawl.spiders.gxntv import get_epgs_gxntv,get_channels_gxntv from utils.general import chuanliu_Authorization epg_funcs = { - 'tvmao':get_epgs_tvmao2, - 'tbc':get_epgs_tbc, - 'cctv':get_epgs_cctv, - 'zhongshu':get_epgs_zhongshu, - 'cabletv':get_epgs_cabletv, - 'tvsou':get_epgs_tvsou, - '4gtv':get_epgs_4gtv, + 'tvmao' :get_epgs_tvmao2, + 'tbc' :get_epgs_tbc, + 'cctv' :get_epgs_cctv, + 'zhongshu' :get_epgs_zhongshu, + 'cabletv' :get_epgs_cabletv, + 'tvsou' :get_epgs_tvsou, + '4gtv' :get_epgs_4gtv, 'mod':get_epgs_mod, 'tvb':get_epgs_tvb, 'nowtv':get_epgs_nowtv, @@ -49,66 +49,66 @@ 'tvsou':get_channels_tvsou, '4gtv':get_channels_4gtv, 'mod':get_channels_mod, - 'tvb':get_channels_tvb, - 'nowtv':get_channels_nowtv, - 'icable':get_channels_icable, - 'gdtv':get_channels_gdtv, - 'btv':get_channels_btv, - 'hks':get_channels_hks, - 'viu':get_channels_viu, - 'chuanliu':get_channels_chuanliu, - 'mytvsuper':get_channels_mytvsuper, - 'gxntv':get_channels_gxntv, + 'tvb' :get_channels_tvb, + 'nowtv' :get_channels_nowtv, + 'icable' :get_channels_icable, + 'gdtv' :get_channels_gdtv, + 'btv' :get_channels_btv, + 'hks' :get_channels_hks, + 'viu' :get_channels_viu, + 'chuanliu' :get_channels_chuanliu, + 'mytvsuper' :get_channels_mytvsuper, + 'gxntv' :get_channels_gxntv, } func_args = { - 'tvmao':0, - 'tbc':0, - 'cctv':0, - 'zhongshu':0, - 'cabletv':0, - 'tvsou':0, - '4gtv':0, - 'mod':0, - 'tvb':0, - 'nowtv':0, - 'icable':0, - 'gdtv':0, - 'btv':0, - 'hks':0, - 'viu':0, - 'chuanliu':chuanliu_Authorization, - 'mytvsuper':0, - 'gxntv':0, + 'tvmao' : 0 , + 'tbc' : 0 , + 'cctv' : 0 , + 'zhongshu' : 0 , + 'cabletv' : 0 , + 'tvsou' : 0 , + '4gtv' : 0 , + 'mod' : 0 , + 'tvb' : 0 , + 'nowtv' : 0 , + 'icable' : 0 , + 'gdtv' : 0 , + 'btv' : 0 , + 'hks' : 0 , + 'viu' : 0 , + 'chuanliu' :chuanliu_Authorization, + 'mytvsuper' : 0 , + 'gxntv' : 0 , } -def epg_func(channel,id,dt,func_arg=0,source = 0): +def epg_func ( channel,id,dt,func_arg= 0 ,source = 0 ) : if source: source1 = source - else: - source1 = channel.source - func_arg = func_args[source1] #if func_arg else func_arg - return epg_funcs[source1](channel,id,dt,func_arg) + else : + source1 = channel. source + func_arg = func_args [ source1 ] #if func_arg else func_arg + return epg_funcs [ source1 ] ( channel,id,dt,func_arg ) -__all__ = ['get_epgs_4gtv', - 'get_epgs_btv', - 'get_epgs_cabletv', - 'get_epgs_cctv', - 'get_epgs_gdtv', - 'get_epgs_icable', - 'get_epgs_mod', - 'get_epgs_nowtv', - 'get_epgs_tbc', - 'get_epgs_tvb', - 'get_epgs_tvmao2', - 'get_epgs_zhongshu', - 'get_epgs_tvsou', - 'get_epgs_hks', - 'get_epgs_viu', - 'get_epgs_chuanliu', - 'get_epgs_mytvsuper', - 'get_epgs_gxntv, - 'epg_funcs', - 'func_args', - 'epg_func', +__all__ = [ 'get_epgs_4gtv' , + 'get_epgs_btv' , + 'get_epgs_cabletv' , + 'get_epgs_cctv' , + 'get_epgs_gdtv' , + 'get_epgs_icable' , + 'get_epgs_mod' , + 'get_epgs_nowtv' , + 'get_epgs_tbc' , + 'get_epgs_tvb' , + 'get_epgs_tvmao2' , 'get_epgs_tvmao2' , + 'get_epgs_zhongshu' , + 'get_epgs_tvsou' , + 'get_epgs_hks' , + 'get_epgs_viu' , + 'get_epgs_chuanliu' , + 'get_epgs_mytvsuper' , + 'get_epgs_gxntv' , + 'epg_funcs' , + 'func_args' , + 'epg_func' , ]