|
@@ -213,7 +213,7 @@ class Weishi:
|
|
|
and video_duration != "0" and video_id != "0":
|
|
|
basic_time = int(time.time())
|
|
|
Common.crawler_log().info("添加视频信息至weishi_feeds.txt:{}".format(video_title))
|
|
|
- with open("./txt/weishi_feeds.txt", "a", encoding="UTF-8") as f_a:
|
|
|
+ with open(r"./txt/weishi_feeds.txt", "a", encoding="UTF-8") as f_a:
|
|
|
f_a.write(str(basic_time) + " + " +
|
|
|
str(video_id) + " + " +
|
|
|
str(video_play_cnt) + " + " +
|
|
@@ -239,7 +239,7 @@ class Weishi:
|
|
|
else:
|
|
|
basic_time = int(time.time())
|
|
|
Common.crawler_log().info("添加视频信息至weishi_feeds.txt:{}".format(video_title))
|
|
|
- with open("./txt/weishi_feeds.txt", "a", encoding="UTF-8") as f_a:
|
|
|
+ with open(r"./txt/weishi_feeds.txt", "a", encoding="UTF-8") as f_a:
|
|
|
f_a.write(str(basic_time) + " + " +
|
|
|
str(video_id) + " + " +
|
|
|
str(video_play_cnt) + " + " +
|
|
@@ -322,9 +322,9 @@ class Weishi:
|
|
|
|
|
|
# 删除该视频在weishi_feeds.txt中的信息
|
|
|
Common.crawler_log().info("删除该视频在weishi_feeds.txt中的信息:{}".format(download_video_title))
|
|
|
- with open("./txt/weishi_feeds.txt", "r", encoding="UTF-8") as f_r:
|
|
|
+ with open(r"./txt/weishi_feeds.txt", "r", encoding="UTF-8") as f_r:
|
|
|
lines = f_r.readlines()
|
|
|
- with open("./txt/weishi_feeds.txt", "w", encoding="utf-8") as f_w:
|
|
|
+ with open(r"./txt/weishi_feeds.txt", "w", encoding="utf-8") as f_w:
|
|
|
for line in lines:
|
|
|
if download_video_id in line.split(" + ")[1]:
|
|
|
continue
|
|
@@ -332,9 +332,9 @@ class Weishi:
|
|
|
else:
|
|
|
# 删除该视频在weishi_feeds.txt中的信息
|
|
|
Common.crawler_log().info("该视频不满足下载规则,删除在weishi_feeds.txt中的信息:{}".format(download_video_title))
|
|
|
- with open("./txt/weishi_feeds.txt", "r", encoding="UTF-8") as f_r:
|
|
|
+ with open(r"./txt/weishi_feeds.txt", "r", encoding="UTF-8") as f_r:
|
|
|
lines = f_r.readlines()
|
|
|
- with open("./txt/weishi_feeds.txt", "w", encoding="utf-8") as f_w:
|
|
|
+ with open(r"./txt/weishi_feeds.txt", "w", encoding="utf-8") as f_w:
|
|
|
for line in lines:
|
|
|
if download_video_id in line.split(" + ")[1]:
|
|
|
continue
|