Advertisement
Guest User

Untitled

a guest
Jul 26th, 2022
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. ##### shell for linux
  2. #!/bin/bash
  3. OUTDIR="soundpostbackup"; mkdir $OUTDIR
  4. for f in *catbox*.webm; do
  5. URL=$(echo $f | sed -n "s/^.*\(https.*\)].*$/\1/p" | sed -re 's/%2[Ff]/\//g' -e 's/%3[Aa]/:/g')
  6. FILENAME="$OUTDIR/$(echo -n $URL | awk -F / '{print $NF}')"
  7. echo "Downloading $URL to $FILENAME"
  8. curl -L -s -k "$URL" > $FILENAME
  9. done
  10.  
  11. #### powershell if you're a windows user
  12. Add-Type -AssemblyName System.Web
  13. $outdir = ".\soundpostbackup"
  14. $ProgressPreference = "SilentlyContinue"
  15. new-item -type dir $outdir -force
  16. (get-childitem -recurse *catbox*.webm).name | %{
  17. $filename = $_;
  18. $url = [System.Web.HttpUtility]::UrlDecode(($filename | select-string ".*(https.*)].*").matches.groups[1].value)
  19. $output = "soundpostbackup/" + $url.split('/')[-1]
  20. write-host "Downloading $url to $output"
  21. invoke-webrequest $url -outfile $output
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement