def convert(self, field): """ :param field: input field data(vid) :return: plid """ if len(field) < 1: return [1, "input_err"] # cpn=3 个人点播 cid置为9999 if len(field) >= 2 and is_mg_vod(str(field[1])): return [0, 9999] # 当vid大于1亿时, 表示是关系id, 需要通过改vid反查cid if str(field[0]).isdigit() and int(field[0]) > 100000000: _res = media_cms_playlist_vid_map_client.get_vid_by_rid([field[0]]) if _res[0] == 0: field[0] = _res[1] else: return _res _res = mpp_cms_id_map_client.get_c_id_by_vid([field[0]]) if _res[0] != 0: return [0, "-1"] else: return _res
def convert(self, field): """ :param field: input field data(vid) :return: plid """ if len(field) < 1: return [1, "input_err"] # 当vid大于1亿时, 表示是关系id, 需要通过改id查询vid、bdid if str(field[0]).isdigit() and int(field[0]) > 100000000: _res = media_cms_playlist_vid_map_client.get_vid_by_rid([field[0]]) if _res[0] == 0: field[0] = _res[1] else: return _res return mpp_cms_id_map_client.get_vts_by_vid(field)
def convert(self, field): """ 用于移动端离线 通过fpid是否大于99990000 :param field: input field data(vid) :return: plid """ if len(field) < 1: return [1, "input_err"] if str(field[0]).isdigit() and int(field[0]) > 100000000: _res = media_cms_playlist_vid_map_client.get_vid_by_rid([field[0]]) if _res[0] == 0: field[0] = _res[1] else: return _res _res = mpp_cms_id_map_client.get_p_lid_by_vid(field) if _res[0] == 0: return _res else: return [0, "-1"]
def convert(self, field): """ :param field: input field data([vid, cpn]) :return: vid """ if len(field) == 2 and is_mg_vod(str(field[1])): return media_mg_media_id_client.get_mid_by_media_id([field[0]]) # 输入3个参数、[vid|mt|bid] bid=24.1.1.0 专题活动vv mt为2芒果直播媒资 vts置为-1 if len(field) == 3 and str(field[2]) == "24.1.1.0" and str(field[1]) == "2": return media_mg_media_id_client.get_mid_by_media_id([field[0]]) elif len(field) == 3 and str(field[2]) != "24.1.1.0": if is_mg_vod(str(field[1]) or str(field[2]) == "5"): return media_mg_media_id_client.get_mid_by_media_id([field[0]]) # 当vid大于1亿时, 表示是关系id, 需要通过改id查询vid、bdid if str(field[0]).isdigit() and int(field[0]) > 100000000: _res = media_cms_playlist_vid_map_client.get_vid_by_rid([field[0]]) if _res[0] == 0: field[0] = _res[1] else: return _res return media_vrs_vid_map_client.check_vid([field[0]])
def convert(self, field): """ :param field: input field data(vid) :return: is_full """ # cpn=3 个人点播 is_full置为-1 if len(field) == 2 and is_mg_vod(str(field[1])): return [0, -1] # 输入3个参数、[vid|mt|bid] bid=24.1.1.0 专题活动vv mt为2芒果直播媒资 vts置为-1 if len(field) == 3 and str(field[2]) == "24.1.1.0" and str( field[1]) == "2": return [0, -1] # 当vid大于1亿时, 表示是关系id, 需要通过改id查询vid、bdid if str(field[0]).isdigit() and int(field[0]) > 100000000: _res = media_cms_playlist_vid_map_client.get_vid_by_rid([field[0]]) if _res[0] == 0: field[0] = _res[1] else: return _res return media_vrs_vid_map_client.get_is_full_by_vid([field[0]])