Skip to content

Instantly share code, notes, and snippets.

@nanpuyue
Created March 13, 2014 15:00
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save nanpuyue/9530090 to your computer and use it in GitHub Desktop.
Save nanpuyue/9530090 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
@sunboy123
Copy link

只能获取一页不能翻页。。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment