aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-06-19 12:51:26 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-06-19 12:52:44 +0200
commit213b715893ce812b4fb14a79634cf7a132a5f2f5 (patch)
treed9e4abc5e95bc4edaa092ed578a8a1277f8a290a
parent449d5c910cefdbfdfc5aa13d682dc46988a5318e (diff)
parent88cebbd7b8ce5c564adecdfdd6a41ba76193fa26 (diff)
Merge pull request #887 from anisse/master
Fetch all entries that are in a youtube playlist Also add a test.
-rw-r--r--test/test_youtube_lists.py6
-rwxr-xr-xyoutube_dl/InfoExtractors.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/test/test_youtube_lists.py b/test/test_youtube_lists.py
index b842e6cc1..e8b49ff8e 100644
--- a/test/test_youtube_lists.py
+++ b/test/test_youtube_lists.py
@@ -104,5 +104,11 @@ class TestYoutubeLists(unittest.TestCase):
result = ie.extract('https://www.youtube.com/user/TheLinuxFoundation')[0]
self.assertTrue(len(result['entries']) >= 320)
+ def test_youtube_safe_search(self):
+ dl = FakeDownloader()
+ ie = YoutubePlaylistIE(dl)
+ result = ie.extract('PLtPgu7CB4gbY9oDN3drwC3cMbJggS7dKl')[0]
+ self.assertEqual(len(result['entries']), 2)
+
if __name__ == '__main__':
unittest.main()
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py
index f36503d21..db089403f 100755
--- a/youtube_dl/InfoExtractors.py
+++ b/youtube_dl/InfoExtractors.py
@@ -1576,7 +1576,7 @@ class YoutubePlaylistIE(InfoExtractor):
|
((?:PL|EC|UU)[0-9A-Za-z-_]{10,})
)"""
- _TEMPLATE_URL = 'https://gdata.youtube.com/feeds/api/playlists/%s?max-results=%i&start-index=%i&v=2&alt=json'
+ _TEMPLATE_URL = 'https://gdata.youtube.com/feeds/api/playlists/%s?max-results=%i&start-index=%i&v=2&alt=json&safeSearch=none'
_MAX_RESULTS = 50
IE_NAME = u'youtube:playlist'