From e4be79c179bfbb99978a5b574de281adf4f1fecc Mon Sep 17 00:00:00 2001 From: itdoginfo Date: Thu, 3 Apr 2025 12:57:43 +0300 Subject: [PATCH] TG fix --- .github/workflows/create-lists.yml | 2 +- convert.py | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/create-lists.yml b/.github/workflows/create-lists.yml index edba92c..538e47e 100644 --- a/.github/workflows/create-lists.yml +++ b/.github/workflows/create-lists.yml @@ -31,7 +31,7 @@ jobs: -v ${{ github.workspace }}/Services:/app/Services \ -v ${{ github.workspace }}/SRS:/app/SRS \ -v ${{ github.workspace }}/DAT:/app/DAT \ - itdoginfo/compilesrs:0.1.13 + itdoginfo/compilesrs:0.1.14 - name: Check Russia/inside-dnsmasq-ipset uses: itdoginfo/dnsmasq-action@0.1 diff --git a/convert.py b/convert.py index e7ad53e..3e9f914 100755 --- a/convert.py +++ b/convert.py @@ -20,6 +20,7 @@ DiscordSubnets = 'Subnets/IPv4/discord.lst' MetaSubnets = 'Subnets/IPv4/meta.lst' TwitterSubnets = 'Subnets/IPv4/twitter.lst' TelegramSubnets = 'Subnets/IPv4/telegram.lst' +ExcludeServices = {"telegram.lst"} def raw(src, out): domains = set() @@ -29,8 +30,8 @@ def raw(src, out): for dir_path in src: path = Path(dir_path) if path.is_dir(): - files.extend(path.glob('*')) - elif path.is_file(): + files.extend(f for f in path.glob('*') if f.name not in ExcludeServices) + elif path.is_file() and path.name not in ExcludeServices: files.append(path) for f in files: @@ -58,8 +59,8 @@ def dnsmasq(src, out, remove={'google.com'}): for dir_path in src: path = Path(dir_path) if path.is_dir(): - files.extend(path.glob('*')) - elif path.is_file(): + files.extend(f for f in path.glob('*') if f.name not in ExcludeServices) + elif path.is_file() and path.name not in ExcludeServices: files.append(path) for f in files: @@ -92,8 +93,8 @@ def clashx(src, out, remove={'google.com'}): for dir_path in src: path = Path(dir_path) if path.is_dir(): - files.extend(path.glob('*')) - elif path.is_file(): + files.extend(f for f in path.glob('*') if f.name not in ExcludeServices) + elif path.is_file() and path.name not in ExcludeServices: files.append(path) for f in files: @@ -121,8 +122,8 @@ def kvas(src, out, remove={'google.com'}): for dir_path in src: path = Path(dir_path) if path.is_dir(): - files.extend(path.glob('*')) - elif path.is_file(): + files.extend(f for f in path.glob('*') if f.name not in ExcludeServices) + elif path.is_file() and path.name not in ExcludeServices: files.append(path) for f in files: @@ -150,8 +151,8 @@ def mikrotik_fwd(src, out, remove={'google.com'}): for dir_path in src: path = Path(dir_path) if path.is_dir(): - files.extend(path.glob('*')) - elif path.is_file(): + files.extend(f for f in path.glob('*') if f.name not in ExcludeServices) + elif path.is_file() and path.name not in ExcludeServices: files.append(path) for f in files: