Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

该脚本发笔记,会被小红书判定限流吗? #38

Closed
godJBJ opened this issue Aug 2, 2023 · 4 comments
Closed

该脚本发笔记,会被小红书判定限流吗? #38

godJBJ opened this issue Aug 2, 2023 · 4 comments

Comments

@godJBJ
Copy link

godJBJ commented Aug 2, 2023

如题

@ReaJason
Copy link
Owner

ReaJason commented Aug 2, 2023

不知道诶,请问这个怎么测试🫠

@godJBJ
Copy link
Author

godJBJ commented Aug 3, 2023

只能发笔记试试看流量正不正常了。

@godJBJ
Copy link
Author

godJBJ commented Aug 3, 2023

发布笔记有时候也会报错(测试有一定概率报错),如下:
Traceback (most recent call last):
File "D:\project\xhs-master\example\basic_usage.py", line 54, in
note_info = xhs_client.create_image_note(title, desc, images, is_private=False, post_time="2023-08-03 16:06:00")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\project\xhs-master\xhs\core.py", line 783, in create_image_note
return self.create_note(title, desc, NoteType.NORMAL.value, ats=ats, topics=topics,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\project\xhs-master\xhs\core.py", line 743, in create_note
return self.post(uri, data, headers=headers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\project\xhs-master\xhs\core.py", line 187, in post
self._pre_headers(uri, data, is_creator=is_creator)
File "D:\project\xhs-master\xhs\core.py", line 155, in _pre_headers
self.sign(
File "D:\project\xhs-master\example\basic_usage.py", line 29, in sign
encrypt_params = context_page.evaluate("([url, data]) => window._webmsxyw(url, data)", [uri, data])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\project\xhs-master\venv\Lib\site-packages\playwright\sync_api_generated.py", line 8698, in evaluate
self._sync(
File "D:\project\xhs-master\venv\Lib\site-packages\playwright_impl_sync_base.py", line 109, in _sync
return task.result()
^^^^^^^^^^^^^
File "D:\project\xhs-master\venv\Lib\site-packages\playwright_impl_page.py", line 395, in evaluate
return await self._main_frame.evaluate(expression, arg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\project\xhs-master\venv\Lib\site-packages\playwright_impl_frame.py", line 277, in evaluate
await self._channel.send(
File "D:\project\xhs-master\venv\Lib\site-packages\playwright_impl_connection.py", line 61, in send
return await self._connection.wrap_api_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\project\xhs-master\venv\Lib\site-packages\playwright_impl_connection.py", line 482, in wrap_api_call
return await cb()
^^^^^^^^^^
File "D:\project\xhs-master\venv\Lib\site-packages\playwright_impl_connection.py", line 97, in inner_send
result = next(iter(done)).result()
^^^^^^^^^^^^^^^^^^^^^^^^^
playwright._impl._api_types.Error: Execution context was destroyed, most likely because of a navigation

Process finished with exit code 1
作者大大碰到过这种情况吗?对python不是很熟看不太懂...

@ReaJason
Copy link
Owner

ReaJason commented Aug 6, 2023

暂时不太懂 playwright 为什么会报这个错误,可以试试捕获异常然后重试。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants