Skip to content

Commit

Permalink
fix(http): FileRequest filename
Browse files Browse the repository at this point in the history
  • Loading branch information
zireael committed Oct 27, 2019
1 parent 157e481 commit 76bc483
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions acrawler/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ async def fetch(self):
family=self.httpfamily,
)
rt = self.response
logger.info(f"<{self.response.status}> ({self.response.url_str})")
logger.info(f"<{self.response.status}> {self.response.url_str}")
return rt
except Exception as e:
raise e
Expand Down Expand Up @@ -517,7 +517,7 @@ def __init__(
self.file_dir = Path(fdir) if fdir else Path.cwd()
self.file_dir.mkdir(parents=True, exist_ok=True)

self.file_name = self.url_str.split("/")[-1]
self.file_name = self.url_str.split("?", 1)[0].rsplit("/", 1)[-1]
ext = self.file_name.split(".")[-1]
if fname:
self.file_name = fname + "." + ext
Expand Down

0 comments on commit 76bc483

Please sign in to comment.