From 8cf576f16bc2e7912a90b1ea2c06e8a28a884919 Mon Sep 17 00:00:00 2001 From: JoeamAmier Date: Fri, 15 Sep 2023 22:43:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 2 +- source/Settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 18882c3..7e1b53f 100644 --- a/main.py +++ b/main.py @@ -46,7 +46,7 @@ def program(): xhs = XHS(**Settings().run()) if ids := Batch().read_txt(): for i in ids: - xhs.extract(i.rstrip('\n'), download=True) + xhs.extract(i, download=True) else: while True: if url := input("请输入小红书作品链接:"): diff --git a/source/Settings.py b/source/Settings.py index d459229..cb445ad 100644 --- a/source/Settings.py +++ b/source/Settings.py @@ -35,5 +35,5 @@ class Batch: def read_txt(self) -> list: if self.file.is_file(): with self.file.open("r") as f: - return f.readlines() + return [i.rstrip('\n') for i in f.readlines()] return []