diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2013-12-04 14:16:52 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2013-12-04 14:18:49 +0100 |
commit | 27dcce19045670fc348ff1119c0d2283aaed3ae2 (patch) | |
tree | 81e1237fd856f945af2ffbdb629c6869477ee716 /youtube_dl/extractor/youtube.py | |
parent | 84db81815af6787d91188ca065cc9ced4d83a4ca (diff) | |
download | youtube-dl-27dcce19045670fc348ff1119c0d2283aaed3ae2.zip youtube-dl-27dcce19045670fc348ff1119c0d2283aaed3ae2.tar.gz youtube-dl-27dcce19045670fc348ff1119c0d2283aaed3ae2.tar.bz2 |
[youtube] Resolve URLs in comments
Diffstat (limited to 'youtube_dl/extractor/youtube.py')
-rw-r--r-- | youtube_dl/extractor/youtube.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 66f5af0..7fff761 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -336,7 +336,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor): u"uploader": u"Philipp Hagemeister", u"uploader_id": u"phihag", u"upload_date": u"20121002", - u"description": u"test chars: \"'/\\ä↭𝕐\n\nThis is a test video for youtube-dl.\n\nFor more information, contact phihag@phihag.de ." + u"description": u"test chars: \"'/\\ä↭𝕐\ntest URL: https://github.com/rg3/youtube-dl/issues/1892\n\nThis is a test video for youtube-dl.\n\nFor more information, contact phihag@phihag.de ." } }, { @@ -1366,6 +1366,15 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor): # description video_description = get_element_by_id("eow-description", video_webpage) if video_description: + video_description = re.sub(r'''(?x) + <a\s+ + (?:[a-zA-Z-]+="[^"]+"\s+)*? + title="([^"]+)"\s+ + (?:[a-zA-Z-]+="[^"]+"\s+)*? + class="yt-uix-redirect-link"\s*> + [^<]+ + </a> + ''', r'\1', video_description) video_description = clean_html(video_description) else: fd_mobj = re.search(r'<meta name="description" content="([^"]+)"', video_webpage) |