Advertisement
Guest User

dro.pm uploader 1.1

a guest
Jan 19th, 2020
560
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dro.pm uploader - Version 1.1 - check https://dro.pm for new versions.
  2.  
  3. ---
  4.  
  5. Put this in your .bashrc:
  6.  
  7. function dropm { result=$(curl --silent --user-agent cli --form "f=@$1" "https://dro.pm/fileman.php?secret=$2"); if [ "$result" == "1" ]; then echo Done; return; fi; echo "$result" | awk '{print $2}' | tr -d \\n | xsel -b; echo "$result"; }
  8.  
  9. Then use it like this:
  10.  
  11. $ dropm my_file.zip
  12.  
  13. It will give you a code and a short link as result. The short link will automatically be copied to your clipboard. Example output:
  14.  
  15. 5cae34e31c52bd5fee451cc347646a74314a9315 dro.pm/d
  16.  
  17. The code you can use to change the URL like this:
  18.  
  19. $ dropm another_file.bmp 5cae34e31c52bd5fee451cc347646a74314a9315
  20.  
  21. ---
  22.  
  23. If you want to use the function without permanently installing it, or if you want to use it from a headless system (where you don't have a browser), you can easily grab the code from the website itself:
  24.  
  25. $ curl https://dro.pm | head
  26.  
  27. By using "head", you will see the first few lines of dro.pm HTML source code. The second line of the HTML source code contains the Bash function (same as above) which you can copy and just paste in your terminal. If you don't have a mouse to select and copy the text, the third line shows you a way to easily cut it out using standard tools.
  28.  
  29. ---
  30.  
  31. Submitting links or plain text is currently not supported from the command line, only file uploads. Do you want to have this feature? Please open a ticket at https://github.com/lgommans/dro.pm/issues
  32.  
  33. ---
  34.  
  35. Notes:
  36.  
  37. - In short, uploading works like this: curl -sA cli -F f=@my_file.zip https://dro.pm/fileman.php
  38.  
  39. - If you don't want the automatic clipboard copying, remove the 'echo "$result | ... | xsel -b;' part.
  40.  
  41. - Upload progress can be shown by removing --silent.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement