You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Collect arguements and remove the first element as it would be the filename
urls=sys.argv
delurls[0]
#Create a new dictionary that will hold the types of urls that will be passed on to the file ( this will be usefull to assign all urls to each type of download )
filtered_urls= {}
defis_downloadable(url):
"""
Does the url contain a downloadable resource
"""
h=requests.head(url)
header=h.headers
content_type=header.get('content-type')
if'text'incontent_type.lower():
returnFalse
if'html'incontent_type.lower():
returnFalse
returnTrue
defs3dl(path):
try:
# Match regex and breakdown to get bucket, filepath and filename