Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix upload_chuck_file fileName quote #769

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ test.py
itchat.pkl
QR.jpg
.DS_Store
.idea
4 changes: 2 additions & 2 deletions itchat/components/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def upload_chunk_file(core, fileDir, fileSymbol, fileSize,
# save it on server
cookiesList = {name:data for name,data in core.s.cookies.items()}
fileType = mimetypes.guess_type(fileDir)[0] or 'application/octet-stream'
fileName = utils.quote(os.path.basename(fileDir))
fileName = os.path.basename(fileDir)
files = OrderedDict([
('id', (None, 'WU_FILE_0')),
('name', (None, fileName)),
Expand All @@ -358,7 +358,7 @@ def upload_chunk_file(core, fileDir, fileSymbol, fileSize,
('uploadmediarequest', (None, uploadMediaRequest)),
('webwx_data_ticket', (None, cookiesList['webwx_data_ticket'])),
('pass_ticket', (None, core.loginInfo['pass_ticket'])),
('filename' , (fileName, file_.read(524288), 'application/octet-stream'))])
('filename' , (utils.quote(fileName), file_.read(524288), 'application/octet-stream'))])
if chunks == 1:
del files['chunk']; del files['chunks']
else:
Expand Down