summaryrefslogtreecommitdiffstats
path: root/fb.py
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2019-02-06 16:44:34 +0100
committerFlorian Pritz <bluewind@xinu.at>2019-02-06 16:45:13 +0100
commit30270a259c35d84fcedfe7ee1a1aefad655c7fa3 (patch)
treeecc2e197ddea0209ab2adfe67d062a4461e82e60 /fb.py
parentc29e58d29debb86a55d2eb38e7033928df769003 (diff)
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 <bluewind@xinu.at>
Diffstat (limited to 'fb.py')
-rwxr-xr-xfb.py3
1 files changed, 3 insertions, 0 deletions
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: