diff --git a/README.md b/README.md
index 0f49094..b798e45 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,7 @@
下载小红书图文/视频作品文件
自动跳过已存在的作品文件
作品文件完整性处理机制
+批量下载小红书作品文件
📸 程序截图
diff --git a/main.py b/main.py
index 1a95368..afc7a5a 100644
--- a/main.py
+++ b/main.py
@@ -44,7 +44,7 @@ def main():
xhs = XHS(**Settings().run())
if ids := Batch().read_txt():
for i in ids:
- xhs.extract(i, download=True)
+ xhs.extract(i.rstrip('\n'), download=True)
else:
while True:
if url := input("请输入小红书作品链接:"):
diff --git a/source/Explore.py b/source/Explore.py
index 838c8e3..627e73f 100644
--- a/source/Explore.py
+++ b/source/Explore.py
@@ -20,11 +20,12 @@ class Explore:
def __extract_data(self, data: dict) -> dict:
result = {}
- self.__extract_interact_info(result, data)
- self.__extract_tags(result, data)
- self.__extract_info(result, data)
- self.__extract_time(result, data)
- self.__extract_user(result, data)
+ if data:
+ self.__extract_interact_info(result, data)
+ self.__extract_tags(result, data)
+ self.__extract_info(result, data)
+ self.__extract_time(result, data)
+ self.__extract_user(result, data)
return result
@staticmethod
diff --git a/source/__init__.py b/source/__init__.py
index bee2aef..3a6e3ae 100644
--- a/source/__init__.py
+++ b/source/__init__.py
@@ -56,6 +56,9 @@ class XHS:
if not html:
return {}
data = self.explore.run(html)
+ if not data:
+ print(f"获取作品数据失败: {url}")
+ return {}
if data["作品类型"] == "视频":
self.__get_video(data, html, download)
else: