mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2026-02-03 06:03:25 +00:00
Autocomplete filename #312
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cyberboysumanjay on GitHub.
I have a file who extension can vary every time. But I know the starting name.
For example, I have a file known as testvideo.mkv but it can be testvideo.mp4 also in the second run. I want the script to upload the file starting from testvideo.
I'm calling this command from terminal
curl --upload-file ./testvideo* https://transfer.shBut when I call this from subprocess so that I can use this in a python script. It doesn't seem to work
curl: try 'curl --help' or 'curl --manual' for more information Traceback (most recent call last): File "test.py", line 16, in <module> upload_file('testvideo.mkv') File "test.py", line 11, in upload_file url = subprocess.check_output(cmd,shell=True) File "/usr/lib/python3.5/subprocess.py", line 626, in check_output **kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 708, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['curl', '--progress-bar', '--upload-file', './testvideo*', 'https://transfer.sh/']' returned non-zero exit status 2Any help?
TIA
@paolafrancesca commented on GitHub:
it's a problem with curl: see
man curlglobbing on -T doesn't seem to accept
*wildcard. I'm able to executecurl -v --upload-file "test.{txt,log}" https://transfer.sh/but notcurl -v --upload-file "test*" https://transfer.sh/@paolafrancesca commented on GitHub:
since you're in a python script you can glob from it and build an http put request directly in code