コード例 #1
0
 def test_multiple_subtitles(self):
     url = 'http://url.com&c1_file=http://sub1.vtt&c1_label=English&c2_file=http://sub2.vtt&c2_label=Svenska&c3_file=http://sub3.vtt&c3_label=Suomi'
     actual = dreamfilm.subtitles_from_url(url)
     expected = []
     expected.append('http://sub1.vtt')
     expected.append('http://sub2.vtt')
     expected.append('http://sub3.vtt')
     self.assertEqual(expected, actual)
コード例 #2
0
 def play_movie_part(self, title, player_url):
     try:
         streams = dreamfilm.streams_from_player_url(player_url)
         subtitles = dreamfilm.subtitles_from_url(player_url)
         return self.select_stream(title, streams, subtitles)
     except Exception, e:
         dialog = self.xbmcgui.Dialog()
         print 'EEEE'
         print str(e)
         dialog.ok("Error", "Failed to open stream: %s" % player_url)
コード例 #3
0
 def play_movie(self, title, players_data):
     try:
         players = json.loads(players_data)
         streams = dreamfilm.streams_from_player_url(players[0]['url'])
         subtitles = dreamfilm.subtitles_from_url(players[0]['url'])
         return self.select_stream(title, streams, subtitles)
     except Exception, e:
         print str(e)
         dialog = self.xbmcgui.Dialog()
         dialog.ok("Error", "Failed to open stream")
コード例 #4
0
 def play_movie_part(self, title, player_url):
     try:
         streams = dreamfilm.streams_from_player_url(player_url)
         subtitles = dreamfilm.subtitles_from_url(player_url)
         return self.select_stream(title, streams, subtitles)
     except Exception, e:
         dialog = self.xbmcgui.Dialog()
         print 'EEEE'
         print(traceback.format_exc())
         dialog.ok("Error", "Failed to open stream: %s" % player_url)
コード例 #5
0
ファイル: navigation.py プロジェクト: shahraam/Halowrepo
 def play_movie(self, title, players_data):
     try:
         players = json.loads(players_data)
         streams = dreamfilm.streams_from_player_url(players[0]['url'])
         subtitles = dreamfilm.subtitles_from_url(players[0]['url'])
         return self.select_stream(title, streams, subtitles)
     except Exception, e:
         print str(e)
         dialog = self.xbmcgui.Dialog()
         dialog.ok("Error", "Failed to open stream")
コード例 #6
0
    def play_episode(self, title, season_number, episode_number, url):
        try:
            streams = dreamfilm.streams_from_player_url(url)

            subtitles = dreamfilm.subtitles_from_url(url)
            name = '%s S%sE%s' % (title, season_number, episode_number)
            return self.select_stream(name, streams, subtitles)
        except Exception, e:
            print 'EEEE'
            print str(e)
            dialog = self.xbmcgui.Dialog()
            return dialog.ok("Error", "Failed to open stream: %s" % url)
コード例 #7
0
    def play_episode(self, title, season_number, episode_number, url):
        try:
            streams = dreamfilm.streams_from_player_url(url)

            subtitles = dreamfilm.subtitles_from_url(url)
            name = '%s S%sE%s' % (title, season_number, episode_number)
            return self.select_stream(name, streams, subtitles)
        except Exception, e:
            print 'EEEE'
            print(traceback.format_exc())
            dialog = self.xbmcgui.Dialog()
            return dialog.ok("Error", "Failed to open stream: %s" % url)
コード例 #8
0
ファイル: tests.py プロジェクト: shahraam/Halowrepo
 def tearDown(self):
     actual = dreamfilm.subtitles_from_url(self.url)
     self.assertEqual(self.expected, actual)
コード例 #9
0
 def tearDown(self):
     actual = dreamfilm.subtitles_from_url(self.url)
     self.assertEqual(self.expected, actual)
コード例 #10
0
 def test_subtitle_with_high_number(self):
     url = 'http://url.com?cap&c123_file=http://sub1.vtt&c1_label=Svenska'
     expected = ['http://sub1.vtt']
     actual = dreamfilm.subtitles_from_url(url)
     self.assertEqual(expected, actual)
コード例 #11
0
 def test_empty_string_gives_no_subtitles(self):
     answer = dreamfilm.subtitles_from_url('')
     self.assertEqual(answer, [])