テスト用の動画をYouTubeから調達
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import pafy v = pafy.new("https://www.youtube.com/watch?v=xxxxxx") print(v.title) print(v.duration) print(v.rating) print(v.author) print(v.length) print(v.keywords) print(v.thumb) print(v.videoid) print(v.viewcount) streams = v.streams for i in streams: print(i) <em># get best resolution regardless of format </em> best = v.getbest() print(best.resolution, best.extension) <em># Download the video </em> best.download() |