p-doom/crowd-code-dataset-0.2 huggingface dataset:
[tab] extract_vid_list.py (python)
from yt_dlp import YoutubeDL

def extract_video_links_from_playlist(playlist_url, output_file):
    ydl_opts = {
        'quiet': True,
        'extract_flat': True,  # Do not download the videos, only extract metadata
        'skip_download': True,  # Skip actual download
    }

    with YoutubeDL(ydl_opts) as ydl:
        result = ydl.extract_info(playlist_url, download=False)
        
        if 'entries' in result:
            video_urls = [entry['url'] for entry in result['entries']]
            
            with open(output_file, 'w') as f:
                for video_url in video_urls:
                    f.write(f"{video_url}
")
            print(f"Video links extracted to {output_file}")
        else:
            print("No videos found in the playlist.")

if __name__ == "__main__":
    playlist_url = input("Enter the YouTube playlist URL: ")
    output_file = "links/tmp-1.txt"
    extract_video_links_from_playlist(playlist_url, output_file)

# hello hello bla bla