Browse Source

Merge remote-tracking branch 'dstftw/master'

master
Philipp Hagemeister 10 years ago
parent
commit
c1e60cc2bf
2 changed files with 5 additions and 8 deletions
  1. 8
      test/test_playlists.py
  2. 5
      youtube_dl/extractor/imdb.py

8
test/test_playlists.py

@ -195,11 +195,11 @@ class TestPlaylists(unittest.TestCase):
def test_imdb_list(self): def test_imdb_list(self):
dl = FakeYDL() dl = FakeYDL()
ie = ImdbListIE(dl) ie = ImdbListIE(dl)
result = ie.extract('http://www.imdb.com/list/sMjedvGDd8U')
result = ie.extract('http://www.imdb.com/list/JFs9NWw6XI0')
self.assertIsPlaylist(result) self.assertIsPlaylist(result)
self.assertEqual(result['id'], 'sMjedvGDd8U')
self.assertEqual(result['title'], 'Animated and Family Films')
self.assertTrue(len(result['entries']) >= 48)
self.assertEqual(result['id'], 'JFs9NWw6XI0')
self.assertEqual(result['title'], 'March 23, 2012 Releases')
self.assertEqual(len(result['entries']), 7)
def test_khanacademy_topic(self): def test_khanacademy_topic(self):
dl = FakeYDL() dl = FakeYDL()

5
youtube_dl/extractor/imdb.py

@ -69,12 +69,9 @@ class ImdbListIE(InfoExtractor):
list_id = mobj.group('id') list_id = mobj.group('id')
webpage = self._download_webpage(url, list_id) webpage = self._download_webpage(url, list_id)
list_code = self._search_regex(
r'(?s)<div\s+class="list\sdetail">(.*?)class="see-more"',
webpage, 'list code')
entries = [ entries = [
self.url_result('http://www.imdb.com' + m, 'Imdb') self.url_result('http://www.imdb.com' + m, 'Imdb')
for m in re.findall(r'href="(/video/imdb/vi[^"]+)"', webpage)]
for m in re.findall(r'href="(/video/imdb/vi[^"]+)"\s+data-type="playlist"', webpage)]
list_title = self._html_search_regex( list_title = self._html_search_regex(
r'<h1 class="header">(.*?)</h1>', webpage, 'list title') r'<h1 class="header">(.*?)</h1>', webpage, 'list title')

Loading…
Cancel
Save