Advertisement
Guest User

pctmap.net dowloader

a guest
Nov 28th, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.02 KB | None | 0 0
  1. !/bin/bash
  2. echo Downloading all maps from pctmap.net...
  3. echo This may take a few minutes depending on your internet connection...
  4. # Declare variables
  5.  
  6. # Create directories
  7.  
  8. mkdir $1
  9. mkdir $2
  10.  
  11. # Change to first directory
  12.  
  13. cd $1/
  14.  
  15. # Prepare download
  16.  
  17. wget https://www.pctmap.net/maps/
  18. grep -Po '(?<=href="https://www.pctmap.net/wp-content/uploads)[^"]*' index.html > $1.txt
  19.  
  20. # Download maps
  21.  
  22. input="$1.txt"
  23. while IFS= read -r line
  24. do
  25.   wget https://www.pctmap.net/wp-content/uploads$line
  26. done < "$input"
  27.  
  28. #Unzip maps (remove a duplicate before)
  29.  
  30. rm *.1
  31. unzip "*.zip"
  32.  
  33. # Cleanup
  34.  
  35. rm index.html $1.txt *.zip
  36.  
  37. # Change to second directory
  38.  
  39. cd ../$2
  40.  
  41. # Prepare download
  42.  
  43. wget https://www.pctmap.net/maps-url-loading/
  44. grep -Po '(?<=href="https://www.pctmap.net/wp-content/uploads)[^"]*' index.html > $2.txt
  45.  
  46. # Download
  47.  
  48. input="$2.txt"
  49. while IFS= read -r line
  50. do
  51.   wget https://www.pctmap.net/wp-content/uploads$line
  52. done < "$input"
  53.  
  54. # Cleanup
  55.  
  56. rm index.html $2.txt *.1
  57.  
  58. echo Done! Enjoy your maps
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement