From ee3d248afb25f91bc78545b219445d6ec22a8e2a Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 20 Dec 2012 16:32:09 +0100 Subject: [PATCH] YouTube: regex enhanced; fix #45 --- CHANGELOG.txt | 8 ++++++++ you_get/downloader/youtube.py | 13 +++---------- you_get/version.py | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ddb2fb9a..5cdbbcc0 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,6 +1,14 @@ Changelog ========= +0.3dev-20121221 +--------------- + +*Date: 2012-12-21* + +* YouTube: fix `#45 `_. +* Merge pull request `#46 `_; fix title parsing issue on Tudou. + 0.3dev-20121220 --------------- diff --git a/you_get/downloader/youtube.py b/you_get/downloader/youtube.py index 794e27cc..c990e69f 100644 --- a/you_get/downloader/youtube.py +++ b/you_get/downloader/youtube.py @@ -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: diff --git a/you_get/version.py b/you_get/version.py index be2465d0..6dcfde8e 100644 --- a/you_get/version.py +++ b/you_get/version.py @@ -1,4 +1,4 @@ #!/usr/bin/env python -__version__ = '0.3dev-20121220' -__date__ = '2012-12-20' +__version__ = '0.3dev-20121221' +__date__ = '2012-12-21'