@@ -44,6 +44,7 @@ def __init__(self, webtoon_id: int) -> None:
4444 self .audio_names : dict [int , str ] = {}
4545 super ().__init__ (webtoon_id )
4646 self .headers .update ({"Referer" : "https://comic.naver.com/webtoon/" })
47+ self .json_headers .update ({"Referer" : "https://comic.naver.com/webtoon/" })
4748 # self.comment_headers = httpc.HEADERS | {
4849 self .comment_headers = httpc .HEADERS | {
4950 "Accept" : "*/*" ,
@@ -65,11 +66,9 @@ def __init__(self, webtoon_id: int) -> None:
6566
6667 @async_reload_manager
6768 async def fetch_webtoon_information (self , * , reload : bool = False ) -> None :
68- headers = self .headers .copy ()
69- headers .update ({"Accept" : "application/json, text/plain, */*" })
7069 with WebtoonIdError .redirect_error (self , error_type = (JSONDecodeError , HTTPStatusError )):
7170 url = f"https://comic.naver.com/api/article/list/info?titleId={ self .webtoon_id } "
72- res = await self .client .get (url , headers = headers )
71+ res = await self .client .get (url , headers = self . json_headers )
7372 webtoon_json_info : dict = res .json ()
7473
7574 # 정보 저장
@@ -82,7 +81,7 @@ async def fetch_webtoon_information(self, *, reload: bool = False) -> None:
8281 self ._set_webtoon_type (self .webtoon_type ) # SCREAMING_CASE 웹툰 타입
8382 self .raw_webtoon_info = webtoon_json_info
8483
85- # 심의 확인
84+ # 연령 제한 확인
8685 if not self ._cookie_set and webtoon_json_info ["age" ]["type" ] == "RATE_18" :
8786 raise RatingError (f"In order to download adult webtoon { self .title } , you need valid cookie. Refer to docs to get additional info." )
8887
0 commit comments