[youtube] correct --no-playlist for python3
authorFilippo Valsorda <filippo.valsorda@gmail.com>
Tue, 1 Oct 2013 15:58:13 +0000 (11:58 -0400)
committerFilippo Valsorda <filippo.valsorda@gmail.com>
Tue, 1 Oct 2013 15:58:13 +0000 (11:58 -0400)
test/test_youtube_lists.py
youtube_dl/extractor/youtube.py

index f28fe78e08a1034c7efd714f78d46f2ba98bc6b1..53e65816dfb9268c40831a57c781a169fbb050b7 100644 (file)
@@ -33,6 +33,7 @@ class TestYoutubeLists(unittest.TestCase):
         ie = YoutubePlaylistIE(dl)
         result = ie.extract('https://www.youtube.com/watch?v=FXxLjLQi3Fg&list=PLwiyx1dc3P2JR9N8gQaQN_BCvlSlap7re')
         self.assertEqual(result['_type'], 'url')
+        self.assertEqual(YoutubeIE()._extract_id(result['url']), 'FXxLjLQi3Fg')
 
     def test_issue_673(self):
         dl = FakeYDL()
index c6876c69f01f78e406f11b825bc49045d854b267..5d932f8a4be630fbc35611165b279a58d4a206b4 100644 (file)
@@ -13,7 +13,6 @@ import struct
 import traceback
 import xml.etree.ElementTree
 import zlib
-import urlparse
 
 from .common import InfoExtractor, SearchInfoExtractor
 from .subtitles import SubtitlesInfoExtractor
@@ -24,6 +23,7 @@ from ..utils import (
     compat_urllib_error,
     compat_urllib_parse,
     compat_urllib_request,
+    compat_urlparse,
     compat_str,
 
     clean_html,
@@ -1527,7 +1527,7 @@ class YoutubePlaylistIE(InfoExtractor):
         playlist_id = mobj.group(1) or mobj.group(2)
 
         # Check if it's a video-specific URL
-        query_dict = urlparse.parse_qs(urlparse.urlparse(url).query)
+        query_dict = compat_urlparse.parse_qs(compat_urlparse.urlparse(url).query)
         if 'v' in query_dict:
             video_id = query_dict['v'][0]
             if self._downloader.params.get('noplaylist'):