]>
jfr.im git - yt-dlp.git/blob - test/test_playlists.py
7 # Allow direct execution
9 sys
.path
.append(os
.path
.dirname(os
.path
.dirname(os
.path
.abspath(__file__
))))
11 from youtube_dl
.extractor
import DailymotionPlaylistIE
, VimeoChannelIE
, UstreamChannelIE
, SoundcloudUserIE
12 from youtube_dl
.utils
import *
14 from helper
import FakeYDL
16 class TestPlaylists(unittest
.TestCase
):
17 def assertIsPlaylist(self
, info
):
18 """Make sure the info has '_type' set to 'playlist'"""
19 self
.assertEqual(info
['_type'], 'playlist')
21 def test_dailymotion_playlist(self
):
23 ie
= DailymotionPlaylistIE(dl
)
24 result
= ie
.extract('http://www.dailymotion.com/playlist/xv4bw_nqtv_sport/1#video=xl8v3q')
25 self
.assertIsPlaylist(result
)
26 self
.assertEqual(result
['title'], u
'SPORT')
27 self
.assertTrue(len(result
['entries']) > 20)
29 def test_vimeo_channel(self
):
31 ie
= VimeoChannelIE(dl
)
32 result
= ie
.extract('http://vimeo.com/channels/tributes')
33 self
.assertIsPlaylist(result
)
34 self
.assertEqual(result
['title'], u
'Vimeo Tributes')
35 self
.assertTrue(len(result
['entries']) > 24)
37 def test_ustream_channel(self
):
39 ie
= UstreamChannelIE(dl
)
40 result
= ie
.extract('http://www.ustream.tv/channel/young-americans-for-liberty')
41 self
.assertIsPlaylist(result
)
42 self
.assertEqual(result
['id'], u
'5124905')
43 self
.assertTrue(len(result
['entries']) >= 11)
45 def test_soundcloud_user(self
):
47 ie
= SoundcloudUserIE(dl
)
48 result
= ie
.extract('https://soundcloud.com/the-concept-band')
49 self
.assertIsPlaylist(result
)
50 self
.assertEqual(result
['id'], u
'9615865')
51 self
.assertTrue(len(result
['entries']) >= 12)
53 if __name__
== '__main__':