Get title from YouTube videos

前端 未结 17 1954
抹茶落季
抹茶落季 2020-12-07 17:30

I want to extract the Title of YouTube\'s videos. How can I do this?

Thanks.

17条回答
  •  爱一瞬间的悲伤
    2020-12-07 17:37

    With bash, wget and lynx:

    #!/bin/bash
    read -e -p "Youtube address? " address
    page=$(wget "$address" -O - 2>/dev/null)
    title=$(echo "$page" | grep "   - ")
    title="$(lynx --dump -force-html <(echo "
    $title
    ")| grep "  - ")"
    title="${title/*   - /}"
    echo "$title"
    

提交回复
热议问题