add youtube playlist parser
This commit is contained in:
parent
f3d91b78d6
commit
e2bffccd36
1 changed files with 10 additions and 0 deletions
|
@ -120,6 +120,16 @@ def videos(id, format=''):
|
||||||
streams[stream['itag']] = stream
|
streams[stream['itag']] = stream
|
||||||
return streams
|
return streams
|
||||||
|
|
||||||
|
def playlist(url):
|
||||||
|
data = read_url(url)
|
||||||
|
items = []
|
||||||
|
for i in list(set(re.compile('<a href="(/watch\?v=.*?)" title="(.*?)" ').findall(data))):
|
||||||
|
items.append({
|
||||||
|
'title': i[1],
|
||||||
|
'url': 'http://youtube.com' + i[0].split('&')[0]
|
||||||
|
})
|
||||||
|
return items
|
||||||
|
|
||||||
def download_webm(id, filename):
|
def download_webm(id, filename):
|
||||||
stream_type = 'video/webm'
|
stream_type = 'video/webm'
|
||||||
url = "http://www.youtube.com/watch?v=%s" % id
|
url = "http://www.youtube.com/watch?v=%s" % id
|
||||||
|
|
Loading…
Reference in a new issue