import requests as req
import boto3
s3 = boto3.client('s3')
def mp4_save_s3():
url = 'url' # mp4 download url
key = 'test.mp4'
bucket = 'bucketname' # bucketname
res = req.get(url)
res = s3.put_object(Bucket=bucket, Body=res.content, Key=key)
return res['ResponseMetadata']['HTTPStatusCode']
mp4_save_s3()
-------------------------------------------------------------
200
'Python > Python Programming' 카테고리의 다른 글
[ Python ] Python ORM sqlalchemy 이용한 DataFrame Data Insert (0) | 2023.09.29 |
---|---|
[ AWS ] Python boto3를 이용한 RDS 변경 가능한 인스턴스 타입 확인하기 (0) | 2023.06.15 |
[ Python ] requests 모듈 다양한 이용 (0) | 2023.05.25 |
[ Python ] requests 모듈을 이용한 동영상 다운로드 (0) | 2023.05.25 |
[ Python ] 정규식 이용한 IP address 마스킹(감추기) 하기 (3) | 2023.05.24 |
[ Python ] Prometheus metric 값 가져오기 (0) | 2023.05.24 |
[ Python ] Linux 파일 (스토리지) 연도별 개수와 총 용량 구하기 (0) | 2023.05.24 |
[ Python ] socket 모듈을 이용한 Port open / close check (0) | 2023.05.23 |