mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 13:35:16 +03:00
YouTube: regex enhanced; fix #45
This commit is contained in:
parent
7ebeaf9f48
commit
ee3d248afb
@ -1,6 +1,14 @@
|
||||
Changelog
|
||||
=========
|
||||
|
||||
0.3dev-20121221
|
||||
---------------
|
||||
|
||||
*Date: 2012-12-21*
|
||||
|
||||
* YouTube: fix `#45 <https://github.com/soimort/you-get/issues/45>`_.
|
||||
* Merge pull request `#46 <https://github.com/soimort/you-get/pull/46>`_; fix title parsing issue on Tudou.
|
||||
|
||||
0.3dev-20121220
|
||||
---------------
|
||||
|
||||
|
@ -30,19 +30,12 @@ def youtube_download_by_id(id, title = None, output_dir = '.', merge = True, inf
|
||||
'17',
|
||||
'13',
|
||||
]:
|
||||
fmt = r1(r'url=([^,]+)\\u0026itag=' + itag + ",", html)
|
||||
fmt = r1(r'([^,\"]*itag=' + itag + "[^,\"]*)", html)
|
||||
if fmt:
|
||||
url = r1(r'([^\\]+)\\u0026', fmt)
|
||||
if not url:
|
||||
continue
|
||||
|
||||
url = r1(r'url=([^\\]+)', fmt)
|
||||
url = unicodize(url)
|
||||
url = parse.unquote(url)
|
||||
|
||||
sig = r1(r'sig=([^\\]+)\\u0026', fmt)
|
||||
if not sig:
|
||||
continue
|
||||
|
||||
sig = r1(r'sig=([^\\]+)', fmt)
|
||||
url = url + '&signature=' + sig
|
||||
break
|
||||
try:
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__version__ = '0.3dev-20121220'
|
||||
__date__ = '2012-12-20'
|
||||
__version__ = '0.3dev-20121221'
|
||||
__date__ = '2012-12-21'
|
||||
|
Loading…
Reference in New Issue
Block a user