Skip to content

Bulk asynchronous downloader for multiple file hosts

Update imgbox_crawler.py

Jacob20741e44c630
diff --git a/cyberdrop_dl/scraper/crawlers/imgbox_crawler.py b/cyberdrop_dl/scraper/crawlers/imgbox_crawler.py
index 970e700bc..bea4523dc 100644
--- a/cyberdrop_dl/scraper/crawlers/imgbox_crawler.py
+++ b/cyberdrop_dl/scraper/crawlers/imgbox_crawler.py
@@ -7,8 +7,8 @@ from typing import TYPE_CHECKING
from aiolimiter import AsyncLimiter
from yarl import URL
-from cyberdrop_dl.scraper.crawler import Crawler
from cyberdrop_dl.clients.errors import ScrapeFailure
+from cyberdrop_dl.scraper.crawler import Crawler
from cyberdrop_dl.utils.dataclasses.url_objects import ScrapeItem
from cyberdrop_dl.utils.utilities import error_handling_wrapper, get_filename_and_ext
@@ -46,16 +46,16 @@ class ImgBoxCrawler(Crawler):
async def album(self, scrape_item: ScrapeItem) -> None:
"""Scrapes an album"""
async with self.request_limiter:
- soup: BeautifulSoup = await self.client.get_BS4(self.domain, scrape_item.url, origin= scrape_item)
+ soup: BeautifulSoup = await self.client.get_BS4(self.domain, scrape_item.url, origin=scrape_item)
if "The specified gallery could not be found" in soup.text:
- raise ScrapeFailure(404, f"Gallery not found: {scrape_item.url}", origin= scrape_item)
-
+ raise ScrapeFailure(404, f"Gallery not found: {scrape_item.url}", origin=scrape_item)
+
scrape_item.album_id = scrape_item.url.parts[2]
scrape_item.part_of_album = True
title = await self.create_title(
- soup.select_one("div[id=gallery-view] h1").get_text().strip().rsplit(" - ", 1)[0], scrape_item.album_id ,
+ soup.select_one("div[id=gallery-view] h1").get_text().strip().rsplit(" - ", 1)[0], scrape_item.album_id,
None)
scrape_item.part_of_album = True
@@ -75,7 +75,7 @@ class ImgBoxCrawler(Crawler):
return
async with self.request_limiter:
- soup: BeautifulSoup = await self.client.get_BS4(self.domain, scrape_item.url, origin= scrape_item)
+ soup: BeautifulSoup = await self.client.get_BS4(self.domain, scrape_item.url, origin=scrape_item)
image = URL(soup.select_one("img[id=img]").get('src'))
filename, ext = await get_filename_and_ext(image.name)