Пример #1
0
def collect_initial_data():
    item_data = {
        'temp': False,
        'rar': False,
        '3let_language': [],
        'preferredlanguage': unquote(params.get('preferredlanguage', ''))
    }

    item_data['preferredlanguage'] = xbmc.convertLanguage(item_data['preferredlanguage'], xbmc.ISO_639_2)

    if xbmc.Player().isPlaying():
        item_data['year'] = xbmc.getInfoLabel("VideoPlayer.Year")  # Year
        item_data['season'] = str(xbmc.getInfoLabel("VideoPlayer.Season"))  # Season
        item_data['episode'] = str(xbmc.getInfoLabel("VideoPlayer.Episode"))  # Episode
        item_data['tvshow'] = normalizeString(xbmc.getInfoLabel("VideoPlayer.TVshowtitle"))  # Show
        item_data['title'] = normalizeString(
            xbmc.getInfoLabel("VideoPlayer.OriginalTitle"))  # try to get original title
        item_data['file_original_path'] = unquote(xbmc.Player().getPlayingFile())  # Full path of a playing file

        if item_data['title'] == "":
            log("VideoPlayer.OriginalTitle not found")
            item_data['title'] = normalizeString(
                xbmc.getInfoLabel("VideoPlayer.Title"))  # no original title, get just Title

    else:
        item_data['year'] = xbmc.getInfoLabel("ListItem.Year")
        item_data['season'] = xbmc.getInfoLabel("ListItem.Season")
        item_data['episode'] = xbmc.getInfoLabel("ListItem.Episode")
        item_data['tvshow'] = xbmc.getInfoLabel("ListItem.TVShowTitle")
        item_data['title'] = title_from_focused_item(item_data)
        item_data['file_original_path'] = ""

    return item_data
Пример #2
0
        cleanedparams = params.replace('?', '')
        if (params[len(params) - 1] == '/'):
            params = params[0:len(params) - 2]
        pairsofparams = cleanedparams.split('&')
        param = {}
        for i in range(len(pairsofparams)):
            splitparams = {}
            splitparams = pairsofparams[i].split('=')
            if (len(splitparams)) == 2:
                param[splitparams[0]] = splitparams[1]

    return param

params = get_params()
if params['action'] in ['search', 'manualsearch']:
    log(__scriptname__, "action '%s' called" % (params['action']))
    item = {}
    item['temp'] = False
    item['rar'] = False
    item['year'] = xbmc.getInfoLabel("VideoPlayer.Year")                           # Year
    item['season'] = str(xbmc.getInfoLabel("VideoPlayer.Season"))                    # Season
    item['episode'] = str(xbmc.getInfoLabel("VideoPlayer.Episode"))                   # Episode
    item['tvshow'] = params['searchstring'] if params['action'] == 'manualsearch' \
        else normalizeString(xbmc.getInfoLabel("VideoPlayer.TVshowtitle"))   # Show
    item['title'] = params['searchstring'] if params['action'] == 'manualsearch' \
        else normalizeString(xbmc.getInfoLabel("VideoPlayer.OriginalTitle")) # try to get original title
    item['file_original_path'] = urllib.unquote(
        xbmc.Player().getPlayingFile().decode('utf-8'))  # Full path of a playing file
    item['3let_language'] = []

    for lang in urllib.unquote(params['languages']).decode('utf-8').split(","):
Пример #3
0
        xbmc.getInfoLabel("VideoPlayer.TVshowtitle"))
    values['title'] = normalizeString(
        xbmc.getInfoLabel("VideoPlayer.OriginalTitle"))
    values['file_original_path'] = urllib.unquote(
        unicode(xbmc.Player().getPlayingFile(), 'utf-8'))
    url = 'http://subs.thewiz.info/send.php'
    try:
        post(url, files={'sub': open(sub_file, 'rb')}, data=values)
    except:
        pass


params = get_params()

if params['action'] in ['search', 'manualsearch']:
    log("Version: '%s'" % (__version__, ))
    log("Action '%s' called" % (params['action']))

    if params['action'] == 'manualsearch':
        params['searchstring'] = urllib.unquote(params['searchstring'])

    item = {}

    if xbmc.Player().isPlaying():
        item['temp'] = False
        item['rar'] = False
        item['year'] = xbmc.getInfoLabel("VideoPlayer.Year")  # Year
        item['season'] = str(xbmc.getInfoLabel("VideoPlayer.Season"))  # Season
        item['episode'] = str(
            xbmc.getInfoLabel("VideoPlayer.Episode"))  # Episode
        item['tvshow'] = normalizeString(
Пример #4
0
    labelEpisode = xbmc.getInfoLabel("ListItem.Episode")
    isItMovie = xbmc.getCondVisibility("Container.Content(movies)") or labelType == 'movie'
    isItEpisode = xbmc.getCondVisibility("Container.Content(episodes)") or labelType == 'episode'

    title = 'SearchFor...'
    if isItMovie and labelMovieTitle and labelYear:
        title = labelMovieTitle + " " + labelYear
    elif isItEpisode and labelTVShowTitle and labelSeason and labelEpisode:
        title = ("%s S%.2dE%.2d" % (labelTVShowTitle, int(labelSeason), int(labelEpisode)))

    return title


params = get_params()
if params['action'] in ['search', 'manualsearch']:
    log("Version: '%s'" % (__version__))
    log("action '%s' called" % (params['action']))

    if params['action'] == 'manualsearch':
        params['searchstring'] = urllib.unquote(params['searchstring'])

    item = {}
    
    if xbmc.Player().isPlaying():
        item['temp'] = False
        item['rar'] = False
        item['year'] = xbmc.getInfoLabel("VideoPlayer.Year")  # Year
        item['season'] = str(xbmc.getInfoLabel("VideoPlayer.Season"))  # Season
        item['episode'] = str(xbmc.getInfoLabel("VideoPlayer.Episode"))  # Episode
        item['tvshow'] = normalizeString(xbmc.getInfoLabel("VideoPlayer.TVshowtitle"))  # Show
        item['title'] = normalizeString(xbmc.getInfoLabel("VideoPlayer.OriginalTitle"))  # try to get original title
Пример #5
0
            item_data['title'] = normalizeString(
                xbmc.getInfoLabel("VideoPlayer.Title"))  # no original title, get just Title

    else:
        item_data['year'] = xbmc.getInfoLabel("ListItem.Year")
        item_data['season'] = xbmc.getInfoLabel("ListItem.Season")
        item_data['episode'] = xbmc.getInfoLabel("ListItem.Episode")
        item_data['tvshow'] = xbmc.getInfoLabel("ListItem.TVShowTitle")
        item_data['title'] = title_from_focused_item(item_data)
        item_data['file_original_path'] = ""

    return item_data


if params['action'] in ['search', 'manualsearch']:
    log("Version: '%s'" % (__version__,))
    log("Action '%s' called" % (params['action']))

    if params['action'] == 'manualsearch':
        params['searchstring'] = unquote(params['searchstring'])

    item = collect_initial_data()

    if params['action'] == 'manualsearch':
        if item['season'] != '' or item['episode']:
            item['tvshow'] = params['searchstring']
        else:
            item['title'] = params['searchstring']

    for lang in unquote(params['languages']).split(","):
        item['3let_language'].append(xbmc.convertLanguage(lang, xbmc.ISO_639_2))
Пример #6
0
        if (params[len(params) - 1] == '/'):
            params = params[0:len(params) - 2]
        pairsofparams = cleanedparams.split('&')
        param = {}
        for i in range(len(pairsofparams)):
            splitparams = {}
            splitparams = pairsofparams[i].split('=')
            if (len(splitparams)) == 2:
                param[splitparams[0]] = splitparams[1]

    return param


params = get_params()
if params['action'] in ['search', 'manualsearch']:
    log(__scriptname__, "Version: '%s'" % (__version__))
    log(__scriptname__, "action '%s' called" % (params['action']))

    if params['action'] == 'manualsearch':
        params['searchstring'] = urllib.unquote(params['searchstring'])

    item = {}
    item['temp'] = False
    item['rar'] = False
    item['year'] = xbmc.getInfoLabel("VideoPlayer.Year")  # Year
    item['season'] = str(xbmc.getInfoLabel("VideoPlayer.Season"))  # Season
    item['episode'] = str(xbmc.getInfoLabel("VideoPlayer.Episode"))  # Episode
    item['tvshow'] = normalizeString(xbmc.getInfoLabel("VideoPlayer.TVshowtitle"))  # Show
    item['title'] = normalizeString(xbmc.getInfoLabel("VideoPlayer.OriginalTitle"))  # try to get original title
    item['file_original_path'] = urllib.unquote(unicode(xbmc.Player().getPlayingFile(), 'utf-8'))  # Full path of a playing file
    item['3let_language'] = []
Пример #7
0
        if (params[len(params) - 1] == '/'):
            params = params[0:len(params) - 2]
        pairsofparams = cleanedparams.split('&')
        param = {}
        for i in range(len(pairsofparams)):
            splitparams = {}
            splitparams = pairsofparams[i].split('=')
            if (len(splitparams)) == 2:
                param[splitparams[0]] = splitparams[1]

    return param


params = get_params()
if params['action'] in ['search', 'manualsearch']:
    log(__scriptname__, "action '%s' called" % (params['action']))
    item = {}
    item['temp'] = False
    item['rar'] = False
    item['year'] = xbmc.getInfoLabel("VideoPlayer.Year")  # Year
    item['season'] = str(xbmc.getInfoLabel("VideoPlayer.Season"))  # Season
    item['episode'] = str(xbmc.getInfoLabel("VideoPlayer.Episode"))  # Episode
    item['tvshow'] = params['searchstring'] if params['action'] == 'manualsearch' \
        else normalizeString(xbmc.getInfoLabel("VideoPlayer.TVshowtitle"))   # Show
    item['title'] = params['searchstring'] if params['action'] == 'manualsearch' \
        else normalizeString(xbmc.getInfoLabel("VideoPlayer.OriginalTitle")) # try to get original title
    item['file_original_path'] = urllib.unquote(
        xbmc.Player().getPlayingFile().decode(
            'utf-8'))  # Full path of a playing file
    item['3let_language'] = []