From 30270a259c35d84fcedfe7ee1a1aefad655c7fa3 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 6 Feb 2019 16:44:34 +0100 Subject: Fix error when repasting a single URL/ID `fb id://1234 --name test` would skip uploading the file since it is already uploaded. With this change, the file is first downloaded and then uploaded again to result in a new ID. Setting the file name via --name does not work yet for this example command and is not addressed by this commit. Signed-off-by: Florian Pritz --- fb.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'fb.py') diff --git a/fb.py b/fb.py index 67a55ad..101959a 100755 --- a/fb.py +++ b/fb.py @@ -609,6 +609,9 @@ class FBClient: upload_files.append(file) + if len(upload_files) == 1 and not upload_files[0].should_upload(): + upload_files[0] = self.url_to_file(self.config['pastebin']+'/'+upload_files[0].id) + resp = self.curlw.upload_files(upload_files) if self.args.multipaste or len(resp) > 1: -- cgit v1.2.3-24-g4f1b