3

Im looking to extract the video title or video description from youtube videos in google sheets. I have the URL and when i write the importxml formula, it keeps just showing me "Share your videos with friends, family, and the world" for the description and only "Youtube" if I change it to the title. Has something changed on youtube side?

Example: =importxml(F3,"//meta[@name='description']/@content")

Cell F3 contains value: https://www.youtube.com/watch?v=cwttM41xVBY

Output from formula: Share your videos with friends, family, and the world

player0
  • 124,011
  • 12
  • 67
  • 124
Tai
  • 65
  • 2
  • 11
  • Also, this seems to be only with youtube URLs, other sites seem to be pulling in the description just fine – Tai Aug 11 '21 at 23:02

1 Answers1

8

try:

=REGEXEXTRACT(QUERY(FLATTEN(IMPORTDATA(A1)), 
 "where Col1 starts with 'title:""'", 0), """(.*)""")

enter image description here

player0
  • 124,011
  • 12
  • 67
  • 124
  • 1
    Thank you! this looks to have worked. Do you know how I would modify this if I also want to pull the description of the video? – Tai Aug 12 '21 at 21:34
  • 1
    @Tai unfortunately, description is scattered all over so this approach is not ideal for that: https://i.stack.imgur.com/dPgRI.png – player0 Aug 12 '21 at 21:46