예제 #1
0
    def LOAD_AND_PLAY_VIDEO(self, videoUrl, title, icon):
        ok = True
        mrknow_pCommon.mystat(videoUrl)
        if videoUrl == '':
            d = xbmcgui.Dialog()
            d.ok('Nie znaleziono streamingu.', 'Może to chwilowa awaria.', 'Spróbuj ponownie za jakiś czas')
            return False
        #liz = xbmcgui.ListItem(title, iconImage=icon, thumbnailImage=icon)
        #liz.setInfo(type="Video", infoLabels={"Title": title,})
        liz=xbmcgui.ListItem(title, iconImage=icon, thumbnailImage=icon, path=videoUrl )
        liz.setInfo( type="video", infoLabels={ "Title": title} )
        xbmcPlayer = xbmc.Player()
        #try:
        #    xbmcPlayer = xbmc.Player()
        #    xbmcPlayer.play(videoUrl, liz)

        #    if not xbmc.Player().isPlaying():
        #        xbmc.sleep(10000)
        #        # xbmcPlayer.play(url, liz)

        #except:
        #    d = xbmcgui.Dialog()
        #    d.ok('Błąd przy przetwarzaniu.', 'Problem')
        xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)

        return ok
예제 #2
0
    def LOAD_AND_PLAY_VIDEO(self, videoUrl, title, icon):
        ok = True
        mrknow_pCommon.mystat(videoUrl)
        if videoUrl == '':
            d = xbmcgui.Dialog()
            d.ok('Nie znaleziono streamingu.', 'Może to chwilowa awaria.', 'Spróbuj ponownie za jakiś czas')
            return False
        #liz = xbmcgui.ListItem(title, iconImage=icon, thumbnailImage=icon)
        #liz.setInfo(type="Video", infoLabels={"Title": title,})
        liz=xbmcgui.ListItem(title, iconImage=icon, thumbnailImage=icon, path=videoUrl )
        liz.setInfo( type="video", infoLabels={ "Title": title} )
        xbmcPlayer = xbmc.Player()
        #try:
        #    xbmcPlayer = xbmc.Player()
        #    xbmcPlayer.play(videoUrl, liz)

        #    if not xbmc.Player().isPlaying():
        #        xbmc.sleep(10000)
        #        # xbmcPlayer.play(url, liz)

        #except:
        #    d = xbmcgui.Dialog()
        #    d.ok('Błąd przy przetwarzaniu.', 'Problem')
        xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)

        return ok
예제 #3
0
    def LOAD_AND_PLAY_VIDEO(self, url, title, icon,year='',plot=''):
        mrknow_pCommon.mystat(url)

        progress = xbmcgui.DialogProgress()
        progress.create('Postęp', '')
        message = ptv.getLocalizedString(30406)
        progress.update( 10, "", message, "" )
        xbmc.sleep( 1000 )
        progress.update( 30, "", message, "" )
        progress.update( 50, "", message, "" )
        VideoLink = ''
        VideoLink = self.pp.getVideoLink(url)

        videoUrl = VideoLink
        progress.update( 70, "", message, "" )
        pluginhandle = int(sys.argv[1])
        if videoUrl == '':
            progress.close()
            d = xbmcgui.Dialog()
            d.ok('Nie znaleziono streamingu', 'Mo�e to chwilowa awaria.', 'Spr�buj ponownie za jaki� czas')
            return False
        if icon == '' or  icon == 'None':
            icon = "DefaultVideo.png"
        if plot == '' or plot == 'None':
            plot = ''
        liz=xbmcgui.ListItem(title, iconImage=icon, thumbnailImage=icon, path=videoUrl )
        liz.setInfo( type="video", infoLabels={ "Title": title} )
        xbmcPlayer = xbmc.Player()

        progress.update( 90, "", message, "" )
        progress.close()
        #listitem = xbmcgui.ListItem(path=videoUrl)
        xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
예제 #4
0
    def handleService(self):
        params = self.parser.getParams()
        category = str(self.parser.getParam(params, "category"))
        id = str(self.parser.getParam(params, "id"))
        seriesId = str(self.parser.getParam(params, "seriesId"))

        # MAINMENU
        if category == 'None':
            if self.api.geoCheck():
                self.getMenu('m=mainInfo')

        # WSZYSTKO
        if category != 'None' and category != 'episode' and seriesId == 'None':
            self.getItems('m=getItems&sort=newest&limit=500&type=' + category +
                          '&id=' + id)

        # ODCINKI W SEZONIE
        if seriesId != 'None':
            self.getItems('m=getItems&sort=newest&limit=500&type=series&id=' +
                          seriesId + '&season=' + id)

        # VIDEO
        if category == 'episode':
            videoUrl = self.getVideoUrl('m=getItem&type=' + category + '&id=' +
                                        id)
            mrknow_pCommon.mystat(videoUrl)
            self.gui.LOAD_AND_PLAY_VIDEO_WATCHED(videoUrl)
예제 #5
0
    def handleService(self):
        params = self.parser.getParams()
        category = str(self.parser.getParam(params, "category"))
        id = str(self.parser.getParam(params, "id"))
        seriesId = str(self.parser.getParam(params, "seriesId"))

        # MAINMENU
        if category == 'None':
            if self.api.geoCheck():
                self.getMenu('m=mainInfo')

        # WSZYSTKO
        if category != 'None' and category != 'episode' and seriesId == 'None':
            self.getItems('m=getItems&sort=newest&limit=500&type=' + category +
                          '&id=' + id)

        # ODCINKI W SEZONIE
        if seriesId != 'None':
            self.getItems('m=getItems&sort=newest&limit=500&type=series&id=' +
                          seriesId + '&season=' + id)

        # VIDEO
        if category == 'episode':
            #videoUrl = self.getVideoUrl('m=getItem&type=' + category + '&id=' + id)
            videoUrl = self.getVideoUrl(
                'showContentContractor=free%2Csamsung%2Cstandard&m=getItem&android23video=1&deviceType=Tablet&os=4.1.1&playlistType=&connectionType=WIFI&deviceScreenWidth=1920&deviceScreenHeight=1080&appVersion=3.3.4&manufacturer=unknown&model=androVMTablet&id='
                + id)
            mrknow_pCommon.mystat(videoUrl)
            self.gui.LOAD_AND_PLAY_VIDEO_WATCHED(videoUrl)
예제 #6
0
    def playVideo(self, videoItem, isAutoplay=False):
        if not videoItem:
            return

        listitem = self.createXBMCListItem(videoItem)

        title = videoItem['videoTitle']
        if title:
            listitem.setInfo('video', {'title': title})

        if not isAutoplay:
            xbmcplugin.setResolvedUrl(self.handle, True, listitem)
        else:
            url = urllib.unquote_plus(videoItem['url'])
            mrknow_pCommon.mystat(url)
            #xbmc.Player(self.getPlayerType()).play(url, listitem)
            xbmc.Player().play(url, listitem)
예제 #7
0
파일: default.py 프로젝트: rrosajp/filmkodi
    def playVideo(self, videoItem, isAutoplay = False):
        if not videoItem:
            return

        listitem = self.createXBMCListItem(videoItem)

        title = videoItem['videoTitle']
        if title:
            listitem.setInfo('video', {'title': title})


        if not isAutoplay:
            xbmcplugin.setResolvedUrl(self.handle, True, listitem)
        else:
            url = urllib.unquote_plus(videoItem['url'])
            mrknow_pCommon.mystat(url)
            #xbmc.Player(self.getPlayerType()).play(url, listitem)
            xbmc.Player().play(url, listitem)
예제 #8
0
파일: cdapl.py 프로젝트: rrosajp/filmkodi
    def LOAD_AND_PLAY_VIDEO(self, videoUrl, title, icon):
        ok = True
        mrknow_pCommon.mystat(videoUrl)
        log('moje url = %s' % videoUrl)
        if videoUrl == '':
            d = xbmcgui.Dialog()
            d.ok('Nie znaleziono streamingu.', 'Może to chwilowa awaria.', 'Spróbuj ponownie za jakiś czas')
            return False
        liz = xbmcgui.ListItem(title, iconImage=icon, thumbnailImage=icon)
        liz.setInfo(type="Video", infoLabels={"Title": title, })
        try:
            xbmcPlayer = xbmc.Player()
            xbmcPlayer.play(videoUrl, liz)

            if not xbmc.Player().isPlaying():
                xbmc.sleep(10000)
                # xbmcPlayer.play(url, liz)
        except:
            d = xbmcgui.Dialog()
            d.ok('Błąd przy przetwarzaniu.', 'Problem')
        return ok
예제 #9
0
    def LOAD_AND_PLAY_VIDEO(self, videoUrl, title, icon):
        ok = True
        mrknow_pCommon.mystat(videoUrl)
        log('moje url = %s' % videoUrl)
        if videoUrl == '':
            d = xbmcgui.Dialog()
            d.ok('Nie znaleziono streamingu.', 'Może to chwilowa awaria.', 'Spróbuj ponownie za jakiś czas')
            return False
        liz = xbmcgui.ListItem(title, iconImage=icon, thumbnailImage=icon)
        liz.setInfo(type="Video", infoLabels={"Title": title, })
        try:
            xbmcPlayer = xbmc.Player()
            xbmcPlayer.play(videoUrl, liz)

            if not xbmc.Player().isPlaying():
                xbmc.sleep(10000)
                # xbmcPlayer.play(url, liz)
        except:
            d = xbmcgui.Dialog()
            d.ok('Błąd przy przetwarzaniu.', 'Problem')
        return ok
예제 #10
0
    def LOAD_AND_PLAY_VIDEO(self, url, title, icon, year='', plot=''):
        mrknow_pCommon.mystat(url)

        progress = xbmcgui.DialogProgress()
        progress.create('Postęp', '')
        message = ptv.getLocalizedString(30406)
        progress.update(10, "", message, "")
        xbmc.sleep(1000)
        progress.update(30, "", message, "")
        progress.update(50, "", message, "")
        VideoLink = ''
        VideoLink = self.pp.getVideoLink(url)

        videoUrl = VideoLink
        progress.update(70, "", message, "")
        pluginhandle = int(sys.argv[1])
        if videoUrl == '':
            progress.close()
            d = xbmcgui.Dialog()
            d.ok('Nie znaleziono streamingu', 'Mo�e to chwilowa awaria.',
                 'Spr�buj ponownie za jaki� czas')
            return False
        if icon == '' or icon == 'None':
            icon = "DefaultVideo.png"
        if plot == '' or plot == 'None':
            plot = ''
        liz = xbmcgui.ListItem(title,
                               iconImage=icon,
                               thumbnailImage=icon,
                               path=videoUrl)
        liz.setInfo(type="video", infoLabels={"Title": title})
        xbmcPlayer = xbmc.Player()

        progress.update(90, "", message, "")
        progress.close()
        #listitem = xbmcgui.ListItem(path=videoUrl)
        xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
예제 #11
0
    def handleService(self):
        params = self.parser.getParams()
        category = str(self.parser.getParam(params, "category"))
        id = str(self.parser.getParam(params, "id"))
        seriesId = str(self.parser.getParam(params, "seriesId"))

        # MAINMENU
        if category == 'None':
            if self.api.geoCheck():
                self.getMenu('m=mainInfo')

        # WSZYSTKO
        if category != 'None' and category != 'episode' and seriesId == 'None':
            self.getItems('m=getItems&sort=newest&limit=500&type=' + category + '&id=' + id)

        # ODCINKI W SEZONIE
        if seriesId != 'None':
            self.getItems('m=getItems&sort=newest&limit=500&type=series&id=' + seriesId + '&season=' + id)

        # VIDEO
        if category == 'episode':
            videoUrl = self.getVideoUrl('m=getItem&type=' + category + '&id=' + id)
            mrknow_pCommon.mystat(videoUrl)
            self.gui.LOAD_AND_PLAY_VIDEO_WATCHED(videoUrl)
예제 #12
0
    def LOAD_AND_PLAY_VIDEO(self, url, title, icon,year='',plot=''):
        mrknow_pCommon.mystat(url)
        progress = xbmcgui.DialogProgress()
        progress.create('Postęp', '')
        message = ptv.getLocalizedString(30406)
        progress.update( 10, "", message, "" )
        xbmc.sleep( 1000 )
        progress.update( 30, "", message, "" )
        progress.update( 50, "", message, "" )
        VideoLink = ''
        subs=''
        if url is not None:
            if url.startswith('rtmp'):
                VideoLink = url
            else:
                alina = mrknow_Pageparser.mrknow_Pageparser()
                VideoLink = alina.getVideoLink(url)
            print("Type",type(VideoLink))
        if type(VideoLink) is dict:
            videoUrl = VideoLink[0]
            subs = VideoLink[1]
        elif type(VideoLink) is bool:
            videoUrl = ''
        else:
            videoUrl = VideoLink
        progress.update( 70, "", message, "" )
        pluginhandle = int(sys.argv[1])
        if videoUrl == '' or videoUrl == None:
            progress.close()
            d = xbmcgui.Dialog()
            d.ok('Nie znaleziono streamingu', 'Może to chwilowa awaria.', 'Spróbuj ponownie za jakiś czas')
            return False
        if icon == '' or  icon == 'None':
            icon = "DefaultVideo.png"
        if plot == '' or plot == 'None':
            plot = ''
        liz=xbmcgui.ListItem(title, iconImage=icon, thumbnailImage=icon, path=videoUrl )
        liz.setInfo( type="video", infoLabels={ "Title": title} )
        xbmcPlayer = xbmc.Player()

        if subs != '':
            subsdir = os.path.join(ptv.getAddonInfo('path'), "subs")
            if not os.path.isdir(subsdir):
                os.mkdir(subsdir)
            query_data = { 'url': subs, 'use_host': False, 'use_header': False, 'use_cookie': False, 'use_post': False, 'return_data': True }
            progress.update( 80, "", message, "" )
            data = self.cm.getURLRequestData(query_data)
            output = open((os.path.join(subsdir, "napisy.txt" )),"w+")
            progress.update( 90, "", message, "" )
            output.write(data)
            output.close()
            progress.update( 100, "", message, "" )
            progress.close()
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)

            for _ in xrange(30):
                if xbmcPlayer.isPlaying():
                    break
                time.sleep(1)
            else:
                raise Exception('No video playing. Aborted after 30 seconds.')
            xbmcPlayer.setSubtitles((os.path.join(subsdir, "napisy.txt" )))
            xbmcPlayer.showSubtitles(True)

        else:
            progress.update( 90, "", message, "" )
            progress.close()
            #listitem = xbmcgui.ListItem(path=videoUrl)
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
예제 #13
0
    def LOAD_AND_PLAY_VIDEO(self, url, title, icon,year='',plot=''):
        mrknow_pCommon.mystat(url)
        progress = xbmcgui.DialogProgress()
        progress.create('Postęp', '')
        message = ptv.getLocalizedString(30406)
        progress.update( 10, "", message, "" )
        xbmc.sleep( 1000 )
        progress.update( 30, "", message, "" )
        progress.update( 50, "", message, "" )
        VideoLink = ''
        subs=''
        if url is not None:
            if url.startswith('rtmp'):
                VideoLink = url
            else:
                alina = mrknow_Pageparser.mrknow_Pageparser()
                VideoLink = alina.getVideoLink(url)
            print("Type",type(VideoLink))
        if type(VideoLink) is dict:
            videoUrl = VideoLink[0]
            subs = VideoLink[1]
        elif type(VideoLink) is bool:
            videoUrl = ''
        else:
            videoUrl = VideoLink
        progress.update( 70, "", message, "" )
        pluginhandle = int(sys.argv[1])
        if videoUrl == '' or videoUrl == None:
            progress.close()
            d = xbmcgui.Dialog()
            d.ok('Nie znaleziono streamingu', 'Mo�e to chwilowa awaria.', 'Spr�buj ponownie za jaki� czas')
            return False
        if icon == '' or  icon == 'None':
            icon = "DefaultVideo.png"
        if plot == '' or plot == 'None':
            plot = ''
        liz=xbmcgui.ListItem(title, iconImage=icon, thumbnailImage=icon, path=videoUrl )
        liz.setInfo( type="video", infoLabels={ "Title": title} )
        xbmcPlayer = xbmc.Player()

        if subs != '':
            subsdir = os.path.join(ptv.getAddonInfo('path'), "subs")
            if not os.path.isdir(subsdir):
                os.mkdir(subsdir)
            query_data = { 'url': subs, 'use_host': False, 'use_header': False, 'use_cookie': False, 'use_post': False, 'return_data': True }
            progress.update( 80, "", message, "" )
            data = self.cm.getURLRequestData(query_data)
            output = open((os.path.join(subsdir, "napisy.txt" )),"w+")
            progress.update( 90, "", message, "" )
            output.write(data)
            output.close()
            progress.update( 100, "", message, "" )
            progress.close()
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)

            for _ in xrange(30):
                if xbmcPlayer.isPlaying():
                    break
                time.sleep(1)
            else:
                raise Exception('No video playing. Aborted after 30 seconds.')
            xbmcPlayer.setSubtitles((os.path.join(subsdir, "napisy.txt" )))
            xbmcPlayer.showSubtitles(True)

        else:
            progress.update( 90, "", message, "" )
            progress.close()
            #listitem = xbmcgui.ListItem(path=videoUrl)
            xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, liz)
예제 #14
0
#o=107984:d6409c8683f029ee9a82629175a972b5
#o=107991:58c49f51a3049f43be326cf7b8107415

import random, string, sys

sys.path.append('/home/mrknow/Dokumenty/praca/kodi/filmkodi/plugin.video.mrknow/mylib/')
sys.path.append('/home/mrknow/Dokumenty/praca/kodi/filmkodi/plugin.video.mrknow/lib/')

print ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase) for _ in range(25))


web_url = 'http://embed.nowvideo.sx/embed/?v=27e41183d1328'
web_url = 'http://videomega.tv/iframe.php?width=720&height=400&ref=98vnW2gQtGGtQg2Wnv89'
web_url = 'http://vidto.me/embed-hthii6ksp7uz-730x411.html'
web_url = 'http://openload.co/embed/XfsaMfvMRNo'


from urlresolver.hmf import HostedMediaFile

alina = HostedMediaFile(url=web_url).resolve()
print(alina)

import  mrknow_pCommon
mrknow_pCommon.mystat(url='http://aso.pl')