Skip to content

Bulk asynchronous downloader for multiple file hosts

Add support for redgif user scraping

Jules-WinnfieldX65f24426f098
diff --git a/README.md b/README.md
index 4ee4f70ef..7283db8f2 100644
--- a/README.md
+++ b/README.md
@@ -31,39 +31,39 @@ Read the [Wiki](https://github.com/Jules-WinnfieldX/CyberDropDownloader/wiki/)!
## Supported Sites
-| Website | Supported Link Types |
-|------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
-| Anonfiles | Download page: Anonfiles.com/... |
-| Bayfiles | Download page: Bayfiles.com/... |
-| Bunkr (ru/su/la) | 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<br>Coomer.su | 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/... |
-| Gallery.DeltaPorno.com | Albums: Gallery.DeltaPorno.com/album/... <br> Direct Images: Gallery.DeltaPorno.com/image/... <br> User Profile: Gallery.DeltaPorno.com/#USER# <br> All User Albums: Gallery.DeltaPorno.com/#USER#/albums |
-| 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 |
-| imgur.com | Albums: imgur.com/a/... <br> Direct Images: i.imgur.com/... |
+| Website | Supported Link Types |
+|--------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| Anonfiles | Download page: Anonfiles.com/... |
+| Bayfiles | Download page: Bayfiles.com/... |
+| Bunkr (ru/su/la) | 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<br>Coomer.su | 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/... |
+| Gallery.DeltaPorno.com | Albums: Gallery.DeltaPorno.com/album/... <br> Direct Images: Gallery.DeltaPorno.com/image/... <br> User Profile: Gallery.DeltaPorno.com/#USER# <br> All User Albums: Gallery.DeltaPorno.com/#USER#/albums |
+| 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 |
+| imgur.com | Albums: imgur.com/a/... <br> Direct Images: i.imgur.com/... |
| jpg.church<br>jpg.fish<br>jpg.fishing<br>jpg.pet<br>jpeg.pet | Albums: jpg.church/album/... <br> Direct Images: jpg.church/image/... <br> User Profile: jpg.church/#USER# <br> All User Albums: jpg.church/#USER#/albums |
-| Kemono.party<br>Kemono.su | Profiles: kemono.party/... <br> Discord Pages: kemono.party/discord/... <br> Thumbnail Links: kemono.party/thumbnail/... <br> Data Links: kemono.party/data/... <br> kemono.party/.../post/... |
-| 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/... |
-| reddit.com | Users: reddit.com/u/... <br> Subreddits: reddit.com/r/... <br> Direct Images: i.redd.it/... |
-| redgifs.com | Gif: redgifs.com/... |
-| NudoStar | Thread: nudostar.com/forum/threads/... <br> Continue from (will download this post and after): nudostar.com/forum/threads/...post-NUMBER |
-| 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.nu/threads/... <br> Continue from (will download this post and after): xbunker.nu/threads/...post-NUMBER |
-| XBunkr | Album: xbunkr.com/a/... <br> Direct Links: media.xbunkr.com/... |
+| Kemono.party<br>Kemono.su | Profiles: kemono.party/... <br> Discord Pages: kemono.party/discord/... <br> Thumbnail Links: kemono.party/thumbnail/... <br> Data Links: kemono.party/data/... <br> kemono.party/.../post/... |
+| 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/... |
+| reddit.com | Users: reddit.com/u/... <br> Subreddits: reddit.com/r/... <br> Direct Images: i.redd.it/... |
+| redgifs.com | Gif: redgifs.com/... <br> User: redgifs.com/users/... |
+| NudoStar | Thread: nudostar.com/forum/threads/... <br> Continue from (will download this post and after): nudostar.com/forum/threads/...post-NUMBER |
+| 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.nu/threads/... <br> Continue from (will download this post and after): xbunker.nu/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/__init__.py b/cyberdrop_dl/__init__.py
index 7b8d4c04e..dcde83991 100644
--- a/cyberdrop_dl/__init__.py
+++ b/cyberdrop_dl/__init__.py
@@ -1 +1 @@
-__version__ = "4.2.167"
+__version__ = "4.2.168"
diff --git a/cyberdrop_dl/crawlers/RedGifs_Spider.py b/cyberdrop_dl/crawlers/RedGifs_Spider.py
index dbb395453..c1a356077 100644
--- a/cyberdrop_dl/crawlers/RedGifs_Spider.py
+++ b/cyberdrop_dl/crawlers/RedGifs_Spider.py
@@ -38,14 +38,10 @@ class RedGifsCrawler:
self.headers = {"Authorization": f"Bearer {self.token}"}
async with self.limiter:
- id = url.parts[-1] if url.parts[-1] != "" else url.parts[-2]
- id = id.split(".")[0]
- json_obj = await session.get_json(self.redgifs_api / "v2/gifs" / id, headers_inc=self.headers)
- links = json_obj["gif"]["urls"]
- if "hd" in links:
- await self.get_image(URL(links["hd"]), url, "Loose Redgif Files", domain_obj)
+ if "users" in url.parts:
+ await self.get_user(session, url, domain_obj)
else:
- await self.get_image(URL(links["sd"]), url, "Loose Redgif Files", domain_obj)
+ await self.get_individual(session, url, domain_obj)
await self.SQL_Helper.insert_domain("redgifs", url, domain_obj)
log(f"Finished: {url}", quiet=self.quiet, style="green")
@@ -55,6 +51,33 @@ class RedGifsCrawler:
return domain_obj
+ async def get_user(self, session: ScrapeSession, url: URL, domain_obj: DomainItem):
+ user_id = url.parts[-1] if url.parts[-1] != "" else url.parts[-2]
+ user_id = user_id.split(".")[0]
+ page = 1
+ total_pages = 1
+ while page <= total_pages:
+ json_obj = await session.get_json((self.redgifs_api / "v2/users" / user_id / "search").with_query(f"page={page}"), headers_inc=self.headers)
+ total_pages = json_obj["pages"]
+ gifs = json_obj["gifs"]
+ for gif in gifs:
+ links = gif["urls"]
+ if "hd" in links:
+ await self.get_image(URL(links["hd"]), url, "Loose Redgif Files", domain_obj)
+ else:
+ await self.get_image(URL(links["sd"]), url, "Loose Redgif Files", domain_obj)
+ page += 1
+
+ async def get_individual(self, session: ScrapeSession, url: URL, domain_obj: DomainItem):
+ source_id = url.parts[-1] if url.parts[-1] != "" else url.parts[-2]
+ source_id = source_id.split(".")[0]
+ json_obj = await session.get_json(self.redgifs_api / "v2/gifs" / source_id, headers_inc=self.headers)
+ links = json_obj["gif"]["urls"]
+ if "hd" in links:
+ await self.get_image(URL(links["hd"]), url, "Loose Redgif Files", domain_obj)
+ else:
+ await self.get_image(URL(links["sd"]), url, "Loose Redgif Files", domain_obj)
+
async def get_image(self, url: URL, referer: URL, title: str, domain_obj: DomainItem):
try:
filename, ext = await get_filename_and_ext(url.name, True)