Skip to content

Instantly share code, notes, and snippets.

@jackberry
Forked from nanpuyue/youtube-list.sh
Created June 3, 2018 12:05
Show Gist options
  • Save jackberry/96cd92eaf86e5af5ca0ffc0dd07e91db to your computer and use it in GitHub Desktop.
Save jackberry/96cd92eaf86e5af5ca0ffc0dd07e91db to your computer and use it in GitHub Desktop.
用于获取youtube播放列表内的所有视频地址
#!/bin/bash
#
# e.g.
# for https://www.youtube.com/playlist?list=PLL7JeXQtCv0MslQgUCV3DvKmaagaB9Nms use:
# youtube-list.sh PLL7JeXQtCv0MslQgUCV3DvKmaagaB9Nms
for i in \
`curl -s "https://www.youtube.com/playlist?list=$1" |\
grep -Po "/watch.*?$1" |\
sed -r "s#&.*##" | uniq`;
do
echo "https://www.youtube.com$i" >> list.txt
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment