'acodec': 'mp4a.40.2',
'video_ext': 'mp4',
'audio_ext': 'none',
- 'vbr': 263.851,
- 'abr': 0,
}, {
'format_id': '577',
'format_index': None,
'acodec': 'mp4a.40.2',
'video_ext': 'mp4',
'audio_ext': 'none',
- 'vbr': 577.61,
- 'abr': 0,
}, {
'format_id': '915',
'format_index': None,
'acodec': 'mp4a.40.2',
'video_ext': 'mp4',
'audio_ext': 'none',
- 'vbr': 915.905,
- 'abr': 0,
}, {
'format_id': '1030',
'format_index': None,
'acodec': 'mp4a.40.2',
'video_ext': 'mp4',
'audio_ext': 'none',
- 'vbr': 1030.138,
- 'abr': 0,
}, {
'format_id': '1924',
'format_index': None,
'acodec': 'mp4a.40.2',
'video_ext': 'mp4',
'audio_ext': 'none',
- 'vbr': 1924.009,
- 'abr': 0,
}],
{
'en': [{
expected_status=TEAPOT_RESPONSE_STATUS)
self.assertEqual(content, TEAPOT_RESPONSE_BODY)
+ def test_search_nextjs_data(self):
+ data = '<script id="__NEXT_DATA__" type="application/json">{"props":{}}</script>'
+ self.assertEqual(self.ie._search_nextjs_data(data, None), {'props': {}})
+ self.assertEqual(self.ie._search_nextjs_data('', None, fatal=False), {})
+ self.assertEqual(self.ie._search_nextjs_data('', None, default=None), None)
+ self.assertEqual(self.ie._search_nextjs_data('', None, default={}), {})
+ with self.assertRaises(DeprecationWarning):
+ self.assertEqual(self.ie._search_nextjs_data('', None, default='{}'), {})
+
if __name__ == '__main__':
unittest.main()