Compare commits
5 Commits
65ba2f7ee2
...
main
Author | SHA1 | Date | |
---|---|---|---|
6a5ac1d7d1
|
|||
dd3315b067
|
|||
9856fbecc4
|
|||
59772371a7
|
|||
26e49009ac
|
13
COPYING
Normal file
13
COPYING
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
|
Version 2, December 2004
|
||||||
|
|
||||||
|
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||||
|
|
||||||
|
Everyone is permitted to copy and distribute verbatim or modified
|
||||||
|
copies of this license document, and changing it is allowed as long
|
||||||
|
as the name is changed.
|
||||||
|
|
||||||
|
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. You just DO WHAT THE FUCK YOU WANT TO.
|
@@ -13,5 +13,6 @@ orjson==3.11.1
|
|||||||
propcache==0.3.2
|
propcache==0.3.2
|
||||||
soupsieve==2.7
|
soupsieve==2.7
|
||||||
typing_extensions==4.14.1
|
typing_extensions==4.14.1
|
||||||
|
tzdata==2025.2
|
||||||
urllib3==2.5.0
|
urllib3==2.5.0
|
||||||
yarl==1.20.1
|
yarl==1.20.1
|
||||||
|
@@ -27,7 +27,7 @@ class Scraper(ClientSession):
|
|||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
# 모바일 페이지 및 첨부 파일 요청 시 필요한 기본 헤더 값
|
# 모바일 페이지 및 첨부 파일 요청 시 필요한 기본 헤더 값
|
||||||
self.headers['Accept'] = '*/*'
|
self.headers['Accept'] = 'image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*'
|
||||||
self.headers['User-Agent'] = '(Android)'
|
self.headers['User-Agent'] = '(Android)'
|
||||||
self.headers['Referer'] = 'https://m.dcinside.com/board/aoegame'
|
self.headers['Referer'] = 'https://m.dcinside.com/board/aoegame'
|
||||||
|
|
||||||
@@ -212,6 +212,7 @@ class Scraper(ClientSession):
|
|||||||
attachment.source_suffix = mimetypes.guess_extension(response.content_type)
|
attachment.source_suffix = mimetypes.guess_extension(response.content_type)
|
||||||
|
|
||||||
# Content-Disposition 헤더로부터 실제 파일 이름과 확장자 알아내기
|
# Content-Disposition 헤더로부터 실제 파일 이름과 확장자 알아내기
|
||||||
|
# FIXME: 이런 개시발 디시에서 헤더 인코딩을 터트려서 보내주는군요 (latin-1?)
|
||||||
if response.content_disposition and response.content_disposition.filename:
|
if response.content_disposition and response.content_disposition.filename:
|
||||||
attachment.source_filename = response.content_disposition.filename
|
attachment.source_filename = response.content_disposition.filename
|
||||||
attachment.source_suffix = Path(attachment.source_filename).suffix
|
attachment.source_suffix = Path(attachment.source_filename).suffix
|
||||||
@@ -222,7 +223,7 @@ class Scraper(ClientSession):
|
|||||||
|
|
||||||
# 임시로 받은 파일 옮기기
|
# 임시로 받은 파일 옮기기
|
||||||
if not saved_path.exists():
|
if not saved_path.exists():
|
||||||
shutil.copyfile(temp_file.name, saved_path)
|
shutil.copy2(temp_file.name, saved_path)
|
||||||
|
|
||||||
return attachment
|
return attachment
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user