Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
Minor fixes and changes
Jules-WinnfieldXdeb1a8d0baa7
diff --git a/README.md b/README.mdindex dade15d80..0712730ea 100644--- a/README.md+++ b/README.md@@ -8,29 +8,33 @@ The latest version of the program is 3.6.51# Supported Sites-| Website | Supported Link Types |-|------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-| Anonfiles | Download page: Anonfiles.com/... |-| Bayfiles | Download page: Bayfiles.com/... |-| Bunkr | Albums: bunkr.ru/a/... <br> Direct Videos: stream.bunkr.ru/v/... <br> Direct links: cdn.bunkr.ru/... <br> Direct links: i.bunkr.ru/... <br> Direct links: files.bunkr.ru/... <br> Direct links: media-files.bunkr.ru/... |-| Coomer.party | Profiles: coomer.party/... <br> Thumbnail Links: coomer.party/thumbnail/... <br> Data Links: coomer.party/data/... <br> coomer.party/.../post/... |-| Cyberdrop | Albums: cyberdrop.me/a/... <br> Direct Videos: fs-0#.cyberdrop.me/... <br> Direct Videos: f.cyberdrop.me/... <br> Direct Images: img-0#.cyberdrop.me/... <br> Direct Images: f.cyberdrop.me/... <br> Also works with .cc, .to, and .nl |-| Cyberfile | folders: cyberfile.su/folder/... <br> shared: cyberfile.su/shared/... <br> Direct: cyberfile.su/... |-| Erome | Albums: erome.com/a/... |-| Fapello | Models: fapello.com/... |-| GoFile | Albums: gofile.io/d/... |-| HGameCG | Albums: hgamecg.com/.../index.html |-| ImgBox | Albums: imgbox.com/g/... <br> Direct Images: images#.imgbox.com/... <br> Single Files: imgbox.com/... |-| IMG.Kiwi | Albums: img.kiwi/album/... <br> Direct Images: img.kiwi/image/... <br> User Profile: img.kiwi/#USER# <br> All User Albums: img.kiwi/#USER#/albums |-| jpg.church | Albums: jpg.church/album/... <br> Direct Images: jpg.church/image/... <br> User Profile: jpg.church/#USER# <br> All User Albums: jpg.church/#USER#/albums |-| LeakedNudes | Thread: forum.leakednudes.co/threads/... <br> Continue from (will download this post and after): forum.leakednudes.co/threads/...post-NUMBER |-| PixelDrain | Albums: Pixeldrain.com/l/... <br> Single Files: Pixeldrain.com/u/... |-| Pixl | Albums: pixl.li/album/... <br> Direct Images: pixl.li/image/... <br> User Profile: pixl.li/#USER# <br> All User Albums: pixl.li/#USER#/albums |-| Postimg.cc | Albums: postimg.cc/gallery/... <br> Direct Images: postimg.cc/... |-| rule34.xxx | Direct Media (Image and Video): rule34.xxx/index.php?page=post&s=view&id=... |-| SimpCity | Thread: simpcity.st/threads/... <br> Continue from (will download this post and after): simpcity.st/threads/...post-NUMBER |-| SocialMediaGirls | Thread: forum.socialmediagirls.com/threads/... <br> Continue from (will download this post and after): forum.socialmediagirls.com/threads/...post-NUMBER |-| XBunkr | Album: xbunkr.com/a/... <br> Direct Links: media.xbunkr.com/... |+| Website | Supported Link Types |+|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|+| Anonfiles | Download page: Anonfiles.com/... |+| Bayfiles | Download page: Bayfiles.com/... |+| Bunkr | Albums: bunkr.ru/a/... <br> Direct Videos: stream.bunkr.ru/v/... <br> Direct links: cdn.bunkr.ru/... <br> Direct links: i.bunkr.ru/... <br> Direct links: files.bunkr.ru/... <br> Direct links: media-files.bunkr.ru/... |+| Coomer.party | Profiles: coomer.party/... <br> Thumbnail Links: coomer.party/thumbnail/... <br> Data Links: coomer.party/data/... <br> coomer.party/.../post/... |+| Cyberdrop | Albums: cyberdrop.me/a/... <br> Direct Videos: fs-0#.cyberdrop.me/... <br> Direct Videos: f.cyberdrop.me/... <br> Direct Images: img-0#.cyberdrop.me/... <br> Direct Images: f.cyberdrop.me/... <br> Also works with .cc, .to, and .nl |+| Cyberfile | folders: cyberfile.su/folder/... <br> shared: cyberfile.su/shared/... <br> Direct: cyberfile.su/... |+| E-Hentai | Albums: e-hentai.org/g/... <br> Posts: e-hentai.org/s/... |+| Erome | Albums: erome.com/a/... |+| Fapello | Models: fapello.com/... |+| GoFile | Albums: gofile.io/d/... |+| Gfycat | Gif: gfycat.com/... |+| HGameCG | Albums: hgamecg.com/.../index.html |+| ImgBox | Albums: imgbox.com/g/... <br> Direct Images: images#.imgbox.com/... <br> Single Files: imgbox.com/... |+| IMG.Kiwi | Albums: img.kiwi/album/... <br> Direct Images: img.kiwi/image/... <br> User Profile: img.kiwi/#USER# <br> All User Albums: img.kiwi/#USER#/albums |+| jpg.church<br/>jpg.fish | Albums: jpg.church/album/... <br> Direct Images: jpg.church/image/... <br> User Profile: jpg.church/#USER# <br> All User Albums: jpg.church/#USER#/albums |+| LoveFap | Albums: lovefap.com/a/... <br> Direct Images: s*.lovefap.com/content/photos/... <br> Videos: lovefap.com/video/... |+| NSFW.XXX | Profile: nsfw.xxx/user/... <br> Post: nsfw.xxx/post/... |+| PimpAndHost | Albums: pimpandhost.com/album/... <br> Single Files: pimpandhost.com/image/... |+| PixelDrain | Albums: Pixeldrain.com/l/... <br> Single Files: Pixeldrain.com/u/... |+| Pixl | Albums: pixl.li/album/... <br> Direct Images: pixl.li/image/... <br> User Profile: pixl.li/#USER# <br> All User Albums: pixl.li/#USER#/albums |+| Postimg.cc | Albums: postimg.cc/gallery/... <br> Direct Images: postimg.cc/... |+| SimpCity | Thread: simpcity.st/threads/... <br> Continue from (will download this post and after): simpcity.st/threads/...post-NUMBER |+| SocialMediaGirls | Thread: forum.socialmediagirls.com/threads/... <br> Continue from (will download this post and after): forum.socialmediagirls.com/threads/...post-NUMBER |+| XBunker | Thread: xbunker.su/threads/... <br> Continue from (will download this post and after): xbunker.su/threads/...post-NUMBER |+| XBunkr | Album: xbunkr.com/a/... <br> Direct Links: media.xbunkr.com/... |Reminder to leave the link full (include the https://)diff --git a/cyberdrop_dl/base_functions/data_classes.py b/cyberdrop_dl/base_functions/data_classes.pyindex aaf293fa5..bb1cc460f 100644--- a/cyberdrop_dl/base_functions/data_classes.py+++ b/cyberdrop_dl/base_functions/data_classes.py@@ -233,7 +233,7 @@ class FileLock:@dataclassclass SkipData:"""The allows optoins for domains to skip when scraping"""- supported_hosts: ClassVar[Tuple[str]] = ("anonfiles", "bunkr", "coomer.party", "cyberdrop",+ supported_hosts: ClassVar[Tuple[str]] = ("anonfiles", "bayfiles", "bunkr", "coomer.party", "cyberdrop","cyberfile", "e-hentai", "erome", "fapello", "gfycat", "gofile","hgamecg", "img.kiwi", "imgbox", "jpg.church", "jpg.fish", "kemono.party","lovefap", "nsfw.xxx", "pimpandhost", "pixeldrain", "pixl.li", "postimg",diff --git a/cyberdrop_dl/base_functions/sorting_functions.py b/cyberdrop_dl/base_functions/sorting_functions.pyindex a7cfdefc6..f59a45557 100644--- a/cyberdrop_dl/base_functions/sorting_functions.py+++ b/cyberdrop_dl/base_functions/sorting_functions.py@@ -75,7 +75,6 @@ class Sorter:temp_stem = stemext = file.suffixi = 1- delete = Falsewhile (dest / f"{temp_stem}{ext}").is_file() and file.is_file():if file.stat().st_size == (dest / file.name).stat().st_size:file.unlink()diff --git a/cyberdrop_dl/client/client.py b/cyberdrop_dl/client/client.pyindex 376125d02..1c84e6db0 100644--- a/cyberdrop_dl/client/client.py+++ b/cyberdrop_dl/client/client.py@@ -23,7 +23,8 @@ from ..base_functions.error_classes import DownloadFailure, InvalidContentTypeFaclass Client:"""Creates a 'client' that can be referenced by scraping or download sessions"""- def __init__(self, ratelimit: int, throttle: int, secure: bool):+ def __init__(self, ratelimit: int, throttle: int, secure: bool, connect_timeout: int):+ self.connect_timeout = connect_timeoutself.ratelimit = ratelimitself.throttle = throttleself.simultaneous_session_limit = asyncio.Semaphore(50)@@ -39,7 +40,7 @@ class ScrapeSession:self.client = clientself.rate_limiter = AsyncRateLimiter(self.client.ratelimit)self.headers = {"user-agent": client.user_agent}- self.timeouts = aiohttp.ClientTimeout(5 * 60, 30)+ self.timeouts = aiohttp.ClientTimeout(total=5 * 60, connect=self.client.connect_timeout)self.client_session = aiohttp.ClientSession(headers=self.headers, raise_for_status=True, cookie_jar=self.client.cookies, timeout=self.timeouts)async def get_BS4(self, url: URL):@@ -111,10 +112,10 @@ class ScrapeSession:class DownloadSession:"""AIOHTTP operations for downloading"""- def __init__(self, client: Client, conn_timeout: int):+ def __init__(self, client: Client):self.client = clientself.headers = {"user-agent": client.user_agent}- self.timeouts = aiohttp.ClientTimeout(5*60, conn_timeout)+ self.timeouts = aiohttp.ClientTimeout(total=5 * 60, connect=self.client.connect_timeout)self.client_session = aiohttp.ClientSession(headers=self.headers, raise_for_status=True, cookie_jar=self.client.cookies, timeout=self.timeouts)self.throttle_times = {}diff --git a/cyberdrop_dl/downloader/downloaders.py b/cyberdrop_dl/downloader/downloaders.pyindex 9b94ada81..965675ed9 100644--- a/cyberdrop_dl/downloader/downloaders.py+++ b/cyberdrop_dl/downloader/downloaders.py@@ -71,7 +71,7 @@ class Downloader:domain: str, domain_obj: DomainItem, semaphore: asyncio.Semaphore, files: Files):self.backup_scraper = scraperself.client = client- self.download_session = DownloadSession(client, args["Ratelimiting"]["connection_timeout"])+ self.download_session = DownloadSession(client)self.File_Lock = FileLock()self.SQL_Helper = SQL_Helperdiff --git a/cyberdrop_dl/main.py b/cyberdrop_dl/main.pyindex 0edf78640..1919f0996 100644--- a/cyberdrop_dl/main.py+++ b/cyberdrop_dl/main.py@@ -66,7 +66,7 @@ def parse_args() -> argparse.Namespace:# Ratelimitingparser.add_argument("--connection-timeout", type=int, help="number of seconds to wait attempting to connect to a URL during the downloading phase", default=15)- parser.add_argument("--ratelimit", type=int, help="this will add a ratelimiter to requests made in the program during scraping, the number you provide is in requests/seconds", default=50)+ parser.add_argument("--ratelimit", type=int, help="this applies to requests made in the program during scraping, the number you provide is in requests/seconds", default=50)parser.add_argument("--throttle", type=int, help="this is a throttle between requests during the downloading phase, the number is in seconds", default=0.5)# Forum Options@@ -176,7 +176,8 @@ async def director(args: dict, links: list) -> None:exit(1)links = await consolidate_links(args, links)- client = Client(args['Ratelimiting']['ratelimit'], args['Ratelimiting']['throttle'], args['Runtime']['allow_insecure_connections'])+ client = Client(args['Ratelimiting']['ratelimit'], args['Ratelimiting']['throttle'],+ args['Runtime']['allow_insecure_connections'], args["Ratelimiting"]["connection_timeout"])SQL_Helper = SQLHelper(args['Ignore']['ignore_history'], args['Ignore']['ignore_cache'], args['Files']['db_file'])Scraper = ScrapeMapper(args, client, SQL_Helper, False)diff --git a/cyberdrop_dl/scraper/Scraper.py b/cyberdrop_dl/scraper/Scraper.pyindex 54b03bddb..f10dc7fe9 100644--- a/cyberdrop_dl/scraper/Scraper.py+++ b/cyberdrop_dl/scraper/Scraper.py@@ -86,9 +86,9 @@ class ScrapeMapper:self.socialmediagirls_semaphore = asyncio.Semaphore(1)self.xbunker_semaphore = asyncio.Semaphore(1)- self.mapping = {"anonfiles": self.Anonfiles, "xbunkr": self.XBunkr, "bunkr": self.Bunkr,- "cyberdrop": self.Cyberdrop, "cyberfile": self.CyberFile, "erome": self.Erome,- "fapello": self.Fapello, "gfycat": self.Gfycat, "gofile": self.GoFile,+ self.mapping = {"anonfiles": self.Anonfiles, "bayfiles": self.Anonfiles,"xbunkr": self.XBunkr,+ "bunkr": self.Bunkr, "cyberdrop": self.Cyberdrop, "cyberfile": self.CyberFile,+ "erome": self.Erome, "fapello": self.Fapello, "gfycat": self.Gfycat, "gofile": self.GoFile,"hgamecg": self.HGameCG, "imgbox": self.ImgBox, "pixeldrain": self.PixelDrain,"postimg": self.PostImg, "saint": self.Saint, "img.kiwi": self.ShareX,"jpg.church": self.ShareX, "jpg.fish": self.ShareX, "pixl.li": self.ShareX,