From ce2bcc1cc91c69fbd81a2c12dcd1a35c927cdeeb Mon Sep 17 00:00:00 2001 From: ReaJason Date: Mon, 29 Apr 2024 14:12:26 +0000 Subject: [PATCH] deploy: ca530f249ec4abfdf8816505c5c9f2656099d3a6 --- .buildinfo | 2 +- _modules/index.html | 2 +- _modules/xhs/core.html | 54 ++++++++++++++----------------- _static/documentation_options.js | 2 +- basic.html | 2 +- crawl.html | 2 +- creator.html | 2 +- genindex.html | 4 +-- index.html | 2 +- objects.inv | Bin 928 -> 920 bytes search.html | 2 +- searchindex.js | 2 +- source/xhs.html | 23 +++++++------ 13 files changed, 48 insertions(+), 51 deletions(-) diff --git a/.buildinfo b/.buildinfo index 6896f8b..5009e08 100644 --- a/.buildinfo +++ b/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: f744698d55f38bf171e6cd3e48afa688 +config: 5ae79e63350fcd1e74f5f7eec225c239 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/_modules/index.html b/_modules/index.html index 7223d00..35eacf7 100644 --- a/_modules/index.html +++ b/_modules/index.html @@ -5,7 +5,7 @@ - 概览:模块代码 — xhs 0.2.11 文档 + 概览:模块代码 — xhs 0.2.12 文档 diff --git a/_modules/xhs/core.html b/_modules/xhs/core.html index a839712..2c15f77 100644 --- a/_modules/xhs/core.html +++ b/_modules/xhs/core.html @@ -5,7 +5,7 @@ - xhs.core — xhs 0.2.11 文档 + xhs.core — xhs 0.2.12 文档 @@ -83,7 +83,7 @@

xhs.core 源代码

 
 
 class SearchSortType(Enum):
-    """serach sort type"""
+    """search sort type"""
 
     # default
     GENERAL = "general"
@@ -105,7 +105,7 @@ 

xhs.core 源代码

 
 
 class Note(NamedTuple):
-    """note typle"""
+    """note type"""
 
     note_id: str
     title: str
@@ -136,7 +136,7 @@ 

xhs.core 源代码

         self._host = "https://edith.xiaohongshu.com"
         self._creator_host = "https://creator.xiaohongshu.com"
         self.home = "https://www.xiaohongshu.com"
-        user_agent = user_agent or (
+        self.user_agent = user_agent or (
             "Mozilla/5.0 "
             "(Windows NT 10.0; Win64; x64) "
             "AppleWebKit/537.36 "
@@ -165,14 +165,6 @@ 

xhs.core 源代码

     def session(self):
         return self.__session
 
-    @property
-    def user_agent(self):
-        return self.__session.headers.get("user-agent")
-
-    @user_agent.setter
-    def user_agent(self, user_agent: str):
-        self.__session.headers.update({"user-agent": user_agent})
-
     def _pre_headers(self, url: str, data=None, is_creator: bool = False):
         if is_creator:
             signs = sign(url, data, a1=self.cookie_dict.get("a1"))
@@ -185,7 +177,7 @@ 

xhs.core 源代码

                     url,
                     data,
                     a1=self.cookie_dict.get("a1"),
-                    web_session=self.cookie_dict.get("web_session"),
+                    web_session=self.cookie_dict.get("web_session", ""),
                 )
             )
 
@@ -199,13 +191,15 @@ 

xhs.core 源代码

             data = response.json()
         except json.decoder.JSONDecodeError:
             return response
-        if data.get("success"):
-            return data.get("data", data.get("success"))
-        elif response.status_code == 471:
+        if response.status_code == 471 or response.status_code == 461:
             # someday someone maybe will bypass captcha
+            verify_type = response.headers['Verifytype']
+            verify_uuid = response.headers['Verifyuuid']
             raise NeedVerifyError(
-                f"出现验证码,请求失败,Verifytype: {response.headers['Verifytype']},Verifyuuid: {response.headers['Verifyuuid']}",
-                response=response)
+                f"出现验证码,请求失败,Verifytype: {verify_type},Verifyuuid: {verify_uuid}",
+                response=response, verify_type=verify_type, verify_uuid=verify_uuid)
+        elif data.get("success"):
+            return data.get("data", data.get("success"))
         elif data.get("code") == ErrorEnum.IP_BLOCK.value.code:
             raise IPBlockError(ErrorEnum.IP_BLOCK.value.msg, response=response)
         elif data.get("code") == ErrorEnum.SIGN_FAULT.value.code:
@@ -274,9 +268,7 @@ 

xhs.core 源代码

         url = "https://www.xiaohongshu.com/explore/" + note_id
         res = self.session.get(url, headers={"user-agent": self.user_agent, "referer": "https://www.xiaohongshu.com/"})
         html = res.text
-        state = re.findall(r"window.__INITIAL_STATE__=({.*})</script>", html)[
-            0
-        ].replace("undefined", '""')
+        state = re.findall(r"window.__INITIAL_STATE__=({.*})</script>", html)[0].replace("undefined", '""')
         if state != "{}":
             note_dict = transform_json_keys(state)
             return note_dict["note"]["note_detail_map"][note_id]["note"]
@@ -604,7 +596,11 @@ 

xhs.core 源代码

         return self.post(uri, data)
[文档] def comment_user(self, note_id: str, comment_id: str, content: str): - """ + """comment a user comment + + :param content: comment content + :param note_id: the id of the note + :param comment_id: target comment_id you want to comment :rtype: dict """ uri = "/api/sns/web/v1/comment/post" @@ -641,19 +637,19 @@

xhs.core 源代码

         data = {"note_oid": note_id}
         return self.post(uri, data)
-
[文档] def like_comment(self, note_id: str, comment_id: str): - uri = "/api/sns/web/v1/comment/like" - data = {"note_id": note_id, "comment_id": comment_id} - return self.post(uri, data)
-
[文档] def dislike_note(self, note_id: str): uri = "/api/sns/web/v1/note/dislike" data = {"note_oid": note_id} return self.post(uri, data)
-
[文档] def dislike_comment(self, comment_id: str): +
[文档] def like_comment(self, note_id: str, comment_id: str): + uri = "/api/sns/web/v1/comment/like" + data = {"note_id": note_id, "comment_id": comment_id} + return self.post(uri, data)
+ +
[文档] def dislike_comment(self, note_id: str, comment_id: str): uri = "/api/sns/web/v1/comment/dislike" - data = {"note_oid": comment_id} + data = {"note_id": note_id, "comment_id": comment_id} return self.post(uri, data)
[文档] def get_qrcode(self): diff --git a/_static/documentation_options.js b/_static/documentation_options.js index dcb085e..0e42c37 100644 --- a/_static/documentation_options.js +++ b/_static/documentation_options.js @@ -1,6 +1,6 @@ var DOCUMENTATION_OPTIONS = { URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), - VERSION: '0.2.11', + VERSION: '0.2.12', LANGUAGE: 'zh_CN', COLLAPSE_INDEX: false, BUILDER: 'html', diff --git a/basic.html b/basic.html index 242a59d..81f24c2 100644 --- a/basic.html +++ b/basic.html @@ -5,7 +5,7 @@ - 快速入门 — xhs 0.2.11 文档 + 快速入门 — xhs 0.2.12 文档 diff --git a/crawl.html b/crawl.html index ec11ca1..53e521c 100644 --- a/crawl.html +++ b/crawl.html @@ -5,7 +5,7 @@ - 主页爬取 — xhs 0.2.11 文档 + 主页爬取 — xhs 0.2.12 文档 diff --git a/creator.html b/creator.html index c09f4e8..b836d31 100644 --- a/creator.html +++ b/creator.html @@ -5,7 +5,7 @@ - 笔记发布 — xhs 0.2.11 文档 + 笔记发布 — xhs 0.2.12 文档 diff --git a/genindex.html b/genindex.html index 3cf2db0..87612d9 100644 --- a/genindex.html +++ b/genindex.html @@ -5,7 +5,7 @@ - 索引 — xhs 0.2.11 文档 + 索引 — xhs 0.2.12 文档 @@ -290,8 +290,6 @@

U

  • upload_file() (xhs.XhsClient 方法)
  • upload_file_with_slice() (xhs.XhsClient 方法) -
  • -
  • user_agent (xhs.XhsClient property)
  • diff --git a/index.html b/index.html index 45144f5..2ef6d05 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ - 介绍 — xhs 0.2.11 文档 + 介绍 — xhs 0.2.12 文档 diff --git a/objects.inv b/objects.inv index b2bdf16ebf427a45cbf69022045228ffc77bcaec..637275e6940047e2b6e2d981a44809dfcf2b3763 100644 GIT binary patch delta 723 zcmV;^0xbQY2bc$tb$=5<6vyxTDFS*;MUTCObgKc=l_VB#%VhR#GG=yXJ2TsKZ-NMd zNEOsxEYgBdu!skRLIuA}W6ig4c6QTlwPI%WlrZ~#|9La-?VC5dGZriB0Kp(jppj&& zm?9w>w;O_`9K)?0^>{2JdgErJ>FiW&SK6(f>-KU4Ny*7Dm4C1l=JmVopwsRflWx}= zbi55?ZoSpF!a9Quw{Py|y63GKLw8$U*BH9zJ?!<(v97n-F{gTN+v|4S4fC}PdaX_O z{<7Gkv1n5Qv0Nq@FN{|ZmSh`Aox%~wF$z*3lV@C|%^8wZ<^>Nl**+L(U>UH?1Kvfq!huxV0m7cR{4Xx*Eb4 zQiW4Uf@?^mQG~3r)9S3uK>>*4v6^`_0+FYql?Dxc5{Ik~d&dSYy!Me**cP;83BeY8 zaaj5xp(=Fh^o@wLSFw5v^Xjk5fKDGNYoJ&kMJW762ZIjqz)d(xj0sg4v%@Ny!Uak%C)N%L=_diAZs*W7FW zL0?)nogosc@CzBN1`Owb9?-Up*^f{2Cm&|dKF;@!9Fq+L78n;2#;=;{p~Cq5_|31+ zUuL_nXD3gc5yX=_11J~=h4s&)gW3LGDO-8^AM8P5c4T)g-iB=E&2HSxWSV5Uotq$n zAW{Xj7mKtY6fELFp-{mu)3xrmFq4^Wr&@87IkjZo@1K{vmzS5_8H<&5fMAd%&`7dX zOpy?c+YP}|j^Wmh`aG5qy>YYAbapDXEA3X#b$dC2q~v6nN`F`i^ZH$P&}sLLNw@0_ zI^Kpcx8CYoVV%K-+c$S}-SgIrp}VcFYYg4<9`^d?Sl8R^m{UEs?RC5EhWXkCz1F6C ze_8C&ShOjDST2){7se|HOR|lmPT>gTm<3B=cno;rV;0zfTiga^lmeE1%*@?oQKbIX zK~n+T7-bWp=aX{*6@P!CluD8yuKZ6ZLxJfE3ON#?5m;?r!P}GDBmic^2cXxVlYSXO zQw1U@nbf5%Tn|;Av#CwOjX;_cK1A#>5f)(Ss9GWk2}Y8z*hXf|BJe|1_3E&`njc1t zXBHxhK-F4Bo+Apat)nv*QM$-GYmH&%lb{ythnz)zZdyZT0)N?*acf8F?t(~%bv1-9 zqzb2y1lN#AqX=1Lr`27Vg8~r8V>R<=1R_sID-9a@Bo0{}_Kpo)cv0HPxs?PvaWzm^8L;4l6ayp7f_gsw;&OY%HP++NeANOKcft9Ip9=rTI5e zeKl9%Yo5gapf4?(&JYQ8X9yXr1`Owb9?-Up*^f{2CzJgG9vE*K#;=;{p~Cq5_|31+ zUuL_nXD3e`wL_CL11LQYh4s&)gW3LGDO>saAM8P~7;Sd5iZy?U=K)#l9i b51q?cRG0Bbgc@rMr+MwvJ+<>2+ - 搜索 — xhs 0.2.11 文档 + 搜索 — xhs 0.2.12 文档 diff --git a/searchindex.js b/searchindex.js index 5405362..88fbde2 100644 --- a/searchindex.js +++ b/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["basic","crawl","creator","index","source/xhs"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":5,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.viewcode":1,sphinx:56},filenames:["basic.rst","crawl.rst","creator.rst","index.rst","source/xhs.rst"],objects:{"xhs.FeedType":[[4,1,1,"","CAREER"],[4,1,1,"","COSMETICS"],[4,1,1,"","EMOTION"],[4,1,1,"","FASION"],[4,1,1,"","FITNESS"],[4,1,1,"","FOOD"],[4,1,1,"","GAME"],[4,1,1,"","HOURSE"],[4,1,1,"","MOVIE"],[4,1,1,"","RECOMMEND"],[4,1,1,"","TRAVEL"]],"xhs.XhsClient":[[4,2,1,"","activate"],[4,2,1,"","check_code"],[4,2,1,"","check_qrcode"],[4,2,1,"","collect_note"],[4,2,1,"","comment_note"],[4,2,1,"","comment_user"],[4,3,1,"","cookie"],[4,3,1,"","cookie_dict"],[4,2,1,"","create_complete_multipart_upload"],[4,2,1,"","create_image_note"],[4,2,1,"","create_note"],[4,2,1,"","create_video_note"],[4,2,1,"","delete_note_comment"],[4,2,1,"","dislike_comment"],[4,2,1,"","dislike_note"],[4,2,1,"","follow_user"],[4,2,1,"","get"],[4,2,1,"","get_emojis"],[4,2,1,"","get_follow_notifications"],[4,2,1,"","get_home_feed"],[4,2,1,"","get_home_feed_category"],[4,2,1,"","get_like_notifications"],[4,2,1,"","get_mention_notifications"],[4,2,1,"","get_note_all_comments"],[4,2,1,"","get_note_by_id"],[4,2,1,"","get_note_by_id_from_html"],[4,2,1,"","get_note_by_keyword"],[4,2,1,"","get_note_comments"],[4,2,1,"","get_note_sub_comments"],[4,2,1,"","get_notes_statistics"],[4,2,1,"","get_notes_summary"],[4,2,1,"","get_qrcode"],[4,2,1,"","get_search_suggestion"],[4,2,1,"","get_self_info"],[4,2,1,"","get_self_info2"],[4,2,1,"","get_suggest_ats"],[4,2,1,"","get_suggest_topic"],[4,2,1,"","get_upload_files_permit"],[4,2,1,"","get_upload_id"],[4,2,1,"","get_user_all_notes"],[4,2,1,"","get_user_by_keyword"],[4,2,1,"","get_user_collect_notes"],[4,2,1,"","get_user_info"],[4,2,1,"","get_user_like_notes"],[4,2,1,"","get_user_notes"],[4,2,1,"","get_video_first_frame_image_id"],[4,2,1,"","like_comment"],[4,2,1,"","like_note"],[4,2,1,"","login_code"],[4,2,1,"","post"],[4,2,1,"","report_note_metrics"],[4,2,1,"","request"],[4,2,1,"","save_files_from_note_id"],[4,2,1,"","send_code"],[4,3,1,"","session"],[4,2,1,"","uncollect_note"],[4,2,1,"","unfollow_user"],[4,2,1,"","upload_file"],[4,2,1,"","upload_file_with_slice"],[4,3,1,"","user_agent"]],xhs:[[4,0,1,"","FeedType"],[4,0,1,"","XhsClient"]]},objnames:{"0":["py","class","Python \u7c7b"],"1":["py","attribute","Python \u5c5e\u6027"],"2":["py","method","Python \u65b9\u6cd5"],"3":["py","property","Python property"]},objtypes:{"0":"py:class","1":"py:attribute","2":"py:method","3":"py:property"},terms:{"10":[1,4],"11":4,"12":4,"20":4,"2023":4,"24":4,"280148":4,"30":4,"36":4,"48":4,"5005":0,"86":4,"87323168":4,"default":4,"enum":4,"for":4,"function":4,"if":4,"in":4,"int":4,"return":4,"true":4,"with":4,a1:0,abnorm:4,activ:4,all:4,an:4,and:4,api:[0,4],argument:4,as:4,ats:4,author:4,basic_sign_serv:0,basic_sign_usag:0,basic_usag:0,be:4,bool:4,by:4,can:4,career:4,career_v3:4,cdn:0,check_cod:4,check_qrcod:[1,4],code:4,collect_not:[1,4],com:[3,4],comment:4,comment_id:4,comment_not:[1,4],comment_us:4,content:4,content_typ:4,cooki:[0,1,4],cookie_dict:4,core:4,cosmet:4,cosmetics_v3:4,count:4,cover:4,cover_path:4,crawl:4,crawl_interv:4,creat:4,create_complete_multipart_upload:4,create_image_not:4,create_not:4,create_video_not:4,creator:3,curl:0,cursor:4,data:4,date:4,delete_note_com:[1,4],desc:4,dict:4,dir_path:4,directori:4,dislike_com:[1,4],dislike_not:[1,4],display_titl:4,docker:0,don:4,emot:4,enumer:4,equal:4,explor:4,fact:4,fals:4,fashion_v3:4,fasion:4,feed_typ:4,feedtyp:1,fetch:4,file:4,file_id:4,file_path:4,file_typ:4,first:4,fit:4,fitness_v3:4,flask:3,follow:4,follow_us:[1,4],followed_author:4,food:4,food_v3:4,from:4,game:4,gaming_v3:4,gener:4,get:4,get_emoji:4,get_follow_notif:4,get_home_fe:[1,4],get_home_feed_categori:4,get_like_notif:4,get_mention_notif:4,get_note_all_com:4,get_note_by_id:[1,4],get_note_by_id_from_html:4,get_note_by_keyword:[1,4],get_note_com:[1,4],get_note_sub_com:[1,4],get_notes_statist:4,get_notes_summari:4,get_qrcod:[1,4],get_search_suggest:4,get_self_info2:4,get_self_info:[1,4],get_suggest_at:4,get_suggest_top:4,get_upload_files_permit:4,get_upload_id:4,get_user_all_not:4,get_user_by_keyword:4,get_user_collect_not:[1,4],get_user_info:[1,4],get_user_like_not:[1,4],get_user_not:[1,4],get_video_first_frame_image_id:4,gevent:0,gh:0,greater:4,has:4,has_mor:4,have:4,homefe:4,homefeed_recommend:4,hours:4,household_product_v3:4,http:[0,4],id:[1,4],ignor:4,imag:4,image_info:4,includ:4,info:4,input:4,instal:0,interact:4,interact_info:4,interv:4,is:4,is_creat:4,is_priv:4,is_rec:4,it:[0,4],item:4,jpeg:4,js:0,jsdelivr:0,just:4,keyword:4,kwarg:4,last:4,latest:0,like_com:[1,4],like_not:[1,4],list:4,login_cod:4,love_v3:4,method:4,metric:4,min:0,mobile_token:4,more:4,movi:4,movie_and_tv_v3:4,mp4:4,multi_flag:4,must:4,net:0,none:4,note:4,note_id:4,note_titl:4,note_typ:4,note_user_id:4,num:4,number:4,obj:4,object:4,onli:4,option:4,or:4,order:4,other:4,page:4,page_s:4,param:4,parent:4,part:4,phone:4,pip:0,playwright:0,png:4,post:4,post_tim:4,properti:4,proxi:[1,4],py:0,python:4,qr_id:4,qrcode:4,reajason:[0,4],recommend:[1,4],report:4,report_note_metr:4,report_typ:4,request:[0,4],requirecool:0,respons:4,root_comment_id:4,run:0,same:4,save:4,save_files_from_note_id:4,search:4,searchnotetyp:4,searchsorttyp:4,second:4,send_cod:4,session:4,should:4,sign:4,simpl:4,size:4,sleep:4,so:4,sort:4,sort_bi:4,stai:4,stay_second:4,stealth:0,store:4,str:4,sub:4,that:4,thi:4,time:4,timeout:[1,4],titl:4,to:4,token:4,topic:4,trasform:4,travel:4,travel_v3:4,tupl:4,twice:4,type:4,uncollect_not:[1,4],unfollow_us:[1,4],upload_fil:4,upload_file_with_slic:4,upload_id:4,uri:4,url:4,user:4,user_ag:[1,4],user_id:4,valu:4,video:4,video_id:4,video_info:4,video_path:4,viewer:4,viewer_user_id:4,wait_tim:4,want:4,web_sess:0,webid:0,what:4,when:4,which:4,will:4,www:[3,4],xhs:[0,1,3,4],xhs_client:1,xhsclient:[1,3],xhsdiscov:4,xiaohongshu:[3,4],you:4,your:4,zone:4},titles:["\u5feb\u901f\u5165\u95e8","\u4e3b\u9875\u722c\u53d6","\u7b14\u8bb0\u53d1\u5e03","\u4ecb\u7ecd","Documentation"],titleterms:{"class":4,document:4,feedtyp:4,flask:0,the:4,xhsclient:[0,4]}}) \ No newline at end of file +Search.setIndex({docnames:["basic","crawl","creator","index","source/xhs"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":5,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.viewcode":1,sphinx:56},filenames:["basic.rst","crawl.rst","creator.rst","index.rst","source/xhs.rst"],objects:{"xhs.FeedType":[[4,1,1,"","CAREER"],[4,1,1,"","COSMETICS"],[4,1,1,"","EMOTION"],[4,1,1,"","FASION"],[4,1,1,"","FITNESS"],[4,1,1,"","FOOD"],[4,1,1,"","GAME"],[4,1,1,"","HOURSE"],[4,1,1,"","MOVIE"],[4,1,1,"","RECOMMEND"],[4,1,1,"","TRAVEL"]],"xhs.XhsClient":[[4,2,1,"","activate"],[4,2,1,"","check_code"],[4,2,1,"","check_qrcode"],[4,2,1,"","collect_note"],[4,2,1,"","comment_note"],[4,2,1,"","comment_user"],[4,3,1,"","cookie"],[4,3,1,"","cookie_dict"],[4,2,1,"","create_complete_multipart_upload"],[4,2,1,"","create_image_note"],[4,2,1,"","create_note"],[4,2,1,"","create_video_note"],[4,2,1,"","delete_note_comment"],[4,2,1,"","dislike_comment"],[4,2,1,"","dislike_note"],[4,2,1,"","follow_user"],[4,2,1,"","get"],[4,2,1,"","get_emojis"],[4,2,1,"","get_follow_notifications"],[4,2,1,"","get_home_feed"],[4,2,1,"","get_home_feed_category"],[4,2,1,"","get_like_notifications"],[4,2,1,"","get_mention_notifications"],[4,2,1,"","get_note_all_comments"],[4,2,1,"","get_note_by_id"],[4,2,1,"","get_note_by_id_from_html"],[4,2,1,"","get_note_by_keyword"],[4,2,1,"","get_note_comments"],[4,2,1,"","get_note_sub_comments"],[4,2,1,"","get_notes_statistics"],[4,2,1,"","get_notes_summary"],[4,2,1,"","get_qrcode"],[4,2,1,"","get_search_suggestion"],[4,2,1,"","get_self_info"],[4,2,1,"","get_self_info2"],[4,2,1,"","get_suggest_ats"],[4,2,1,"","get_suggest_topic"],[4,2,1,"","get_upload_files_permit"],[4,2,1,"","get_upload_id"],[4,2,1,"","get_user_all_notes"],[4,2,1,"","get_user_by_keyword"],[4,2,1,"","get_user_collect_notes"],[4,2,1,"","get_user_info"],[4,2,1,"","get_user_like_notes"],[4,2,1,"","get_user_notes"],[4,2,1,"","get_video_first_frame_image_id"],[4,2,1,"","like_comment"],[4,2,1,"","like_note"],[4,2,1,"","login_code"],[4,2,1,"","post"],[4,2,1,"","report_note_metrics"],[4,2,1,"","request"],[4,2,1,"","save_files_from_note_id"],[4,2,1,"","send_code"],[4,3,1,"","session"],[4,2,1,"","uncollect_note"],[4,2,1,"","unfollow_user"],[4,2,1,"","upload_file"],[4,2,1,"","upload_file_with_slice"]],xhs:[[4,0,1,"","FeedType"],[4,0,1,"","XhsClient"]]},objnames:{"0":["py","class","Python \u7c7b"],"1":["py","attribute","Python \u5c5e\u6027"],"2":["py","method","Python \u65b9\u6cd5"],"3":["py","property","Python property"]},objtypes:{"0":"py:class","1":"py:attribute","2":"py:method","3":"py:property"},terms:{"10":[1,4],"11":4,"12":4,"20":4,"2023":4,"24":4,"280148":4,"30":4,"36":4,"48":4,"5005":0,"86":4,"87323168":4,"default":4,"enum":4,"for":4,"function":4,"if":4,"in":4,"int":4,"return":4,"true":4,"with":4,a1:0,abnorm:4,activ:4,all:4,an:4,and:4,api:[0,4],argument:4,as:4,ats:4,author:4,basic_sign_serv:0,basic_sign_usag:0,basic_usag:0,be:4,bool:4,by:4,can:4,career:4,career_v3:4,cdn:0,check_cod:4,check_qrcod:[1,4],code:4,collect_not:[1,4],com:[3,4],comment:4,comment_id:4,comment_not:[1,4],comment_us:4,content:4,content_typ:4,cooki:[0,1,4],cookie_dict:4,core:4,cosmet:4,cosmetics_v3:4,count:4,cover:4,cover_path:4,crawl:4,crawl_interv:4,creat:4,create_complete_multipart_upload:4,create_image_not:4,create_not:4,create_video_not:4,creator:3,curl:0,cursor:4,data:4,date:4,delete_note_com:[1,4],desc:4,dict:4,dir_path:4,directori:4,dislike_com:[1,4],dislike_not:[1,4],display_titl:4,docker:0,don:4,emot:4,enumer:4,equal:4,explor:4,fact:4,fals:4,fashion_v3:4,fasion:4,feed_typ:4,feedtyp:1,fetch:4,file:4,file_id:4,file_path:4,file_typ:4,first:4,fit:4,fitness_v3:4,flask:3,follow:4,follow_us:[1,4],followed_author:4,food:4,food_v3:4,from:4,game:4,gaming_v3:4,gener:4,get:4,get_emoji:4,get_follow_notif:4,get_home_fe:[1,4],get_home_feed_categori:4,get_like_notif:4,get_mention_notif:4,get_note_all_com:4,get_note_by_id:[1,4],get_note_by_id_from_html:4,get_note_by_keyword:[1,4],get_note_com:[1,4],get_note_sub_com:[1,4],get_notes_statist:4,get_notes_summari:4,get_qrcod:[1,4],get_search_suggest:4,get_self_info2:4,get_self_info:[1,4],get_suggest_at:4,get_suggest_top:4,get_upload_files_permit:4,get_upload_id:4,get_user_all_not:4,get_user_by_keyword:4,get_user_collect_not:[1,4],get_user_info:[1,4],get_user_like_not:[1,4],get_user_not:[1,4],get_video_first_frame_image_id:4,gevent:0,gh:0,greater:4,has:4,has_mor:4,have:4,homefe:4,homefeed_recommend:4,hours:4,household_product_v3:4,http:[0,4],id:[1,4],ignor:4,imag:4,image_info:4,includ:4,info:4,input:4,instal:0,interact:4,interact_info:4,interv:4,is:4,is_creat:4,is_priv:4,is_rec:4,it:[0,4],item:4,jpeg:4,js:0,jsdelivr:0,just:4,keyword:4,kwarg:4,last:4,latest:0,like_com:[1,4],like_not:[1,4],list:4,login_cod:4,love_v3:4,method:4,metric:4,min:0,mobile_token:4,more:4,movi:4,movie_and_tv_v3:4,mp4:4,multi_flag:4,must:4,net:0,none:4,note:4,note_id:4,note_titl:4,note_typ:4,note_user_id:4,num:4,number:4,obj:4,object:4,of:4,onli:4,option:4,or:4,order:4,other:4,page:4,page_s:4,param:4,parent:4,part:4,phone:4,pip:0,playwright:0,png:4,post:4,post_tim:4,properti:4,proxi:[1,4],py:0,python:4,qr_id:4,qrcode:4,reajason:[0,4],recommend:[1,4],report:4,report_note_metr:4,report_typ:4,request:[0,4],requirecool:0,respons:4,root_comment_id:4,run:0,same:4,save:4,save_files_from_note_id:4,search:4,searchnotetyp:4,searchsorttyp:4,second:4,send_cod:4,session:4,should:4,sign:4,simpl:4,size:4,sleep:4,so:4,sort:4,sort_bi:4,stai:4,stay_second:4,stealth:0,store:4,str:4,sub:4,target:4,that:4,thi:4,time:4,timeout:[1,4],titl:4,to:4,token:4,topic:4,trasform:4,travel:4,travel_v3:4,tupl:4,twice:4,type:4,uncollect_not:[1,4],unfollow_us:[1,4],upload_fil:4,upload_file_with_slic:4,upload_id:4,uri:4,url:4,user:4,user_ag:[1,4],user_id:4,valu:4,video:4,video_id:4,video_info:4,video_path:4,viewer:4,viewer_user_id:4,wait_tim:4,want:4,web_sess:0,webid:0,what:4,when:4,which:4,will:4,www:[3,4],xhs:[0,1,3,4],xhs_client:1,xhsclient:[1,3],xhsdiscov:4,xiaohongshu:[3,4],you:4,your:4,zone:4},titles:["\u5feb\u901f\u5165\u95e8","\u4e3b\u9875\u722c\u53d6","\u7b14\u8bb0\u53d1\u5e03","\u4ecb\u7ecd","Documentation"],titleterms:{"class":4,document:4,feedtyp:4,flask:0,the:4,xhsclient:[0,4]}}) \ No newline at end of file diff --git a/source/xhs.html b/source/xhs.html index 8a3c8cc..c7063fc 100644 --- a/source/xhs.html +++ b/source/xhs.html @@ -5,7 +5,7 @@ - Documentation — xhs 0.2.11 文档 + Documentation — xhs 0.2.12 文档 @@ -73,9 +73,17 @@

    The XhsClient
    comment_user(note_id: str, comment_id: str, content: str)[源代码]
    -
    -
    返回类型
    -

    dict

    +

    comment a user comment

    +
    +
    参数
    +
      +
    • content – comment content

    • +
    • note_id – the id of the note

    • +
    • comment_id – target comment_id you want to comment

    • +
    +
    +
    返回类型
    +

    dict

    @@ -156,7 +164,7 @@

    The XhsClient
    -dislike_comment(comment_id: str)[源代码]
    +dislike_comment(note_id: str, comment_id: str)[源代码]
    @@ -587,11 +595,6 @@

    The XhsClientupload_file_with_slice(file_id: str, token: str, file_path: str)[源代码]

    -
    -
    -property user_agent
    -
    -