import base64

# Base64サブスクリプションをデコードしてノードURIリストを取得する例
def decode_subscription(b64_text: str) -> list[str]:
    b64_text = b64_text.strip()
    # パディング補完
    padding = 4 - len(b64_text) % 4
    if padding != 4:
        b64_text += '=' * padding
    decoded = base64.b64decode(b64_text).decode('utf-8')
    return [line for line in decoded.splitlines() if line.strip()]

# 使用例
nodes = decode_subscription(open('long').read())
for node in nodes[:5]:
    protocol = node.split('://')[0] if '://' in node else 'unknown'
    print(f'[{protocol}] {node[:60]}...')