|
@@ -287,23 +287,23 @@ class BSZF:
|
|
|
|
|
|
# 删除该视频在benshanzhufu_feeds.txt中的信息
|
|
|
Common.crawler_log().info("删除该视频在benshanzhufu_feeds.txt中的信息:{}".format(download_video_title))
|
|
|
- with open(r"./txt/benshanzhufu_feeds.txt", "r", encoding="UTF-8") as f_r:
|
|
|
- lines = f_r.readlines()
|
|
|
- with open(r"./txt/benshanzhufu_feeds.txt", "w", encoding="utf-8") as f_w:
|
|
|
+ with open(r"./txt/benshanzhufu_feeds.txt", "r", encoding="UTF-8") as f_r3:
|
|
|
+ lines = f_r3.readlines()
|
|
|
+ with open(r"./txt/benshanzhufu_feeds.txt", "w", encoding="utf-8") as f_w3:
|
|
|
for line in lines:
|
|
|
if download_video_id in line.split(" + ")[1]:
|
|
|
continue
|
|
|
- f_w.write(line)
|
|
|
+ f_w3.write(line)
|
|
|
except Exception as e:
|
|
|
# 删除该视频在 recommend.txt中的信息
|
|
|
Common.crawler_log().error("该视频信息异常,删除在benshanzhufu_feeds.txt中的信息:{}".format(e))
|
|
|
- with open(r"./txt/benshanzhufu_feeds.txt", "r", encoding="UTF-8") as f_r:
|
|
|
- lines = f_r.readlines()
|
|
|
- with open(r"./txt/benshanzhufu_feeds.txt", "w", encoding="utf-8") as f_w:
|
|
|
+ with open(r"./txt/benshanzhufu_feeds.txt", "r", encoding="UTF-8") as f_r4:
|
|
|
+ lines = f_r4.readlines()
|
|
|
+ with open(r"./txt/benshanzhufu_feeds.txt", "w", encoding="utf-8") as f_w4:
|
|
|
for line in lines:
|
|
|
if download_video_id in line.split(" + ")[1]:
|
|
|
continue
|
|
|
- f_w.write(line)
|
|
|
+ f_w4.write(line)
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|