当前位置: 首页>>代码示例>>Python>>正文


Python YouTubePlayer.addSubtitles方法代码示例

本文整理汇总了Python中YouTubePlayer.YouTubePlayer.addSubtitles方法的典型用法代码示例。如果您正苦于以下问题:Python YouTubePlayer.addSubtitles方法的具体用法?Python YouTubePlayer.addSubtitles怎么用?Python YouTubePlayer.addSubtitles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在YouTubePlayer.YouTubePlayer的用法示例。


在下文中一共展示了YouTubePlayer.addSubtitles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_playVideo_should_update_locally_stored_watched_status

# 需要导入模块: from YouTubePlayer import YouTubePlayer [as 别名]
# 或者: from YouTubePlayer.YouTubePlayer import addSubtitles [as 别名]
    def test_playVideo_should_update_locally_stored_watched_status(self):
        sys.modules["__main__"].settings.getSetting.return_value = "0"
        sys.argv = ["test1", "1", "test2"]
        player = YouTubePlayer()
        player.buildVideoObject = Mock()
        player.buildVideoObject.return_value = ({"Title": "someTitle", "videoid": "some_id", "thumbnail": "someThumbnail", "video_url": "someUrl"}, 200)
        player.addSubtitles = Mock()

        player.playVideo({"videoid": "some_id"})
        sys.modules["__main__"].storage.storeValue.assert_called_with("vidstatus-some_id", "7" )
开发者ID:BlackSmith,项目名称:youtube-xbmc-plugin,代码行数:12,代码来源:TestYouTubePlayer.py

示例2: test_playVideo_should_call_xbmc_setResolvedUrl

# 需要导入模块: from YouTubePlayer import YouTubePlayer [as 别名]
# 或者: from YouTubePlayer.YouTubePlayer import addSubtitles [as 别名]
    def test_playVideo_should_call_xbmc_setResolvedUrl(self):
        sys.modules["__main__"].settings.getSetting.return_value = "0"
        player = YouTubePlayer()
        player.addSubtitles = Mock()
        player.buildVideoObject = Mock()
        player.buildVideoObject.return_value = ({"Title": "someTitle", "videoid": "some_id", "thumbnail": "someThumbnail", "video_url": "someUrl"}, 200)
        sys.argv = ["test1", "1", "test2"]

        player.playVideo({"videoid": "some_id"})

        assert(sys.modules["__main__"].xbmcplugin.setResolvedUrl.call_count > 0)
开发者ID:BlackSmith,项目名称:youtube-xbmc-plugin,代码行数:13,代码来源:TestYouTubePlayer.py

示例3: test_playVideo_should_call_remove_from_watch_later_if_viewing_video_from_watch_later_queue

# 需要导入模块: from YouTubePlayer import YouTubePlayer [as 别名]
# 或者: from YouTubePlayer.YouTubePlayer import addSubtitles [as 别名]
    def test_playVideo_should_call_remove_from_watch_later_if_viewing_video_from_watch_later_queue(self):
        player = YouTubePlayer()
        sys.modules["__main__"].settings.getSetting.return_value = "0"
        sys.argv = ["test1", "1", "test2"]
        player.buildVideoObject = Mock()
        player.buildVideoObject.return_value = ({"Title": "someTitle", "videoid": "some_id", "thumbnail": "someThumbnail", "video_url": "someUrl"}, 200)
        player.addSubtitles = Mock()
        call_params = {"videoid": "some_id", "watch_later": "true", "playlist": "playlist_id", "playlist_entry_id": "entry_id"}

        player.playVideo(call_params)

        sys.modules["__main__"].core.remove_from_watch_later.assert_called_with(call_params)
开发者ID:BlackSmith,项目名称:youtube-xbmc-plugin,代码行数:14,代码来源:TestYouTubePlayer.py


注:本文中的YouTubePlayer.YouTubePlayer.addSubtitles方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。