Browse Source

Merge pull request #887 from anisse/master

Fetch all entries that are in a youtube playlist

Also add a test.
rtmp_test
Jaime Marquínez Ferrándiz 12 years ago
parent
commit
213b715893
2 changed files with 7 additions and 1 deletions
  1. +6
    -0
      test/test_youtube_lists.py
  2. +1
    -1
      youtube_dl/InfoExtractors.py

+ 6
- 0
test/test_youtube_lists.py View File

@ -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()

+ 1
- 1
youtube_dl/InfoExtractors.py View File

@ -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'


Loading…
Cancel
Save