From 18590d770ed1dd72667751a5f4356c195270d973 Mon Sep 17 00:00:00 2001 From: Ketanest <87452756+Ketanest@users.noreply.github.com> Date: Wed, 7 Jun 2023 23:39:29 +0200 Subject: [PATCH] Added telegram (#4) --- .github/workflows/update.yml | 7 +++++-- README.md | 8 +++++++- telegram/downloader.sh | 11 +++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 telegram/downloader.sh diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index f6a4e3a5..b244ea7d 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -26,11 +26,12 @@ jobs: bash facebook/downloader.sh bash twitter/downloader.sh bash linode/downloader.sh + bash telegram/downloader.sh - name: Create All-In-One ranges run: | - cat google/ipv4.txt amazon/ipv4.txt microsoft/ipv4.txt oracle/ipv4.txt digitalocean/ipv4.txt bing/ipv4.txt github/ipv4.txt facebook/ipv4.txt twitter/ipv4.txt linode/ipv4.txt | sort -h | uniq > all/ipv4.txt - cat google/ipv6.txt amazon/ipv6.txt microsoft/ipv6.txt digitalocean/ipv6.txt github/ipv6.txt facebook/ipv6.txt twitter/ipv6.txt linode/ipv6.txt | sort -h | uniq > all/ipv6.txt + cat google/ipv4.txt amazon/ipv4.txt microsoft/ipv4.txt oracle/ipv4.txt digitalocean/ipv4.txt bing/ipv4.txt github/ipv4.txt facebook/ipv4.txt twitter/ipv4.txt linode/ipv4.txt telegram/ipv4.txt | sort -h | uniq > all/ipv4.txt + cat google/ipv6.txt amazon/ipv6.txt microsoft/ipv6.txt digitalocean/ipv6.txt github/ipv6.txt facebook/ipv6.txt twitter/ipv6.txt linode/ipv6.txt telegram/ipv6.txt | sort -h | uniq > all/ipv6.txt - name: Set up Python 3.7 uses: actions/setup-python@v2 @@ -65,6 +66,7 @@ jobs: python utils/merge.py --source=facebook/ipv4.txt | sort -h > facebook/ipv4_merged.txt python utils/merge.py --source=twitter/ipv4.txt | sort -h > twitter/ipv4_merged.txt python utils/merge.py --source=linode/ipv4.txt | sort -h > linode/ipv4_merged.txt + python utils/merge.py --source=telegram/ipv4.txt | sort -h > telegram/ipv4_merged.txt python utils/merge.py --source=all/ipv4.txt | sort -h > all/ipv4_merged.txt # ipv6 python utils/merge.py --source=google/ipv6.txt | sort -h > google/ipv6_merged.txt @@ -77,6 +79,7 @@ jobs: python utils/merge.py --source=facebook/ipv6.txt | sort -h > facebook/ipv6_merged.txt python utils/merge.py --source=twitter/ipv6.txt | sort -h > twitter/ipv6_merged.txt python utils/merge.py --source=linode/ipv6.txt | sort -h > linode/ipv6_merged.txt + python utils/merge.py --source=telegram/ipv6.txt | sort -h > telegram/ipv6_merged.txt python utils/merge.py --source=all/ipv6.txt | sort -h > all/ipv6_merged.txt - name: Commit files diff --git a/README.md b/README.md index 90821575..0818ba35 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![IP Ranges](logo.png) -List all IP ranges from: Google (Cloud & GoogleBot), Bing (Bingbot), Amazon (AWS), Microsoft (Azure), Oracle (Cloud), DigitalOcean, GitHub, Facebook (Meta), Twitter and Linode with daily updates. +List all IP ranges from: Google (Cloud & GoogleBot), Bing (Bingbot), Amazon (AWS), Microsoft (Azure), Oracle (Cloud), DigitalOcean, GitHub, Facebook (Meta), Twitter, Linode and Telegram with daily updates. All lists are obtained from public sources. @@ -82,6 +82,12 @@ All addresses are stored in `.txt` files with CIDRs, where each range is on a ne - IPv6: https://raw.githubusercontent.com/lord-alfred/ipranges/main/linode/ipv6.txt - IPv6 (merged): https://raw.githubusercontent.com/lord-alfred/ipranges/main/linode/ipv6_merged.txt +### Telegram +- IPv4: https://raw.githubusercontent.com/lord-alfred/ipranges/main/telegram/ipv4.txt +- IPv4 (merged): https://raw.githubusercontent.com/lord-alfred/ipranges/main/telegram/ipv4_merged.txt +- IPv6: https://raw.githubusercontent.com/lord-alfred/ipranges/main/telegram/ipv6.txt +- IPv6 (merged): https://raw.githubusercontent.com/lord-alfred/ipranges/main/telegram/ipv6_merged.txt + ## All-In-One IPs A list of IP addresses from all sources combined into one file. diff --git a/telegram/downloader.sh b/telegram/downloader.sh new file mode 100644 index 00000000..4d10fd01 --- /dev/null +++ b/telegram/downloader.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -euo pipefail +set -x + +# get ranges from telegram +curl -s https://core.telegram.org/resources/cidr.txt > /tmp/telegram.txt + +# seperate IPv4 and IPv6, sort an uniq +grep -v ':' /tmp/telegram.txt | sort -h | uniq > telegram/ipv4.txt +grep ':' /tmp/telegram.txt | sort -h | uniq > telegram/ipv6.txt