Update 酒店源.py

This commit is contained in:
frxz751113
2024-09-02 17:23:33 +08:00
committed by GitHub
parent 3019ce3a09
commit c19b043924
+2 -2
View File
@@ -415,11 +415,11 @@ for url in urls:
name = item.get('name') name = item.get('name')
# 从字典中获取'url'键的值,如果键不存在则返回None # 从字典中获取'url'键的值,如果键不存在则返回None
urlx = item.get('url') urlx = item.get('url')
print(f"过滤要排除的url: {urlx}")
match = re.search(r'182\.117\.136\.\d{1,3}\.\d{1,3}\:\d{1,5}|192\.168\.\d{1,3}\.\d{1,3}\:\d{1,5}|10\.0\.0\.\d{1,3}\:\d{1,5}', urlx) match = re.search(r'182\.117\.136\.\d{1,3}\.\d{1,3}\:\d{1,5}|192\.168\.\d{1,3}\.\d{1,3}\:\d{1,5}|10\.0\.0\.\d{1,3}\:\d{1,5}', urlx)
print(f"排除IP: {match.group()}") print(f"排除的ip行: {match.group()}")
# 如果urlx包含'udp'或'rtp'字符串,则跳过当前循环的剩余部分 # 如果urlx包含'udp'或'rtp'字符串,则跳过当前循环的剩余部分
if 'udp' in urlx or 'rtp' in urlx: if 'udp' in urlx or 'rtp' in urlx:
print(f"排除关键词: {urlx}")
continue # 跳过包含'udp'或'rtp'的url continue # 跳过包含'udp'或'rtp'的url
# 使用正则表达式判断 IP # 使用正则表达式判断 IP
if match: if match: