本文整理汇总了Python中test.helper.FakeYDL.process_video_result方法的典型用法代码示例。如果您正苦于以下问题:Python FakeYDL.process_video_result方法的具体用法?Python FakeYDL.process_video_result怎么用?Python FakeYDL.process_video_result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test.helper.FakeYDL
的用法示例。
在下文中一共展示了FakeYDL.process_video_result方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_InstagramUser
# 需要导入模块: from test.helper import FakeYDL [as 别名]
# 或者: from test.helper.FakeYDL import process_video_result [as 别名]
def test_InstagramUser(self):
dl = FakeYDL()
ie = InstagramUserIE(dl)
result = ie.extract("http://instagram.com/porsche")
self.assertIsPlaylist(result)
self.assertEqual(result["id"], "porsche")
self.assertTrue(len(result["entries"]) >= 2)
test_video = next(e for e in result["entries"] if e["id"] == "614605558512799803_462752227")
dl.add_default_extra_info(test_video, ie, "(irrelevant URL)")
dl.process_video_result(test_video, download=False)
EXPECTED = {
"id": "614605558512799803_462752227",
"ext": "mp4",
"title": "#Porsche Intelligent Performance.",
"thumbnail": "re:^https?://.*\.jpg",
"uploader": "Porsche",
"uploader_id": "porsche",
"timestamp": 1387486713,
"upload_date": "20131219",
}
expect_info_dict(self, EXPECTED, test_video)
示例2: test_InstagramUser
# 需要导入模块: from test.helper import FakeYDL [as 别名]
# 或者: from test.helper.FakeYDL import process_video_result [as 别名]
def test_InstagramUser(self):
dl = FakeYDL()
ie = InstagramUserIE(dl)
result = ie.extract('http://instagram.com/porsche')
self.assertIsPlaylist(result)
self.assertEqual(result['id'], 'porsche')
self.assertTrue(len(result['entries']) >= 2)
test_video = next(
e for e in result['entries']
if e['id'] == '614605558512799803_462752227')
dl.add_default_extra_info(test_video, ie, '(irrelevant URL)')
dl.process_video_result(test_video, download=False)
EXPECTED = {
'id': '614605558512799803_462752227',
'ext': 'mp4',
'title': '#Porsche Intelligent Performance.',
'thumbnail': 're:^https?://.*\.jpg',
'uploader': 'Porsche',
'uploader_id': 'porsche',
'timestamp': 1387486713,
'upload_date': '20131219',
}
expect_info_dict(self, EXPECTED, test_video)