Skip to content

Instantly share code, notes, and snippets.

View revolutionisme's full-sized avatar

Biplob Biswas revolutionisme

View GitHub Profile
@revolutionisme
revolutionisme / convert.py
Created July 4, 2023 08:47 — forked from ghelobytes/convert.py
Convert s3 url to http url
def s3_to_http(url):
if url.startswith('s3://'):
s3_path = url
bucket = s3_path[5:].split('/')[0]
object_name = '/'.join(s3_path[5:].split('/')[1:])
return 'https://s3.amazonaws.com/{0}/{1}'.format(bucket, object_name)
else:
return url