コード例 #1
0
 def test_capture_should_return_output_path(self):
     with tempfile.TemporaryDirectory() as temp_dir:
         output = '%s/out.jpg' % (temp_dir)
         ret = pylivecap.capture(YOUTUBE_PTS_LIVESTREAM, output, VQ.Q1080)
         self.assertEqual(ret, output)
コード例 #2
0
 def bench_capture():
     with tempfile.TemporaryDirectory() as temp_dir:
         output = '%s/out.jpg' % (temp_dir)
         pylivecap.capture(YOUTUBE_VIDEO, output)
コード例 #3
0
 def test_capture_1080p_with_png_format_from_youtube_livestream_should_success(
         self):
     with tempfile.TemporaryDirectory() as temp_dir:
         output = '%s/out.png' % (temp_dir)
         pylivecap.capture(YOUTUBE_PTS_LIVESTREAM, output, VQ.Q1080)
         self.assertEqual(imghdr.what(output), 'png')