mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 03:17:44 +03:00
parent
311f5d1509
commit
44ce2e8f31
@ -1,6 +1,13 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
0.3dev-20121212
|
||||
---------------
|
||||
|
||||
*Date: 2012-12-12*
|
||||
|
||||
* YouTube: fix some major issues on parsing video titles.
|
||||
|
||||
0.3dev-20121210
|
||||
---------------
|
||||
|
||||
|
@ -4,10 +4,14 @@ __all__ = ['youtube_download', 'youtube_download_by_id']
|
||||
|
||||
from ..common import *
|
||||
|
||||
import json
|
||||
|
||||
def youtube_download_by_id(id, title = None, output_dir = '.', merge = True, info_only = False):
|
||||
html = request.urlopen('http://www.youtube.com/watch?v=' + id).read().decode('utf-8')
|
||||
|
||||
title = r1(r'"title": "([^"]+)"', html)
|
||||
html = unescape_html(html)
|
||||
yt_player_config = json.loads(r1(r'yt.playerConfig = ([^\n]+);\n', html))
|
||||
title = yt_player_config['args']['title']
|
||||
title = unicodize(title)
|
||||
title = parse.unquote(title)
|
||||
title = escape_file_path(title)
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__version__ = '0.3dev-20121210'
|
||||
__date__ = '2012-12-10'
|
||||
__version__ = '0.3dev-20121212'
|
||||
__date__ = '2012-12-12'
|
||||
|
Loading…
x
Reference in New Issue
Block a user