Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Fix bunkr entries
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-WinnfieldX committed Dec 5, 2023
1 parent 54b12cb commit e02c2d4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cyberdrop_dl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "5.0.38"
__version__ = "5.0.39"
2 changes: 1 addition & 1 deletion cyberdrop_dl/scraper/crawlers/bunkrr_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async def other(self, scrape_item: ScrapeItem) -> None:

async def get_stream_link(self, url: URL) -> URL:
"""Gets the stream link for a given url"""
cdn_possibilities = r"^(?:(?:(?:media-files|cdn|c|pizza|cdn-burger)[0-9]{0,2})|(?:(?:big-taco-|cdn-pizza|cdn-meatballs|cdn-milkshake)[0-9]{0,2}(?:redir)?))\.bunkr?\.[a-z]{2,3}$"
cdn_possibilities = r"^(?:(?:(?:media-files|cdn|c|pizza|cdn-burger)[0-9]{0,2})|(?:(?:big-taco-|cdn-pizza|cdn-meatballs|cdn-milkshake|meatballs)[0-9]{0,2}(?:redir)?))\.bunkr?\.[a-z]{2,3}$"

if not re.match(cdn_possibilities, url.host):
return url
Expand Down
5 changes: 3 additions & 2 deletions cyberdrop_dl/scraper/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, manager: Manager):
"redd.it": self.reddit, "redgifs": self.redgifs, "rule34.xxx": self.rule34xxx,
"rule34.xyz": self.rule34xyz, "saint": self.saint, "scrolller": self.scrolller,
"simpcity": self.simpcity, "socialmediagirls": self.socialmediagirls,
"toonily": self.toonily, "xbunker": self.xbunker, "xbunkr": self.xbunkr}
"toonily": self.toonily, "xbunker": self.xbunker, "xbunkr": self.xbunkr, "bunkr": self.bunkrr}
self.download_mapping = {"bunkrr": "bunkrr", "celebforum": "celebforum", "coomer": "coomer",
"cyberdrop": "cyberdrop", "cyberfile": "cyberfile", "e-hentai": "e-hentai",
"erome": "erome", "fapello": "fapello", "f95zone": "f95zone", "gofile": "gofile",
Expand All @@ -52,7 +52,7 @@ def __init__(self, manager: Manager):
"rule34.xxx": "rule34.xxx", "rule34.xyz": "rule34.xyz", "saint": "saint",
"scrolller": "scrolller", "simpcity": "simpcity",
"socialmediagirls": "socialmediagirls", "toonily": "toonily", "xbunker": "xbunker",
"xbunkr": "xbunkr"}
"xbunkr": "xbunkr", "bunkr": "bunkrr"}
self.existing_crawlers = {}
self.manager = manager
self.jdownloader = JDownloader(self.manager)
Expand All @@ -63,6 +63,7 @@ async def bunkrr(self) -> None:
"""Creates a Bunkr Crawler instance"""
from cyberdrop_dl.scraper.crawlers.bunkrr_crawler import BunkrrCrawler
self.existing_crawlers['bunkrr'] = BunkrrCrawler(self.manager)
self.existing_crawlers['bunkr'] = self.existing_crawlers['bunkrr']

async def celebforum(self) -> None:
"""Creates a CelebForum Crawler instance"""
Expand Down
7 changes: 7 additions & 0 deletions cyberdrop_dl/utils/database/tables/history_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ async def startup(self) -> None:
"""Startup process for the HistoryTable"""
await self.db_conn.execute(create_history)
await self.db_conn.commit()
await self.fix_bunkr_v4_entries()

async def check_complete(self, domain: str, url: URL) -> bool:
"""Checks whether an individual file has completed given its domain and url path"""
Expand Down Expand Up @@ -79,3 +80,9 @@ async def get_failed_items(self) -> Iterable[Row]:
result = await cursor.execute("""SELECT * FROM media WHERE completed = 0""")
failed_files = await result.fetchall()
return failed_files

"""~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"""

async def fix_bunkr_v4_entries(self) -> None:
"""Fixes bunkr v4 entries in the database"""
await self.db_conn.execute("""UPDATE media SET domain = 'bunkrr' WHERE domain = 'bunkr'""")
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cyberdrop-dl"
version = "5.0.38"
version = "5.0.39"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit e02c2d4

Please sign in to comment.