コード例 #1
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
def checkV1CommentDetailJson(res):
    #v1commentdetailcheck
    checkV1CommentData(res, ['code', 'data', 'message'])
    checkV1CommentData(res["data"], ['hide', 'comment'])
    checkV1CommentData(res["data"]["comment"], ['commentList', 'pageModel'])
    for i in res["data"]["comment"]["commentList"]:
        checkV1CommentData(i, [
            '_id', 'titleNo', 'episodeNo', 'categoryId', 'imageNo', 'contents',
            'createTime', 'modifyTime', 'replyCount', 'neoId', 'deleted',
            'likeCount', 'unLikeCount', 'forbid', 'visible', 'objectId',
            'commentType', 'deleteDescription', 'secret', 'extra_status',
            'extra_content_spam_status', 'ip', '__v', 'best',
            'replyCommentList', 'userName', 'userCertType'
        ])
    checkV1CommentData(res["data"]["comment"]['pageModel'], [
        'page', 'pageSize', 'startRow', 'endRow', 'totalRows',
        'showTotalCount', 'totalPages', 'prevPage', 'nextPage'
    ])
    if res["data"]["comment"].get("bestList", None):
        for i in res["data"]["comment"]['bestList']:
            checkV1CommentData(i, [
                '_id', 'titleNo', 'episodeNo', 'categoryId', 'imageNo',
                'contents', 'createTime', 'modifyTime', 'replyCount', 'neoId',
                'deleted', 'likeCount', 'unLikeCount', 'forbid', 'visible',
                'userType', 'objectId', 'commentNo', 'commentType',
                'deleteDescription', 'secret', '__v', 'best',
                'replyCommentList', 'userName', 'userCertType'
            ])

    logger.info("checkV1CommentDetailJson")
コード例 #2
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
def checkV2Comment(titleNo,
                   episodeNo,
                   imageNo="",
                   pageNo=1,
                   sortBy="",
                   limit=20):
    result = v2Comment(titleNo, episodeNo, imageNo, pageNo, sortBy, limit)
    if result["code"] == 200:
        count = result["data"]["count"]
        commentList = result["data"]["commentList"]
        pageNo = 2
        for i in range(0, count // limit):
            res = v2Comment(titleNo, episodeNo, imageNo, pageNo + i, sortBy,
                            limit)
            if res["code"] == 200:
                commentList.extend(res["data"]["commentList"])
        for i in commentList:
            checkV1CommentData(i, [
                '_id', 'titleNo', 'episodeNo', 'categoryId', 'imageNo',
                'contents', 'createTime', 'modifyTime', 'replyCount', 'neoId',
                'deleted', 'likeCount', 'unLikeCount', 'forbid', 'visible',
                'objectId', 'commentType', 'deleteDescription', 'secret',
                'extra_status', 'clientType', 'extra_content_spam_status',
                'ip', '__v', 'best', 'commentReplyList', 'like', 'userName',
                'userCertType'
            ])
    logger.info("checkV2Comment")
コード例 #3
0
def login(username, passwd, loginType="EMAIL"):  ##PHONE_NUMBER
    path = "/app/member/id/login"
    ne = appRsakeyGet()
    if ne:
        try:
            encpw = rsaEnc(ne[2], ne[1], ne[3], mobile=username, passwd=passwd)
            encnm = ne[0]
            plus = {
                "loginType": loginType,
                "encnm": encnm,
                "encpw": encpw,
                "v": 1
            }
            plus.update(Config("baseparams"))
            resp = requests.post(Config("httphost") + path,
                                 headers=Config("headers"),
                                 data=plus,
                                 params=getExpiresMd5(path))
            resp_json = resp.json()
            logger.info(resp.url)
            neo_ses = resp_json["message"]["result"]["ses"]
            neo_id = resp_json["message"]["result"]["id_no"]
            updateConfig("neo_ses", neo_ses)
            updateConfig("neo_id", neo_id)
            return neo_ses, resp_json["message"]["result"]["idNo"]
        except Exception:
            logger.exception("login出现异常")
            logger.error(resp.url)
            logger.error(resp.text)
            # logger.error(resp.headers)
            return False
    else:
        return False
コード例 #4
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
def v2Comment(titleNo, episodeNo, imageNo="", pageNo="", sortBy="", limit=""):
    path = "/v2/comment"
    payload = {
        "titleNo": titleNo,
        "episodeNo": episodeNo,
        "imageNo": imageNo,
        "pageNo": pageNo,
        "sortBy": sortBy,
        "limit": limit
    }
    payload.update(Config("baseparams"))
    payload.update(getExpiresMd5(path))
    try:
        resp = requests.get(Config("httphost") + path,
                            params=payload,
                            headers=Config("headers"),
                            cookies=Config("cookies"))
        logger.info(resp.url)
        if resp.ok:
            result = resp.json()
            if result["code"] == 200:
                pass
                # logger.info(result.keys())
                # logger.info(result["data"].keys())
                # logger.info(result["data"]["commentList"][0].keys())
                # logger.info(result["data"]["commentList"][0]["commentReplyList"][0].keys())
                # logger.info(result["data"]["bestList"][0].keys())
                # logger.info(result["data"]["bestList"][0]["commentReplyList"][0].keys())

            return result
    except Exception:
        logger.exception("v2Comment发生异常")
コード例 #5
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
def cutomizeV1Comment(titleNo,
                      episodeNo,
                      categoryImage="",
                      categoryId="",
                      imageNo="",
                      text="",
                      userType=""):
    resp = v1Comment(titleNo, episodeNo, categoryImage, categoryId, imageNo,
                     text, userType)
    if resp["code"] == 200:
        checkV1CommentData(resp["data"], [
            '_id', 'titleNo', 'episodeNo', 'categoryId', 'imageNo', 'contents',
            'createTime', 'modifyTime', 'replyCount', 'neoId', 'deleted',
            'likeCount', 'unLikeCount', 'forbid', 'visible', 'objectId',
            'originalContents', 'commentType', 'deleteDescription', 'secret',
            'extra_status', 'clientType', 'extra_content_spam_status', 'ip',
            '__v'
        ])
        id = resp["data"]["_id"]
        return id

    elif resp["code"] == 10005:
        logger.info("评论次数限制 :%s" % resp["message"])
        deleteRedis(getConfig("session", "neo_id", "session.ini"))
        return cutomizeV1Comment(titleNo, episodeNo, categoryImage, categoryId,
                                 imageNo, text, userType)

    elif resp["code"] == 10002:
        logger.info("评论失败:%s" % resp["message"])
        assert resp["message"] == "在留言内容中包含限制文句。\r\n请修改后再上传。"
コード例 #6
0
def updateConfig(cfgKey, cfgValue):
    conn, cursor = getCursor()
    with conn:
        sql = '''update config set cfgValue = ? where cfgKey= ?'''
        cursor.execute(sql, (cfgValue, cfgKey))
        conn.commit()
        logger.info("更新%s:%s" % (cfgKey, cfgValue))
コード例 #7
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
def checkV1CommentComplaint(data):
    code = data['code']
    if code == 200:
        logger.info(data["message"])
    elif code == 10140:
        logger.info(data["message"])
        assert data["message"] == "无法举报自己的留言!"
    elif code == 400:
        logger.error(data["message"])
        assert data["message"] == "非法请求!"
コード例 #8
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
def checkV1CommentLike(data):
    code = data["code"]
    if code == 200:
        logger.info(data["message"])
    elif code == 10084:
        logger.info("无法为自己的留言点赞!")
        assert data["message"] == "无法为自己的留言点赞!"
    elif code == 400:
        logger.error(data["message"])
        assert data["message"] == "非法请求!"
コード例 #9
0
def deleteFiles(result_path):
    logger.info("移除目录下所有文件:%s" % result_path)
    for i in os.listdir(result_path):
        if i == "test.log":
            continue
        path_i = os.path.join(result_path, i)
        if os.path.isfile(path_i):
            os.remove(path_i)
        else:
            deleteFiles(path_i)
コード例 #10
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
def v1CommentOwnAll(flag="", id="", pageNo=1):
    path = "/v1/comment/ownall"
    payload = {"limit": 20, "pageNo": pageNo, "flag": flag, "_id": id}
    payload.update(Config("baseparams"))
    payload.update(getExpiresMd5(path))
    resp = requests.get(Config("httphost") + path,
                        params=payload,
                        headers=Config("headers"),
                        cookies=Config("cookies"))
    logger.info(resp.url)
    if resp.ok:
        result = resp.json()
        return result
    else:
        logger.exception("v1CommentOwnAll发生异常")
コード例 #11
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
def deleteCommentReply(id):
    path = "/v1/comment_reply/%s" % id
    payload = Config("baseparams")
    try:
        resp = requests.delete(Config("httphost") + path,
                               params=getExpiresMd5(path),
                               data=payload,
                               headers=Config("headers"),
                               cookies=Config("cookies"))
        logger.info(resp.url)
        if resp.ok:
            result = resp.json()
            logger.info(result)
            assert result["code"] == 200
            assert result["message"] == "请求成功!"
    except Exception:
        logger.exception("deleteCommentReply发生异常")
コード例 #12
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
def checkV2CommentJson(res):
    ###v2commentcheck
    checkV1CommentData(res, ['code', 'data', 'message'])
    checkV1CommentData(
        res['data'],
        ['hide', 'bestList', 'commentList', 'count', 'showTotalCount'])
    for i in res['data']["commentList"]:
        checkV1CommentData(i, [
            '_id', 'titleNo', 'episodeNo', 'categoryId', 'imageNo', 'contents',
            'createTime', 'modifyTime', 'replyCount', 'neoId', 'deleted',
            'likeCount', 'unLikeCount', 'forbid', 'visible', 'objectId',
            'commentType', 'deleteDescription', 'secret', 'extra_status',
            'clientType', 'extra_content_spam_status', 'ip', '__v', 'best',
            'commentReplyList', 'like', 'userName', 'userCertType'
        ])
        for j in i["commentReplyList"]:
            checkV1CommentData(j, [
                '_id', 'parentId', 'contents', 'createTime', 'modifyTime',
                'neoId', 'deleted', 'likeCount', 'unLikeCount', 'visible',
                'objectId', 'originalContents', 'commentType',
                'deleteDescription', 'secret', 'extra_status', 'clientType',
                'extra_content_spam_status', 'ip', 'titleNo', 'episodeNo',
                'imageNo', '__v', 'like', 'userName', 'userCertType'
            ])

    for i in res['data']["bestList"]:
        checkV1CommentData(i, [
            '_id', 'titleNo', 'episodeNo', 'categoryId', 'imageNo', 'contents',
            'createTime', 'modifyTime', 'replyCount', 'neoId', 'deleted',
            'likeCount', 'unLikeCount', 'forbid', 'visible', 'userType',
            'objectId', 'commentNo', 'commentType', 'deleteDescription',
            'secret', '__v', 'best', 'commentReplyList', 'like', 'userName',
            'userCertType'
        ])
        for j in i["commentReplyList"]:
            checkV1CommentData(j, [
                '_id', 'titleNo', 'episodeNo', 'imageNo', 'parentId',
                'contents', 'createTime', 'modifyTime', 'neoId', 'deleted',
                'likeCount', 'unLikeCount', 'visible', 'userType', 'objectId',
                'commentNo', 'originalContents', 'commentType',
                'deleteDescription', 'secret', '__v', 'like', 'userName',
                'userCertType'
            ])
    logger.info("checkV2CommentJson")
コード例 #13
0
def appRsakeyGet():
    path = "/app/rsakey/get"
    try:
        resp = requests.get(Config("httphost") + path,
                            params=getExpiresMd5(path),
                            headers=Config("headers"))
        resp_json = resp.json()
        evalue = resp_json["message"]["result"]["evalue"]
        keyName = resp_json["message"]["result"]["keyName"]
        nvalue = resp_json["message"]["result"]["nvalue"]
        sessionKey = resp_json["message"]["result"]["sessionKey"]
        logger.info(resp.url)
        return keyName, evalue, nvalue, sessionKey
    except Exception:
        logger.error("appRsakeyGet出现异常")
        logger.error(resp.url)
        logger.error(resp.text)
        logger.error(resp.headers)
        return False
コード例 #14
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
def v1CommentDetail(titleNo,
                    episodeNo,
                    commentId,
                    replyCommentId="",
                    commentLimit=20,
                    commentReplyLimit=10,
                    imageNo=""):
    path = "/v1/comment/detail"
    payload = {
        "titleNo": titleNo,
        "episodeNo": episodeNo,
        "imageNo": imageNo,
        "commentId": commentId,
        "replyCommentId": replyCommentId,
        "commentLimit": commentLimit,
        "commentReplyLimit": commentReplyLimit,
    }
    payload.update(Config("baseparams"))
    payload.update(getExpiresMd5(path))
    try:
        resp = requests.get(Config("httphost") + path,
                            params=payload,
                            headers=Config("headers"),
                            cookies=Config("cookies"))
        logger.info(resp.url)
        if resp.ok:
            result = resp.json()
            if result["code"] == 200:
                pass
                # logger.info(result.keys())
                # logger.info(result["data"].keys())
                # logger.info(result["data"]["comment"].keys())
                # logger.info(result["data"]["comment"]["commentList"][0].keys())
                # logger.info(result["data"]["comment"]["pageModel"].keys())
                # logger.info(result["data"]["comment"]["bestList"][0].keys())
                # logger.info(result["data"]["replyComment"].keys())
                # logger.info(result["data"]["replyComment"]["commentReplyList"][0].keys())
                # logger.info(result["data"]["replyComment"]["pageModel"].keys())
            return result
    except Exception:
        logger.exception("v1CommentDetail发生异常")
コード例 #15
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
def checkV1CommentGet(commentId, pageNo=1, limit=10):
    result = v1CommentReplyGet(commentId, pageNo, limit)
    if result["code"] == 200:
        count = result["data"]["count"]
        commentList = result["data"]["commentReplyList"]
        pageNo = 2
        for i in range(0, count // limit):
            res = v1CommentReplyGet(commentId, pageNo + i, limit)
            if res["code"] == 200:
                commentList.extend(res["data"]["commentReplyList"])
        for i in commentList:
            # logger.info(i)
            checkV1CommentData(i, [
                '_id', 'parentId', 'contents', 'createTime', 'modifyTime',
                'neoId', 'deleted', 'likeCount', 'unLikeCount', 'visible',
                'objectId', 'commentType', 'deleteDescription', 'secret',
                'extra_status', 'clientType', 'extra_content_spam_status',
                'ip', 'titleNo', 'episodeNo', 'imageNo', '__v', 'userName',
                'userCertType', 'like'
            ])
    logger.info("checkV1CommentGet")
コード例 #16
0
def runAllOneByOne():

    testCaseList = [
        MyPageTestcase,  ##MY页面用例
        # MyCartoonPageTestcase,##我的漫画用例
        # DiscoveryPageTestcase,##发现页用例
        # UpdatePageTestcase,##更新页用例
        # ScenarioTestcase,##场景测试用例
        # CommentTestcase,##评论测试用例
    ]
    for testcase in testCaseList:
        try:
            report_name = "IOS测试报告-%s" % testcase().__class__.__name__
            logger.info("%s开始执行##%s%s" % ("*" * 30, report_name, "*" * 30))
            deleteResultsFiles()
            now_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
            report_path = os.path.join(os.path.dirname(__file__), "results",
                                       "%s.html" % report_name)
            suite = unittest.TestSuite()
            suite.addTests(
                unittest.TestLoader().loadTestsFromTestCase(testcase))

            with open(report_path, 'wb') as f:
                runner = HTMLTestRunner(stream=f,
                                        title=report_name,
                                        description='测试报告 详细信息')
                runner.run(suite)
        except Exception:
            logger.info(report_name)
        finally:
            # time.sleep(20)
            # sendMail(now_time,report_name)
            logger.info("%s结束执行##%s%s" % ("*" * 30, report_name, "*" * 30))
コード例 #17
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
def postV1CommentLike(id, titleNo, episodeNo, flag="like"):
    path = "/v1/comment/%s/like" % id
    titleNo = str(titleNo)
    episodeNo = str(episodeNo)

    payload = {
        "flag": flag,
        "titleNo": titleNo,
        "episodeNo": episodeNo,
    }
    payload.update(Config("baseparams"))
    try:
        resp = requests.post(Config("httphost") + path,
                             params=getExpiresMd5(path),
                             data=payload,
                             headers=Config("headers"),
                             cookies=Config("cookies"))
        result = resp.json()
        logger.info(resp.url)
        # logger.info(resp.request.headers)
        logger.info(resp.request.body)
        logger.info(result)
        return result
    except Exception:
        logger.exception("postV1CommentLike发生异常")
コード例 #18
0
def sendMail(now_time, report_name, source="results", output="results_%s.zip"):
    '''
    'gjhpbxfvvuxhdhid'
    'dxnuqtwtnqngdjbi'
    '''

    source = os.path.join(os.path.dirname(__file__), source)
    output = output % now_time
    output = os.path.join(os.path.dirname(__file__), "resultszip", output)
    make_zip(source, output)
    # sender = '*****@*****.**'
    # smtpserver = 'smtp.qq.com'
    # password = '******'

    sender = '*****@*****.**'
    smtpserver = 'smtp.163.com'
    password = "******"

    # username = '******'

    toList = ['*****@*****.**', '*****@*****.**']
    receiver = ", ".join(toList)
    toTo = "木木QQ<%s>, Neal<%s>" % tuple(toList)

    mail_title = report_name

    # 创建一个带附件的实例
    message = MIMEMultipart()
    message['From'] = "木木<%s>" % sender
    message['To'] = toTo
    message['Subject'] = Header(mail_title, 'utf-8')

    # 邮件正文内容
    mail_html = handleHtml(report_name)
    message.attach(MIMEText('测试结果见报告', 'plain', 'utf-8'))
    message.attach(MIMEText(mail_html, 'html', 'utf-8'))

    try:
        smtp = smtplib.SMTP()
        # smtp = smtplib.SMTP_SSL(smtpserver)  # 注意:如果遇到发送失败的情况(提示远程主机拒接连接),这里要使用SMTP_SSL方法
        smtp.set_debuglevel(1)
        smtp.connect(smtpserver)
        smtp.login(sender, password)
        with open(output, 'rb') as f:
            # 这里附件的MIME和文件名
            mime = MIMEBase('zip', 'zip', filename=report_name)
            # 加上必要的头信息
            mime.add_header('Content-Disposition',
                            'attachment',
                            filename=('utf-8', '', "%s.zip" % report_name))
            mime.add_header('Content-ID', '<0>')
            mime.add_header('X-Attachment-Id', '0')
            # 把附件的内容读进来
            mime.set_payload(f.read())
            # 用Base64编码
            encoders.encode_base64(mime)
            message.attach(mime)
        # smtp.sendmail(sender, receiver.split(","), message.as_string())
        smtp.sendmail(sender, toList, message.as_string())

    except Exception:
        logger.exception("邮件发送失败!")
    else:
        logger.info("邮件发送成功!")
    finally:
        smtp.quit()
コード例 #19
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
        checkV1CommentDetailJson(res3)
        for replyid in titleinfo[2:]:
            res4 = v1CommentDetail(titleNo, episodeNo, id, replyid)
            checkV1ReplyCommentDetailJson(res4)
        checkV2Comment(titleNo, episodeNo)
        checkV2Comment(titleNo, episodeNo, sortBy="favourite")
        checkV1CommentGet(id)


def getFormateTime():
    time_now = datetime.datetime.now()
    otherStyleTime = time_now.strftime(" %Y-%m-%d %H:%M:%S ")
    return otherStyleTime


def UnnormalTest():
    pass


if __name__ == "__main__":
    logger.info("\n" * 10)
    logger.info("*" * 100)
    titleNos = [423, 1419, 918, 1428]
    titleNos = [1428]
    parentids = getParentsId(titleNos)
    likeComplaint(parentids)
    queryComment(parentids)
    login(Config("mobile"), Config("passwd"), loginType="PHONE_NUMBER")
    #删除所有评论
    deleteAllComments()
    logger.info("*" * 100)
コード例 #20
0
ファイル: comment.py プロジェクト: newjiaozi/appium_ios
def getParentsId(titleNos):
    parentids = {
    }  ##{"neo_id":{"parentidA":["id3","id4"]},""parentidB":["id1","id2']}
    cdnHost = "https://cdn.dongmanmanhua.cn"
    login(Config("mobile"), Config("passwd"), loginType="PHONE_NUMBER")
    deleteAllComments()
    datas = []
    for titleNo in titleNos:
        logger.info("#####:%s" % titleNo)
        resp = appTitleInfo2(titleNo)
        if resp:
            datas.append(resp)
    for title in datas:
        logger.info("@@@@@:%s" % title["title"])
        if title["serviceStatus"] == "SERVICE":
            totalServiceEpisodeCount = title["totalServiceEpisodeCount"]
            titleNo = title["titleNo"]
            titleName = title["title"]
            viewerType = title["viewer"]
            for episodeNo in range(1, totalServiceEpisodeCount + 1):
                episodeInfo = appEpisodeInfoV3(titleNo, episodeNo)
                if episodeInfo:
                    # episodeNo = episodeInfo["episodeNo"]
                    episodeTitle = episodeInfo["episodeTitle"]
                    serviceStatus = episodeInfo["serviceStatus"]
                    if serviceStatus == "SERVICE":
                        commentIllegal = True
                        commentLike = True
                        commentComplaint = True
                        replyCommentIllegal = True
                        replyCommentLike = True
                        replyCommentComplaint = True
                        if viewerType == "CUT":
                            imageInfos = episodeInfo["imageInfo"]
                            for image in imageInfos:
                                categoryImage = cdnHost + image["url"]
                                categoryId = image["cutId"]
                                text = episodeTitle + "_" + str(categoryId)
                                ##评论非法词
                                if commentIllegal:
                                    cutomizeV1Comment(titleNo,
                                                      episodeNo,
                                                      categoryImage,
                                                      categoryId,
                                                      categoryId,
                                                      "admin",
                                                      userType="MANAGER")
                                    commentIllegal = False
                                for t in range(0, 21):
                                    logger.info("%s-第%s次发表评论" % (titleNo, t))
                                    id = cutomizeV1Comment(titleNo,
                                                           episodeNo,
                                                           categoryImage,
                                                           categoryId,
                                                           categoryId,
                                                           getFormateTime() +
                                                           text,
                                                           userType="MANAGER")
                                    if id:
                                        parentids[id] = [titleNo, episodeNo]
                                        ##为自己评论点赞
                                        if commentLike:
                                            resp = postV1CommentLike(
                                                id, titleNo, episodeNo)
                                            checkV1CommentLike(resp)
                                            commentLike = False
                                        ##举报自己的评论
                                        if commentComplaint:
                                            resp = postV1CommentComplaint(id)
                                            checkV1CommentComplaint(resp)
                                            commentComplaint = False
                                        ##回复非法词
                                        if replyCommentIllegal:
                                            customizeV1CommentReply(
                                                id, titleNo, episodeNo,
                                                "admin")
                                            replyCommentIllegal = False
                                        for rt in range(0, 11):
                                            logger.info(
                                                "%s-第%s次发表评论,第%s次发表回复" %
                                                (titleNo, t, rt))
                                            replyid = customizeV1CommentReply(
                                                id, titleNo, episodeNo,
                                                text + "_" + str(rt))
                                            if replyid:
                                                parentids[id].append(replyid)
                                                ##为自己回复点赞
                                                if replyCommentLike:
                                                    resp = postV1CommentReplyLike(
                                                        replyid, titleNo,
                                                        episodeNo)
                                                    checkV1CommentLike(resp)
                                                    replyCommentLike = False
                                                ##举报自己的回复
                                                if replyCommentComplaint:
                                                    resp = postV1CommentReplyComplaint(
                                                        replyid)
                                                    checkV1CommentComplaint(
                                                        resp)
                                                    replyCommentComplaint = False
                                break

                        else:
                            text = titleName + "_" + str(episodeNo)
                            ##评论非法词
                            if commentIllegal:
                                cutomizeV1Comment(titleNo,
                                                  episodeNo,
                                                  text="admin")
                                commentIllegal = False
                            for t in range(0, 21):
                                logger.info("%s-第%s次发表评论" % (titleNo, t))
                                # text = getFormateTime()+text
                                id = cutomizeV1Comment(titleNo,
                                                       episodeNo,
                                                       text=getFormateTime() +
                                                       text)
                                if id:
                                    parentids[id] = [titleNo, episodeNo]
                                    ##为自己评论点赞
                                    if commentLike:
                                        resp = postV1CommentLike(
                                            id, titleNo, episodeNo)
                                        checkV1CommentLike(resp)
                                        commentLike = False
                                    ##举报自己的评论
                                    if commentComplaint:
                                        resp = postV1CommentComplaint(id)
                                        checkV1CommentComplaint(resp)
                                        commentComplaint = False
                                    ##回复非法词
                                    if replyCommentIllegal:
                                        customizeV1CommentReply(
                                            id, titleNo, episodeNo, "admin")
                                        replyCommentIllegal = False

                                    for rt in range(0, 11):
                                        logger.info("%s-第%s次发表评论,第%s次发表回复" %
                                                    (titleNo, t, rt))
                                        replyid = customizeV1CommentReply(
                                            id, titleNo, episodeNo,
                                            text + "_" + str(rt))
                                        if replyid:
                                            parentids[id].append(replyid)
                                            ##为自己回复点赞
                                            if replyCommentLike:
                                                resp = postV1CommentReplyLike(
                                                    replyid, titleNo,
                                                    episodeNo)
                                                checkV1CommentLike(resp)
                                                replyCommentLike = False
                                            ##举报自己的回复
                                            if replyCommentComplaint:
                                                resp = postV1CommentReplyComplaint(
                                                    replyid)
                                                checkV1CommentComplaint(resp)
                                                replyCommentComplaint = False

                        break
    return parentids