Skip to content

Commit 696515c

Browse files
committed
feat: cooke값을 option으로도 제공할 수 있도록 변경
1 parent eea082f commit 696515c

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

WebtoonScraper/scrapers/_scraper.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,11 @@ def _from_string(cls, string: str, /, **kwargs):
303303
return cls(int(string), **kwargs) # type: ignore
304304

305305
def _apply_option(self, option: str, value: str) -> None:
306-
logger.warning(f"Unknown option {option!r} for {self.PLATFORM} scraper with value: {value!r}")
306+
match option:
307+
case "cookie":
308+
self.cookie = value
309+
case _:
310+
logger.warning(f"Unknown option {option!r} for {self.PLATFORM} scraper with value: {value!r}")
307311

308312
def _set_cookie(self, value: str) -> None:
309313
self.headers.update({"Cookie": value})
@@ -1043,13 +1047,13 @@ async def check_episode_directory(
10431047
await scraper.callbacks.async_callback(
10441048
"download_failed",
10451049
callback or scraper.callbacks.create(
1046-
"[{episode_no1}/{total_ep}] The episode '{short_ep_title}' is failed {description}",
1050+
"[{episode_no1}/{total_ep}] The episode '{short_ep_title}' is failed{description}",
10471051
progress_update="{short_ep_title} skipped",
10481052
level="warning",
10491053
log_with_progress=True,
10501054
),
10511055
reason="gathering_images_failed",
1052-
description="because no images are found",
1056+
description="" if image_urls is None else " because no images are found",
10531057
**context,
10541058
)
10551059
return

0 commit comments

Comments
 (0)