Brutalitops Posted September 29, 2020 Share Posted September 29, 2020 I'm looking for an application that can download all image, video, and audio files of a specific link. In addition, a tool that can drill down a specified number of times. For example, i want to download all media types from a given link and then drill down one layer and download all media types from the link posted in the original link. I hope that makes sense. Thanks. Quote Link to comment Share on other sites More sharing options...
Irukandji Posted September 29, 2020 Share Posted September 29, 2020 What exactly are you planning to do with the downloads?? Quote Link to comment Share on other sites More sharing options...
Brutalitops Posted September 29, 2020 Author Share Posted September 29, 2020 archive them for later use. Quote Link to comment Share on other sites More sharing options...
digininja Posted September 29, 2020 Share Posted September 29, 2020 wget does what you want wget -m <url> Quote Link to comment Share on other sites More sharing options...
Brutalitops Posted September 29, 2020 Author Share Posted September 29, 2020 Thank you @digininja, is there anyway i can drill down using this command??? Quote Link to comment Share on other sites More sharing options...
digininja Posted September 29, 2020 Share Posted September 29, 2020 check man wget Quote Link to comment Share on other sites More sharing options...
REDTEAMER Posted December 5, 2022 Share Posted December 5, 2022 You can also use free file services like oshit.at etc Quote Link to comment Share on other sites More sharing options...
0phoi5 Posted April 18, 2023 Share Posted April 18, 2023 If I wanted to do this, I'd use Python. Something like this; import os import requests from bs4 import BeautifulSoup def download_media(url, depth=0): # Set maximum depth if depth > 2: return # Request the page content response = requests.get(url) soup = BeautifulSoup(response.text, 'html.parser') # Create a directory for the current page's media page_dir = url.split('/')[-1] if page_dir == '': page_dir = 'index' if not os.path.exists(page_dir): os.mkdir(page_dir) # Download all images and videos for tag in soup.find_all(['img', 'video']): src = tag.get('src') if src is None: continue if 'http' not in src: src = url + src filename = src.split('/')[-1] filepath = os.path.join(page_dir, filename) try: response = requests.get(src) with open(filepath, 'wb') as f: f.write(response.content) print(f'Downloaded {filename} from {url}') except Exception as e: print(f'Error downloading {filename} from {url}: {e}') # Recursively download media from linked pages for link in soup.find_all('a'): href = link.get('href') if href is None: continue if 'http' not in href: href = url + href download_media(href, depth=depth+1) if __name__ == '__main__': url = input('Enter a URL: ') download_media(url) I used GPT to assist in writing the above. Prompts for a URL, then downloads media up to 3 levels deep. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.