From a7b58c571bb722ff9a1ab251da4b8f9d333c347d Mon Sep 17 00:00:00 2001 From: Clarth Date: Tue, 23 Jan 2024 13:56:26 -0500 Subject: [PATCH] Add Minecraft/Bedrock/get_bedrock_url.sh --- Minecraft/Bedrock/get_bedrock_url.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Minecraft/Bedrock/get_bedrock_url.sh diff --git a/Minecraft/Bedrock/get_bedrock_url.sh b/Minecraft/Bedrock/get_bedrock_url.sh new file mode 100644 index 0000000..0c281ac --- /dev/null +++ b/Minecraft/Bedrock/get_bedrock_url.sh @@ -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