Bulk asynchronous downloader for multiple file hosts
Python asynciobunkrcyberdropdownloaderdropboxfilestergofilegoogle-drivemediafiremegamega-nzonedrivepatreonpawchivepinterestpixeldraintransfer-ittwitchtwittervk
Merge CDL 4 into master
Jules-WinnfieldXe8fdfc09246b
diff --cc README.mdindex 9701554c8,6e56cb6db..864987093--- a/README.md+++ b/README.md@@@ -1,8 -1,8 +1,9 @@@# `cyberdrop-dl`**Bulk downloader for multiple file hosts**- The latest version of the program is 3.6.64+ The latest version of the program is 4.0.1++<a href="https://www.buymeacoffee.com/juleswinnft" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>If you want to support me and my effort you can buy me a coffee or send me some crypto:@@@ -85,43 -97,72 +98,73 @@@ positional argumentslink link to content to download (passing multiple links is supported)optional arguments:- -h, --help show this help message and exit- -V, --version show program's version number and exit- -i INPUT_FILE, --input-file INPUT_FILE file containing links to download- -o OUTPUT_FOLDER, --output-folder OUTPUT_FOLDER folder to download files to- --log-file LOG_FILE log file to write to- --db-file history DB file to write to- --config-file config file to read arguments from- --threads THREADS number of threads to use (0 = max)- --attempts ATTEMPTS number of attempts to download each file- --connection-timeout number of seconds to wait attempting to connect to a URL during the downloading phase- --disable-attempt-limit disables stopping the program based on attempt limits- --include-id include the ID in the download folder name- --exclude-videos exclude video files from downloading- --exclude-images exclude image files from downloading- --exclude-audio exclude audio files from downloading- --exclude-other exclude other files from downloading- --ignore-history ignores previous history and downloads everything- --output-last-forum-post Outputs the last post of a forum scrape to use as a starting point for future runs- --proxy HTTP/HTTPS proxy used for downloading, format [protocal]://[ip]:[port]- --separate-posts Separates forum scraping into folders by post number- --mark-downloaded Sets the scraped files as downloaded without downloading- --required-free-space Required free space (in gigabytes) for the program to run- --pixeldrain-api-key api key for premium pixeldrain- --xbunker-username username to login to xbunker (only required if the thread requires it)- --xbunker-password password to login to xbunker (only required if the thread requires it)- --socialmediagirls-username username to login to socialmediagirls (only required if the thread requires it)- --socialmediagirls-password password to login to socialmediagirls (only required if the thread requires it)- --simpcity-username username to login to simpcity (only required if the thread requires it)- --simpcity-password password to login to simpcity (only required if the thread requires it)- --jdownloader-enable enables sending unsupported urls to a running jdownloader2 instance to download- --jdownloader-username username to login to jdownloader- --jdownloader-password password to login to jdownloader- --jdownloader-device device to login to for jdownloader- --skip this removes the specified hosts links from downloads- --ratelimit this will add a ratelimiter to requests made in the program, the number you provide is in requests/second- --throttle this is a throttle between requests during the downloading phase, the number is in seconds+ -h, --help show this help message and exit+ -V, --version show program's version number and exit+ -i INPUT_FILE, --input-file INPUT_FILE file containing links to download+ -o OUTPUT_FOLDER, --output-folder OUTPUT_FOLDER folder to download files to++ --config-file config file to read arguments from+ --db-file history database file to write to+ --errored-urls-file csv file to write failed download information to+ --log-file log file to write to+ --output-last-forum-post-file text file to output last scraped post from a forum thread for re-feeding into CDL+ --unsupported-urls-file csv file to output unsupported links into++ --exclude-audio skip downloading of audio files+ --exclude-images skip downloading of image files+ --exclude-other skip downloading of images+ --exclude-videos skip downloading of video files+ --ignore-cache ignores previous runs cached scrape history+ --ignore-history ignores previous download history+ --skip removes host links from downloads++ --allow-insecure-connections allows insecure connections from content hosts+ --attempts number of attempts to download each file+ --block-sub-folders block sub folders from being created+ --disable-attempt-limit disables the attempt limitation+ --include-id include the ID in the download folder name+ --skip-download-mark-completed sets the scraped files as downloaded without downloading+ --output-errored-urls sets the failed urls to be output to the errored urls file+ --output-unsupported-urls sets the unsupported urls to be output to the unsupported urls file+ --proxy HTTP/HTTPS proxy used for downloading, format [protocal]://[ip]:[port]+ --remove-bunker-identifier removes the bunkr added identifier from output filenames+ --required-free-space required free space (in gigabytes) for the program to run+ --simultaneous-downloads-per-domain number of simultaneous downloads to use per domain++ --sort-downloads sorts downloaded files after downloads have finished+ --sort-directory folder to download files to+ --sorted-audio schema to sort audio+ --sorted-images schema to sort images+ --sorted-others schema to sort other+ --sorted-videos schema to sort videos++ --connection-timeout number of seconds to wait attempting to connect to a URL during the downloading phase+ --ratelimit this applies to requests made in the program during scraping, the number you provide is in requests/seconds+ --throttle this is a throttle between requests during the downloading phase, the number is in seconds++ --output-last-forum-post outputs the last post of a forum scrape to use as a starting point for future runs+ --separate-posts separates forum scraping into folders by post number++ --pixeldrain-api-key api key for premium pixeldrain+ --simpcity-password password to login to simpcity+ --simpcity-username username to login to simpcity+ --socialmediagirls-password password to login to socialmediagirls+ --socialmediagirls-username username to login to socialmediagirls+ --xbunker-password password to login to xbunker+ --xbunker-username username to login to xbunker++ --apply-jdownloader enables sending unsupported URLs to a running jdownloader2 instance to download+ --jdownloader-username username to login to jdownloader+ --jdownloader-password password to login to jdownloader+ --jdownloader-device device name to login to for jdownloader++ --dont-show-overall-progress removes overall progress section while downloading+ --dont-show-forum-progress removes forum progress section while downloading+ --dont-show-thread-progress removes thread progress section while downloading+ --dont-show-domain-progress removes domain progress section while downloading+ --dont-show-album-progress removes album progress section while downloading+ --dont-show-file-progress removes file progress section while downloading+```- --skip can use: "anonfiles", "bunkr", "coomer.party", "cyberdrop", "cyberfile", "erome", "fapello", "gfycat",- "gofile", "hgamecg", "imgbox", "img.kiwi", "jpg.fish", "pixeldrain", "pixl.li", "postimg.cc",- "redgifs", "rule34", "saint", "socialmediagirls", "simpcity", "xbunker", "xbunkr"+++ --skip-hosts can use: `"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", "saint", "simpcity", "socialmediagirls", "xbunker", "xbunkr"`diff --cc cyberdrop_dl/crawlers/CyberFile_Spider.pyindex 277b358a5,10bb6df07..90cf5c356--- a/cyberdrop_dl/crawlers/CyberFile_Spider.py+++ b/cyberdrop_dl/crawlers/CyberFile_Spider.py@@@ -14,29 -15,37 +15,38 @@@ class CyberFileCrawlerself.load_files = URL('https://cyberfile.me/account/ajax/load_files')self.file_details = URL('https://cyberfile.me/account/ajax/file_details')- async def fetch(self, session: Session, url: URL):- await log("Starting scrape of " + str(url), quiet=self.quiet)- domain_obj = DomainItem("cyberfile.su", {})+ async def fetch(self, session: ScrapeSession, url: URL):+ """Director for cyberfile scraping"""+ await log(f"[green]Starting: {str(url)}[/green]", quiet=self.quiet)+ domain_obj = DomainItem("cyberfile", {})++download_links = []if 'folder' in url.parts:- nodeId = await self.folder_nodeId(session, url)- contentIds = await self.folder_content(session, url, nodeId, 1)- download_links = await self.get_download_links(session, url, contentIds)+ Folder_ID = await self.get_folder_id(session, url)+ Content_IDs = None+ if Folder_ID:+ Content_IDs = await self.get_folder_content(session, url, Folder_ID, 1)+ if Content_IDs:+ download_links = await self.get_download_links(session, url, Content_IDs)elif 'shared' in url.parts:- nodeIds, contentIds = await self.shared_nodeId_root_content(session, url, 1)- for title, nodeId in nodeIds:- contentIds.extend(await self.shared_content(session, url, nodeId, 1, title))- download_links = await self.get_download_links(session, url, contentIds)+ Node_IDs, Content_IDs = await self.get_shared_ids_and_content(session, url, 1)+ for title, Node_ID in Node_IDs:+ Content_IDs.extend(await self.get_shared_content(session, url, Node_ID, 1, title))+ download_links = await self.get_download_links(session, url, Content_IDs)else:- contentId = await self.get_single_contentId(session, url)- if contentId:- download_links = await self.get_download_links(session, url, [("Loose Cyberfile Files", contentId)])- for title, download_link in download_links:- await domain_obj.add_to_album(title, download_link, url)- await log("Finished scrape of " + str(url), quiet=self.quiet)+ Content_ID = await self.get_single_contentId(session, url)+ if Content_ID:+ download_links = await self.get_download_links(session, url, [("Loose CyberFile Files", Content_ID)])++ for title, media_item in download_links:+ await domain_obj.add_media(title, media_item)+ url_path = await get_db_path(url)+ await self.SQL_Helper.insert_domain("cyberfile", url_path, domain_obj)+ await log(f"[green]Finished: {str(url)}[/green]", quiet=self.quiet)return domain_obj- async def folder_nodeId(self, session: Session, url: URL):+ async def get_folder_id(self, session: ScrapeSession, url: URL):+ """Gets the internal ID for a folder"""try:soup = await session.get_BS4(url)script_func = soup.select_one('div[class="page-container horizontal-menu with-sidebar fit-logo-with-sidebar logged-out clear-adblock"] script').text