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

Commit

Permalink
Bunkr extra handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules-WinnfieldX committed Jan 27, 2024
1 parent 66bfb97 commit 3833021
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 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.1.53"
__version__ = "5.1.54"
23 changes: 22 additions & 1 deletion cyberdrop_dl/scraper/crawlers/bunkrr_crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,16 @@ async def video(self, scrape_item: ScrapeItem) -> None:
try:
filename, ext = await get_filename_and_ext(link.name)
except NoExtensionFailure:
filename, ext = await get_filename_and_ext(scrape_item.url.name)
try:
link_container = soup.select_one("source")
link = URL(link_container.get('src'))
filename, ext = await get_filename_and_ext(link.name)
except Exception as e:
if "get" in link.host:
link = await self.reinforced_link(link)
filename, ext = await get_filename_and_ext(link.name)
else:
filename, ext = await get_filename_and_ext(scrape_item.url.name)

await self.handle_file(link, scrape_item, filename, ext)

Expand All @@ -127,6 +136,18 @@ async def other(self, scrape_item: ScrapeItem) -> None:

await self.handle_file(link, scrape_item, filename, ext)

@error_handling_wrapper
async def reinforced_link(self, url: URL) -> URL:
"""Gets the download link for a given reinforced URL"""
"""get.bunkr.su"""
async with self.request_limiter:
soup = await self.client.get_BS4(self.domain, url)

link_container = soup.select("a[class*=bg-blue-500]")[-1]
link = URL(link_container.get('href'))

return link

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

async def get_stream_link(self, url: URL) -> URL:
Expand Down
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.1.53"
version = "5.1.54"
description = "Bulk downloader for multiple file hosts"
authors = ["Jules Winnfield <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 3833021

Please sign in to comment.