import csv from datetime import datetime # Get the current date and time current_datetime = date.now().strftime("%Y-%m-%d") current_datetime = time.now().strftime("%H:%M:%S") # Read the CSV file with open('links.txt', 'r', newline='', encoding='utf-8') as csvfile: # Read CSV data assuming tab-separated values csvreader = csv.reader(csvfile, delimiter='\t') # Prepare HTML content html_content = f""" My Youtube Follows

My Youtube Follows {current_date} {current_time}

This list was generated using the excellent YouTube Exporter for chrome - and a bit of Python (rename .txt to .py) (works with Python Version 3.11.9 # Add proper url for source code """ # Write the HTML content to an HTML file with open('index.html', 'w', encoding='utf-8') as htmlfile: htmlfile.write(html_content) print("HTML file 'index.html' generated successfully.")