import os

def update_youtube_links():
    target_url = "https://youtube.com/@tormediaranchi3804?si=UPTCSJUSj9tbcjeB"
    html_files = [f for f in os.listdir('.') if f.endswith('.html')]
    
    count = 0
    for fname in html_files:
        with open(fname, 'r', encoding='utf-8') as f:
            content = f.read()

        if 'href="https://youtube.com"' in content:
            new_content = content.replace('href="https://youtube.com"', f'href="{target_url}"')
            with open(fname, 'w', encoding='utf-8') as f:
                f.write(new_content)
            count += 1
            print(f"Updated YouTube links in {fname}")

    print(f"Total files updated: {count}")

if __name__ == '__main__':
    update_youtube_links()
