YouTube: quick dirty fix to #45

This commit is contained in:
Mort Yao 2012-12-20 03:30:52 +01:00
parent cf721b0c61
commit ccdeeadc49
3 changed files with 18 additions and 4 deletions

View File

@ -1,6 +1,13 @@
Changelog
=========
0.3dev-20121220
---------------
*Date: 2012-12-20*
* YouTube: quick dirty fix to `#45 <https://github.com/soimort/you-get/issues/45>`_.
0.3dev-20121219
---------------

View File

@ -30,12 +30,19 @@ def youtube_download_by_id(id, title = None, output_dir = '.', merge = True, inf
'17',
'13',
]:
fmt = r1(r'itag=' + itag + r'\\u0026([^,]+),', html)
fmt = r1(r'url=([^,]+)\\u0026itag=' + itag + ",", html)
if fmt:
url = r1(r'url=([^\\]+)\\u0026', fmt)
url = r1(r'([^\\]+)\\u0026', fmt)
if not url:
continue
url = unicodize(url)
url = parse.unquote(url)
sig = r1(r'sig=([^\\]+)\\u0026', fmt)
if not sig:
continue
url = url + '&signature=' + sig
break
try:

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
__version__ = '0.3dev-20121219'
__date__ = '2012-12-19'
__version__ = '0.3dev-20121220'
__date__ = '2012-12-20'