Skip to content

Commit

Permalink
Force English content in whatsapp_ip_addresses_download.sh (#2701)
Browse files Browse the repository at this point in the history
Add the Accept-Language header in the cURL command to ensure the fetched page is in English, improving consistency and clarity in the script output.
  • Loading branch information
fabiodepin authored Jan 30, 2025
1 parent dd4be0a commit aacade6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/whatsapp_ip_addresses_download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ IP_LINK_URL='https://developers.facebook.com/docs/whatsapp/guides/network-requir


echo "(1) Scraping Facebook WhatsApp IP Adresses and Ranges..."
ORIGIN="$(curl -s "${IP_LINK_URL}" | sed -ne 's/.*<a href="\([^"]*\)" target="_blank">WhatsApp server IP addresses and ranges (.zip file)<\/a>.*/\1/gp' | sed -e 's/\&amp;/\&/g')"
ORIGIN="$(curl -H "Accept-Language: en" -s "${IP_LINK_URL}" | sed -ne 's/.*<a href="\([^"]*\)" target="_blank">WhatsApp server IP addresses and ranges (.zip file)<\/a>.*/\1/gp' | sed -e 's/\&amp;/\&/g')"
is_str_empty "${ORIGIN}" "IP webpage list does not contain any addresses. A REGEX update may be required."

echo "(2) Downloading file... ${ORIGIN}"
Expand Down

0 comments on commit aacade6

Please sign in to comment.