Skip to content

Commit 9382a2f

Browse files
authored
Merge pull request #177 from BCSDLab/revert-176-feature/convert_article_content_to_s3_url
Revert "feat: article content s3 업로드 및 url로 변경"
2 parents fd48d2b + a304322 commit 9382a2f

2 files changed

Lines changed: 0 additions & 102 deletions

File tree

crawling/koreatech_article/convert_content.py

Lines changed: 0 additions & 79 deletions
This file was deleted.

crawling/koreatech_article/table.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -105,26 +105,3 @@ def upload_image(s3, file_name: str, image: bytes) -> str:
105105
print(e)
106106

107107
return f'{S3_CONFIG["upload_domain"]}/{file_name}'
108-
109-
def upload_txt(file_name: str, text_content: str) -> str:
110-
s3 = boto3.client(
111-
service_name='s3',
112-
aws_access_key_id=S3_CONFIG['aws_access_key_id'],
113-
aws_secret_access_key=S3_CONFIG['aws_secret_access_key'],
114-
)
115-
encoded_text = text_content.encode('utf-8')
116-
117-
try:
118-
s3.upload_fileobj(
119-
Fileobj=BytesIO(encoded_text),
120-
Bucket=S3_CONFIG['bucket'],
121-
Key=file_name,
122-
ExtraArgs={
123-
'ContentType': 'text/plain; charset=utf-8',
124-
'ACL': 'public-read'
125-
}
126-
)
127-
except Exception as e:
128-
print(e)
129-
130-
return f'{S3_CONFIG["upload_domain"]}/{file_name}'

0 commit comments

Comments
 (0)