Skip to content

Commit c07161e

Browse files
authored
🎀处理用户的所有笔记
1 parent c7fd793 commit c07161e

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

home.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
import requests
2+
23
from one import OneNote
34
from profile import Profile
4-
from xhs_utils.xhs_util import get_headers, get_params, js
5-
5+
from xhs_utils.xhs_util import get_headers, get_params, js, check_cookies
6+
7+
68
class Home:
7-
def __init__(self):
9+
def __init__(self, cookies=None):
10+
if cookies is None:
11+
self.cookies = check_cookies()
12+
else:
13+
self.cookies = cookies
814
self.more_url = 'https://edith.xiaohongshu.com/api/sns/web/v1/user_posted'
9-
self.profile = Profile()
10-
self.oneNote = OneNote(self.profile.cookies)
15+
self.profile = Profile(self.cookies)
16+
self.oneNote = OneNote(self.cookies)
1117
self.headers = get_headers()
1218
self.params = get_params()
13-
self.cookies = self.profile.cookies
19+
1420

1521
# 主页
1622
def get_all_note_info(self, url):
@@ -87,4 +93,3 @@ def main(self, url_list):
8793
]
8894
home.main(url_list)
8995

90-

0 commit comments

Comments
 (0)