try: print("【===百度网盘链接有效性自动判别程序===】\n") print(" * 联系方式\n 1.https://www.ganahe.top/ \n 2.合作微信公众号:星辰换日\n") # 读取CSV文档 filePath = input(" 请输入文件路径(示例:E:\\百度\\Link.csv):") sourceList = [] with open(filePath, "r", encoding="utf8") as F: for line in F: # print(line) sourceList.append(line.split(","))
with open(os.path.dirname(filePath) + "resultLink.csv", "w",newline= "", encoding="utf8") as S: writer = csv.writer(S) head = sourceList[0] head.append("有效性") print(head) writer.writerow(head) for i in range(1, len(sourceList)): line = sourceList[i] link = line[1] print("\n ------- 第"+str(i)+"个链接情况:",sourceList[i]) just = BaiduNetdisk().anylies(link) if just isTrue: line.append("有效") else: line.append("链接无效") writer.writerow(line) print("\n-- 结束,所有链接均已分析完成,请打开resultLink.csv查看") time.sleep(600)
except Exception as e: print("异常错误-301:", e.__str__())