コード例 #1
0
def mirror_sub(id, filename, sub_file):
    try:
        playerid_query = '{"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1}'
        playerid = json.loads(xbmc.executeJSONRPC(playerid_query))['result'][0]['playerid']
        imdb_id_query = '{"jsonrpc": "2.0", "method": "Player.GetItem", "params": {"playerid": ' + str(playerid) + ', "properties": ["imdbnumber"]}, "id": 1}'
        imdb_id = json.loads(xbmc.executeJSONRPC (imdb_id_query))['result']['item']['imdbnumber']
    except:
        imdb_id = 0

    values = {}
    values['id'] = id
    values['versioname'] = filename
    values['source'] = 'ktuvit'
    values['year'] = xbmc.getInfoLabel("VideoPlayer.Year")
    values['season'] = str(xbmc.getInfoLabel("VideoPlayer.Season"))
    values['episode'] = str(xbmc.getInfoLabel("VideoPlayer.Episode"))
    values['imdb'] = str(imdb_id)
    values['tvshow'] = normalizeString(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://api.wizdom.xyz/upload.php'
    try:
        post(url, files={'sub': open(sub_file, 'rb')}, data=values)
    except:
        pass
コード例 #2
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
コード例 #3
0
def mirror_sub(id, filename, sub_file):
    values = {}
    values['id'] = id
    values['versioname'] = filename
    values['source'] = 'subscenter'
    values['year'] = xbmc.getInfoLabel("VideoPlayer.Year")
    values['season'] = str(xbmc.getInfoLabel("VideoPlayer.Season"))
    values['episode'] = str(xbmc.getInfoLabel("VideoPlayer.Episode"))
    values['imdb'] = str(xbmc.getInfoLabel("VideoPlayer.IMDBNumber"))
    values['tvshow'] = normalizeString(
        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
コード例 #4
0
ファイル: service.py プロジェクト: roeiba/xbmc
            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(","):
        item['3let_language'].append(xbmc.convertLanguage(lang, xbmc.ISO_639_2))

    if item['title'] == "":
        log(__scriptname__, "VideoPlayer.OriginalTitle not found")
        item['title'] = params['searchstring'] if params['action'] == 'manualsearch' \
            else normalizeString(xbmc.getInfoLabel("VideoPlayer.Title"))      # no original title, get just Title

    if item['episode'].lower().find("s") > -1:                                # Check if season is "Special"
コード例 #5
0
    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
        item['file_original_path'] = urllib.unquote(
            unicode(xbmc.Player().getPlayingFile(),
                    'utf-8'))  # Full path of a playing file
        item['3let_language'] = []
        item['preferredlanguage'] = unicode(
            urllib.unquote(params.get('preferredlanguage', '')), 'utf-8')
        item['preferredlanguage'] = xbmc.convertLanguage(
            item['preferredlanguage'], xbmc.ISO_639_2)

    else:
        item['temp'] = False
        item['rar'] = False
コード例 #6
0
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
        item['file_original_path'] = urllib.unquote(unicode(xbmc.Player().getPlayingFile(), 'utf-8'))  # Full path of a playing file
        item['3let_language'] = []
        item['preferredlanguage'] = unicode(urllib.unquote(params.get('preferredlanguage', '')), 'utf-8')
        item['preferredlanguage'] = xbmc.convertLanguage(item['preferredlanguage'], xbmc.ISO_639_2)
    
    else:
        item['temp'] = False
        item['rar'] = False
        item['year'] = ""
        item['season'] = ""
        item['episode'] = ""
        item['tvshow'] = ""
        item['title'] = takeTitleFromFocusedItem()
        item['file_original_path'] = ""
コード例 #7
0
ファイル: service.py プロジェクト: roeiba/xbmc
                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(","):
        item['3let_language'].append(xbmc.convertLanguage(
            lang, xbmc.ISO_639_2))

    if item['title'] == "":
        log(__scriptname__, "VideoPlayer.OriginalTitle not found")
        item['title'] = params['searchstring'] if params['action'] == 'manualsearch' \
            else normalizeString(xbmc.getInfoLabel("VideoPlayer.Title"))      # no original title, get just Title