XBMC Addon:使用希腊文本作为查询字符串时出现错误请求错误

时间:2014-02-24 19:55:53

标签: python urllib xbmc

如何将希腊字母设置为查询参数?我有以下网址:

plugin://plugin.video.xxx-com/?isChannel=0&foldername=%CE%9A%CE%9B%CE%95%CE%9C%CE%9C%CE%95%CE%9D%CE%91+%CE%9F%CE%9D%CE%​95%CE%99%CE%A1A&loggedIn=1&mode=folder&Level=vid

浏览此网址后,我收到以下错误:

Error Type: <class 'urllib2.HTTPError'>
Error Contents: HTTP Error 400: Bad Request

以下代码:

Title = item["Title"].encode('utf-8')
url = build_url({'Level': Level, 'isChannel': 0, 'loggedIn': 1, 'mode': 'folder', 'foldername': Title})

def build_url(query):
    return base_url + '?' + urllib.urlencode(query)

更新#3:

日志显示Title的内容:

    Title = Î<9a>Î<9b>Î<95>Î<9c>Î<9c>Î<95>Î<9d>Î<91> Î<9f>Î<9d>Î<95>Î<99>ΡA

 URL in Youtube =
02:17:46 T:2953850880  NOTICE: plugin://plugin.video.buymetv-com/?isChannel=0&foldername=%CE%9A%CE%9B%CE%95%CE%9C%CE%9C%CE%95%CE%9D%CE%91+%CE%9F%CE%9D%CE%95%CE%99%CE%A1A&loggedIn=1&mode=vid&Level=vid
{'isChannel': ['0'], 'foldername': ['\xce\x9a\xce\x9b\xce\x95\xce\x9c\xce\x9c\xce\x95\xce\x9d\xce\x91 \xce\x9f\xce\x9d\xce\x95\xce\x99\xce\xa1A'], 'loggedIn': ['1'], 'mode': ['vid'], 'Level': ['vid']}

UPDATE2: repr()返回:

u'\u03a3\u03a5\u039d\u03a4\u0391\u0393\u0395\u03a3 \u0395\u039b\u039b\u0397\u039d\u0399\u039a\u0395\u03a3'

0 个答案:

没有答案