Add Minecraft/Bedrock/get_bedrock_url.sh

This commit is contained in:
Clarth 2024-01-23 13:56:26 -05:00
parent ccdce4d08b
commit a7b58c571b
1 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#!/bin/bash
#ClayGarth.com
# Must be done from residential IP
# Use curl to fetch the web page
url="https://www.minecraft.net/en-us/download/server/bedrock" # Replace with the actual URL of the website
user_agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36"
page_content=$(curl -s -A "$user_agent" "$url")
# Use grep to find the URL containing "/bin-linux/" and ending with ".zip"
download_url=$(echo "$page_content" | grep -oE 'https://[^"]*/bin-linux/[^"]*\.zip')
echo $download_url > bedrock_url.txt
scp -P 22 /home/clay/bedrock_url.txt url@ip:/home/bedrock/bedrock_url.txt
exit