From 2eb5d315d49b51f3594cda27f44773e826c6cccb Mon Sep 17 00:00:00 2001 From: Philipp Hagemeister Date: Mon, 17 Feb 2014 14:56:21 +0100 Subject: [PATCH] [youtube] Match more truncated URLs (Closes #2402) --- test/test_all_urls.py | 3 +++ youtube_dl/extractor/youtube.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test_all_urls.py b/test/test_all_urls.py index aa8e4e4bd..7a78005a3 100644 --- a/test/test_all_urls.py +++ b/test/test_all_urls.py @@ -68,6 +68,9 @@ class TestAllURLsMatching(unittest.TestCase): def test_youtube_show_matching(self): self.assertMatch('http://www.youtube.com/show/airdisasters', ['youtube:show']) + def test_youtube_truncated(self): + self.assertMatch('http://www.youtube.com/watch?', ['youtube:truncated_url']) + def test_justin_tv_channelid_matching(self): self.assertTrue(JustinTVIE.suitable(u"justin.tv/vanillatv")) self.assertTrue(JustinTVIE.suitable(u"twitch.tv/vanillatv")) diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index a81036843..059cf8cbd 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -1815,7 +1815,7 @@ class YoutubeTruncatedURLIE(InfoExtractor): IE_NAME = 'youtube:truncated_url' IE_DESC = False # Do not list _VALID_URL = r'''(?x) - (?:https?://)?[^/]+/watch\?feature=[a-z_]+$| + (?:https?://)?[^/]+/watch\?(?:feature=[a-z_]+)?$| (?:https?://)?(?:www\.)?youtube\.com/attribution_link\?a=[^&]+$ '''