Discussion

I Just Got Rick Rolled by Chat GPT

My Prompt: Can you write some python code that gets the view count, the title, and the thumbnail from a youtube video link?

The response:

Sure, here is some example code that gets the view count, title, and thumbnail from a youtube video link using the youtube-dl library:

  import youtube_dl
  
  # Set the youtube video URL
  url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
  
  # Use youtube-dl to get video information
  with youtube_dl.YoutubeDL() as ydl:
      video_info = ydl.extract_info(url, download=False)
  
  # Print the video view count, title, and thumbnail
  print(video_info['view_count'])
  print(video_info['title'])
  print(video_info['thumbnail'])
Note that you need to have the youtube-dl library installed to run this code. You can install it using pip install youtube-dl.
8 points cjoverbay 3 years ago 1 comments

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton