Skip to content

Commit 5448cc3

Browse files
committed
download_interval case 변경 및 기본값 설정
1 parent 290e4fa commit 5448cc3

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

WebtoonScraper/scrapers/_lezhin_comics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class LezhinComicsScraper(Scraper[str]):
3333
"""
3434

3535
PLATFORM = "lezhin_comics"
36+
download_interval = 0
3637
information_vars = Scraper.information_vars | Scraper._build_information_dict(
3738
"is_shuffled",
3839
"webtoon_int_id",

WebtoonScraper/scrapers/_naver_webtoon.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
class NaverWebtoonScraper(Scraper[int]):
2626
"""Scrape webtoons from Naver Webtoon."""
2727
PLATFORM = "naver_webtoon"
28-
DOWNLOAD_INTERVAL = 0.5
2928
information_vars = (
3029
Scraper.information_vars
3130
| Scraper._build_information_dict("raw_articles", "raw_webtoon_info", "episode_audio_urls", subcategory="extra")

WebtoonScraper/scrapers/_scraper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class Scraper(Generic[WebtoonId]): # MARK: SCRAPER
145145
서브클래스 파라미터를 override=True로 두어야 합니다.
146146
스크래퍼 자동 등록을 회피하려면 register=False로 두세요.
147147
148-
DOWNLOAD_INTERVAL (int):
148+
download_interval (int):
149149
각 다운로드 사이에 쉬는 시간을 정합니다.
150150
151151
EXTRA_INFO_SCRAPER_FACTORY (type[ExtraInfoScraper]):
@@ -155,7 +155,7 @@ class Scraper(Generic[WebtoonId]): # MARK: SCRAPER
155155

156156
# MARK: CLASS VARIABLES
157157
PLATFORM: ClassVar[str]
158-
DOWNLOAD_INTERVAL: int | float = 0
158+
download_interval: int | float = 0.5
159159
EXTRA_INFO_SCRAPER_FACTORY: type[ExtraInfoScraper] = ExtraInfoScraper
160160
information_vars: dict[str, None | str | Path | Callable] = dict(
161161
title=None,
@@ -738,7 +738,7 @@ async def _download_episode(self, episode_no: int, webtoon_directory: Path, cont
738738
)
739739

740740
# fetch image urls
741-
time.sleep(self.DOWNLOAD_INTERVAL) # 실제로 요청을 보내기 직전에 interval을 넣음.
741+
time.sleep(self.download_interval) # 실질적인 외부 요청을 보내기 직전에만 interval을 넣음.
742742
try:
743743
image_urls = await self.get_episode_image_urls(episode_no)
744744
except BaseException as exc:

0 commit comments

Comments
 (0)