Example #1
0
def getAndMarkResumePoint(props, isTVShow):
    #search bookmarks for the ID and get the played time if exists
    checkURL = str(sys.argv[0].replace(r'|', sys.argv[2] + r'|'))
    urlsResumePoint = kodiDB.getPlayedURLResumePoint(checkURL)

    if urlsResumePoint:
        conTime = utils.zeitspanne(int(urlsResumePoint[0]))
        resume = [
            "Jump to position : %s " % (str(conTime[5])),
            "Start from beginning!"
        ]
        if guiTools.selectDialog(
                resume, header='OSMOSIS: Would you like to continue?') == 0:
            xbmc.Player().seekTime(int(urlsResumePoint[0]) - 5)

    watched = 0
    while xbmc.Player().isPlaying():
        watched = xbmc.Player().getTime() * 100 / xbmc.Player().getTotalTime()
        time.sleep(1)

    time.sleep(1)

    if props:
        ID = props[0]
        fileID = props[1]
        pos = 0
        total = 0
        urlsWatchedPoint = kodiDB.getPlayedURLResumePoint(checkURL)
        if urlsWatchedPoint:
            pos = urlsWatchedPoint[0]
            total = urlsWatchedPoint[1]
            done = False
        elif urlsResumePoint and not urlsWatchedPoint:
            kodiDB.delBookMark(urlsResumePoint[2], fileID)
            done = True
        elif not urlsResumePoint and not urlsWatchedPoint:
            done = True if watched > 50 else False
        else:
            done = False

        guiTools.markMovie(ID, pos, total,
                           done) if isTVShow == False else guiTools.markSeries(
                               ID, pos, total, done)
Example #2
0
        utils.addon_log("write multi strms")
        try:
            # A dialog to rename the Change Title for Folder and MediaList entry:
            selectAction = [
                'No, continue with original Title!', 'Rename Title!'
            ]
            if not fileSys.writeTutList("select:Rename"):
                tutWin = [
                    "Adding content to your library",
                    "You can rename your Movie, TV-Show or Music title. ",
                    "To make your scraper recognize the content, some times it is necessary to rename the title ",
                    "Be careful, wrong title can also cause that your scraper can't recognize your content."
                ]
                dialoge.PopupWindow(tutWin)
            if guiTools.selectDialog(
                    selectAction, header='Title for Folder and MediaList entry'
            ) == 1 or name == None or name == "":
                name = guiTools.editDialog(
                    name).lstrip().rstrip() + "++RenamedTitle++"

            if not fileSys.writeTutList("select:ContentTypeLang"):
                tutWin = [
                    "Adding content to your library",
                    "Now select your content type. ",
                    "Select language or YouTube type  ",
                    "Wait for done message."
                ]
                dialoge.PopupWindow(tutWin)
            cType = guiTools.getType(url)

            fileSys.writeMediaList(url, name, cType)
Example #3
0
 # Split url to get tags
 #purl = url.split('|')[1]
 if mediaType:
     try:
         #Play Movies:
         if movID:       
             providers = kodiDB.getVideo(movID)
             if len(providers) == 1:
                 url = providers[0][0]
             else:
                 selectProvider = []
                 for i in providers:
                     selectProvider.append(i[1])
                 # Get/Set Provider
                 #url = urllib.unquote_plus(providers[guiTools.selectDialog(selectProvider, header = 'OSMOSIS: Select provider!')][0]).decode('utf-8')
                 url = providers[guiTools.selectDialog(selectProvider, header = 'OSMOSIS: Select provider!')][0].decode('utf-8') 
         #Play Tv-Shows:
         elif showID:
             providers = kodiDB.getVideo(showID, episode)
             if len(providers) == 1:
                 url = providers[0][0]
             else:       
                 selectProvider = []
                 for i in providers:
                     selectProvider.append(i[1])
                 # Get/Set Provider
                 #url = urllib.unquote_plus(providers[guiTools.selectDialog(selectProvider, header = 'OSMOSIS: Select provider!')][0]).decode('utf-8')
                 url = providers[guiTools.selectDialog(selectProvider, header = 'OSMOSIS: Select provider!')][0].decode('utf-8') 
     except:
         pass
  
Example #4
0
        #purl = url.split('|')[1]
        if mediaType:
            try:
                #Play Movies/TV-Shows:
                if movID or showID:
                    providers = kodiDB.getVideo(
                        movID) if movID else kodiDB.getVideo(showID, episode)
                    if len(providers) == 1:
                        url = providers[0][0]
                    else:
                        selectProvider = []
                        for i in providers:
                            selectProvider.append(i[1])
                        # Get/Set Provider
                        url = providers[guiTools.selectDialog(
                            selectProvider,
                            header='OSMOSIS: Select provider!')][0].decode(
                                'utf-8')
            except:
                pass

        try:
            # Get infos from selectet media
            item = xbmcgui.ListItem(path=url)

            props = None
            infoLabels = {}
            if mediaType:
                if mediaType == 'show':
                    sTVShowTitle = sys.argv[0][sys.argv[0].index('|') + 1:]
                    sTVShowTitle = stringUtils.unicodetoascii(sTVShowTitle)