Exemple #1
0
    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 vid|cpn
        :return: cid
        """
        # cpn=3 个人点播 cid置为9999
        if len(field) == 2 and is_mg_vod(str(field[1])):
            return [0, 9999]

        # 输入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":
            if str(field[1]) == "2":
                return [0, 9999]
            else:
                return media_vrs_vid_map_client.get_fstlvlid_by_vid([field[0]])

        _res = media_vrs_vid_map_client.get_fstlvlid_by_vid([field[0]])

        if _res[0] == 0:
            cid = str(_res[1])
            if cid in dict_mpp_cid.keys():
                return [0, dict_mpp_cid[cid]]
            else:
                return [0, cid]
        else:
            return _res
Exemple #3
0
    def convert(self, field):
        """
        :param field:  input field plid|cpn|clientver|vid
        :return: clip_id
        """

        # cpn=3 个人点播 plid置为-1
        if len(field) >= 2 and is_mg_vod(str(field[1])):
            return [0, -1]

        # phone 版本5.0.0 以下 通过vid反查
        if len(field) == 4:
            _ver = str(field[2]).lower()
            if "iphone" in _ver or "aphone" in _ver:
                _re_version_num = get_version_num(_ver)

                if _re_version_num[0] != 0:
                    return MediaPLid().convert([field[3]])

                # 待核查确认是否是500
                if _re_version_num[1] < 500 or str(field[1]) == "-":
                    if "iphone-4.9.9" not in _ver:
                        return MediaPLid().convert([field[3]])
            else:
                return MediaPLid().convert([field[3]])

        return media_vrs_clipid_map_client.check_clip_id([field[0]])
    def convert(self, field):
        """
        :param field:  input field cid|cpn|clientver|vid
        :return: cid
        """
        # cpn=3 个人点播 cid置为9999
        if len(field) >= 2 and is_mg_vod(str(field[1])):
            return [0, 9999]

        # 版本校验 MPP

        # phone 版本5.0.0 以下 通过vid反查
        if len(field) == 4:
            _ver = str(field[2]).lower()
            if "iphone" in _ver or "aphone" in _ver:
                _re_version_num = get_version_num(_ver)

                if _re_version_num[0] != 0:
                    return MediaCid().convert([field[3]])

                # 待核查确认是否是500
                if _re_version_num[1] < 500 or str(field[1]) == "-":
                    if "iphone-4.9.9" not in _ver:
                        return MediaCid().convert([field[3]])
            else:
                return MediaCid().convert([field[3]])

        if len(field) == 0:
            return [1, "INPUT_FAILED"]
        if field[0] in dict_mpp_cid.keys():
            return [0, dict_mpp_cid[field[0]]]
        elif field[0] in mpp_cid:
            return [0, field[0]]
        else:
            return media_vrs_fstlvlid_map_client.check_fstlvl_id([field[0]])
Exemple #5
0
    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 vid|cpn
        :return: cid
        """
        # cpn=3 个人点播 cid置为9999
        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]

        _res = media_vrs_vid_map_client.get_clipid_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: 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]])