From f834c0192118bded576165695025d800501c124c Mon Sep 17 00:00:00 2001 From: Kacper Ziubryniewicz Date: Thu, 25 Apr 2019 22:50:32 +0200 Subject: [PATCH] Fix sending remote files with URLs containing GET parameters or hashtags (#423) --- fbchat/_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbchat/_util.py b/fbchat/_util.py index 4e943d5..6b5c489 100644 --- a/fbchat/_util.py +++ b/fbchat/_util.py @@ -288,7 +288,7 @@ def get_files_from_urls(file_urls): # https://stackoverflow.com/a/37060758 files.append( ( - basename(file_url), + basename(file_url).split("?")[0].split("#")[0], r.content, r.headers.get("Content-Type") or guess_type(file_url)[0], )