如何解码这个Python字符串?

时间:2017-03-01 18:47:37

标签: python base64 decode

我有一些代码需要解码,但我无法完成此处传达的所有步骤"How to decode a python string",但没有成功。

以下是代码:

exec("import re;import base64");exec((lambda p,y:(lambda o,b,f:re.sub(o,b,f))(r"([0-9a-f]+)",lambda m:p(m,y),base64.b64decode("ODQgMjAsYTIsMWQsMmUsYyw1Niw0OCwxMWEsNGIKCjJkICAgICAgICAgICAgPSAnMTkuNGEuOTgnCjNiICAgICAgICAgID0gJ1s2NSAxMWNdZjEgMWVbLzY1XScKZjQgICAgICAgICAgICAgID0gMjAuZCg0OC4yYy40ZSgnMjg6Ly80Yy82My8nICsgMmQgLCAnZjQuZmInKSkKMTIgICAgICAgICAgICAgICAgPSAyMC5kKDQ4LjJjLjRlKCcyODovLzRjLzYzLycgKyAyZCwgJzEyLmMyJykpCjYxICAgICAgICAgICAgICA9IDFkLjdlKCkKMTFiICAgICAgICAgICAgICAgICAgPSAxZC43NygpCmFhICAgICAgICAgICAgID0gMjAuZCg0OC4yYy40ZSgnMjg6Ly80Yy82ZS81Yy8nICsgMmQgLCAnNzUuMTA1JykpCmYwICAgICAgICAgPSAyMC5kKDQ4LjJjLjRlKCcyODovLzRjLzZlLzVjLycgKyAyZCkpCjZmICAgICAgICAgICAgICAgICA9IDIwLmQoNDguMmMuNGUoJzI4Oi8vNGMvNjMvMTkuNGEuMzMnKSkKYWIgICAgICAgICAgICAgICAgPSAyMC5kKDQ4LjJjLjRlKCcyODovLzRjJykpCgozMSA3NigpOgoKCTFhIDM1IDQ4LjJjLjg3KGYwKToKCQk0OC5hZihmMCkKCgkxYSAzNSA0OC4yYy44NihhYSk6CgkJZiA9IDEzKGFhLCdhZScpCgkJZi4yYignIzJhIDZkIDNhIycpCgkJZi4yNCgpCgoJNTEoJ1s2NSAxMWNdNjkgY2QuLi4uLi4uLi4uLi4uWy82NV0nLCczZScsMSwxMixmNCkKCTUxKCdbNjUgMTFjXTY5IGRjIGUyLi4uLi4uLi4uLi4uLl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KDExZSktMV09PScvJyk6CgkJCQkJCTExZT0xMWVbMDo2NCgxMWUpLTJdCgkJCQkyZj00OS4xNignJicpCgkJCQk1Zj17fQoJCQkJNTggMTBlIDIyIGUwKDY0KDJmKSk6CgkJCQkJCTE3PXt9CgkJCQkJCTE3PTJmWzEwZV0uMTYoJz0nKQoJCQkJCQkxYSAoNjQoMTcpKT09MjoKCQkJCQkJCQk1ZlsxN1swXV09MTdbMV0KCQkJCQkJCSAgIAoJCWYzIDVmCgoxMWU9NWIoKTsgNjY9MTA5OyA3PTEwOTsgN2Q9MTA5OyA3Yj0xMDk7IDExOT0xMDkKMjk6IDdiPWMuMTUoMTFlWyI3YiJdKQoxMWQ6IDFiCjI5OiA2Nj1jLjE1KDExZVsiNjYiXSkKMTFkOiAxYgoyOTogNz1jLjE1KDExZVsiNyJdKQoxMWQ6IDFiCjI5OiA3ZD04MigxMWVbIjdkIl0pCjExZDogMWIKMjk6IDExOT1jLjE1KDExZVsiMTE5Il0pCjExZDogMWIKMjk6IGY0PWMuMTUoMTFlWyJmNCJdKQoxMWQ6IDFiCiAKMWEgN2Q9PTEwOSBhZCA2Nj09MTA5IGFkIDY0KDY2KTwxOiA3NigpCjQzIDdkPT0xOjY4KDY2KQo0MyA3ZD09MjoxZSg3LDY2LDExOSkKNDMgN2Q9PTM6NDcoKQo0MyA3ZD09NDo0MigpCgoyZS43MSg4Mig0Yi4zZlsxXSkp")))(lambda a,b:b[int("0x"+a.group(1),16)],"0|1|2|3|4|5|6|name|8|9|a|b|urllib|translatePath|description|f|quote_plus|link|icon|open|addLink|unquote_plus|split|splitparams|ext|plugin|if|pass|channel|xbmcgui|Player|str|xbmc|string|in|GetEncodeString|close|item_data|executebuiltin|thumbnailImage|special|try|START|write|path|addon_id|xbmcplugin|pairsofparams|30|def|else|f4mTester|m3u8|not|36|read|addDirectoryItem|keyboard|FILE|AddonTitle|CREATE_M3U_LIST|streamtype|none|argv|matches|41|Get_Local_File|elif|liz|List_M3U8|iconImage|Clear_History|os|cleanedparams|video|sys|home|display_name|join|HLSRETRY|50|addDir|ListItem|fanart_image|setProperty|paramstring|urllib2|compile|for|findall|http|get_params|addon_data|list|False|param|amp|dialog|Container|addons|len|COLOR|url|isFolder|Find_Out|Play|quit|listitem|open_url|OF|userdata|F4M|upper|endOfDirectory|chardet|Mozilla|ok|history|GetMenu|DialogProgress|n|DefaultFolder|response|site|m3u|mode|Dialog|append|encode|mpegts|int|handle|import|Safari|isfile|exists|like|True|choice|SetViewMode|AppleWebKit|isConfirmed|AppleWebkit|Agent|infoLabels|dodgerblue|Gecko|value|add_header|white|regex|strip|echoplayer|KHTML|field|INSTALLED|AAASTREAM|PlayMedia|Supported|req|red|installed|xbmcaddon|999|requires|yeslabel|file|tvaddons|line|User|HISTORY|HOME|encoding|or|w|makedirs|Keyboard|vers|urlopen|History|doModal|setInfo|getText|install|Request|Windows|Android|Version|nolabel|Refresh|be|Tester|Mobile|utf|png|decode|Please|browse|534|IML74K|detect|537|remove|EXTINF|fusion|URL|li|Chrome|stored|TESTER|Linux|clear|lower|Enter|Clear|yesno|Shani|files|https|L160L|Local|Would|Video|Title|range|Build|File|List|ts|play|u|Repo|2228|MORE|r|LIST|type|This|from|lime|DATA_FOLDER|ECHO|M3U8|return|fanart|plot|the|U|A|you|MKV|jpg|and|MP4|NOT|AVI|M3U|replace|MP3|f4m|YES|xml|all|ko|I|None|TS|LG|at|ag|i|B|NT|t|to|NO|kr|S|M|The|To|iconimage|re|dp|yellowgreen|except|params|_".split("|")))

当我改变这个时:

exec("import re;import base64");exec((lambda p,y:...

exec("import re;import base64");print((lambda p,y:...

我有错误

我用base64解码它,我有这个代码:

84 20,a2,1d,2e,c,56,48,11a,4b

2d            = '19.4a.98'
3b          = '[65 11c]f1 1e[/65]'
f4              = 20.d(48.2c.4e('28://4c/63/' + 2d , 'f4.fb'))
12                = 20.d(48.2c.4e('28://4c/63/' + 2d, '12.c2'))
61              = 1d.7e()
11b                  = 1d.77()
aa             = 20.d(48.2c.4e('28://4c/6e/5c/' + 2d , '75.105'))
f0         = 20.d(48.2c.4e('28://4c/6e/5c/' + 2d))
6f                 = 20.d(48.2c.4e('28://4c/63/19.4a.33'))
ab                = 20.d(48.2c.4e('28://4c'))

31 76():

    1a 35 48.2c.87(f0):
        48.af(f0)

    1a 35 48.2c.86(aa):
        f = 13(aa,'ae')
        f.2b('#2a 6d 3a#')
        f.24()

    51('[65 11c]69 cd.............[/65]','3e',1,12,f4)
    51('[65 11c]69 dc e2.............[/65]','3e',4,12,f4)
    14('[65 91]9e: 10a, 100, f2, fd, ff, fa, 102 fc e9![/65]','3e',a3,12,f4)
    14('[65 95]################aa###################[/65]','3e',a3,12,f4)
    14('[65 a0]d6 b3[/65]','3e',3,12,f4)

    b1 = 13(aa, "ea")
    96 = 11a.57(ea'<11>(.+?)</11>')
    58 a8 22 b1:
        a6 = 96.59(a8)
        58 66 22 a6:
            1a 35 66 == "3e":
                1a "7c" 22 66:
                    1a "34" 22 66:
                        18 = 66.16('.')[-1]
                        29:
                            18 = 18.16('?')[0]
                        11d: 1b
                        29:
                            18 = 18.16('%')[0]
                        11d: 1b
                        14('[65 11c]' + 18.70() + '[/65] - ' + 66,66,1,12,f4)
                    32:
                        51("[65 11c]eb[/65] - " + 66,66,1,12,f4)
                32:
                    18 = 66.16('.')[-1]
                    29:
                        18 = 18.16('?')[0]
                    11d: 1b
                    29:
                        18 = 18.16('%')[0]
                    11d: 1b
                    14('[65 11c]' + 18.70() + '[/65] - ' + 66,66,1,12,f4)

    20.26('62.8b(50)')

31 42():

    66 = 61.c5(1, 3b, 'd9', '', 5e, 5e, ab)

    1a '.7c' 22 66:
        1a 35 '34' 22 66:
            45(66)
        32:
            1e(66,66,12)
    32:
        1e(66,66,12)

31 47():

    1a 48.2c.86(aa):
        8a = 1d.7e().d7(3b, '[65 95]dd f9 88 112 d3 106 d0 75?[/65]','',a5='[65 ef]104[/65]',bc='[10f][65 a0]113[/65][/10f]')
        1a 8a == 1:
            48.ca(aa)
            f = 13(aa,'ae')
            f.2b('#2a 6d 3a#')
            f.24()
    20.26("62.bd")

31 68(66):

    1a 66 == "3e":

        21 =''
        39 = 20.b0(21, 'd5 117 cd 118 69')
        39.b4()
        1a 39.8d():
            21 = 39.b6().101(' ','')
            1a 35 (21 == "") ad (21 == " "):
                1a 35 ('5a://') ad ('da://') 22 21:
                    66 = "5a://" + 21
                32: 66 = 21
            32: 6a()

    1a '.7c' 22 66:
        1a 35 '34' 22 66:
            45(66)
        32:
            1e(7,66,119)
    32:
        1e(7,66,119)

31 45(66):

    5d = 3c(66)

    a=13(aa).37()
    b=a.101('<11>'+66+'</11>\78','\78')
    f= 13(aa, 7d='ae')
    f.2b(1f(b))
    f.24()
    a=13(aa).37()
    b=a.101('#2a 6d 3a#', '#2a 6d 3a#\78<11>'+66+'</11>\78')
    f= 13(aa, 7d='ae')
    f.2b(1f(b))
    f.24()

    14("[65 11c]69 117 e3[/65]" ,66, 2, 12, f4,'')
    14("###########################################" ,66, a3, 12, f4,'')

    58 1c 22 5d:
        7 = 23(1c["4d"])
        66 = 23(1c["66"])
        66 = 66.101('\\ea','').101('\\111','').101('\ea','').101('\111','').101(' ','').101('34','34')
        18 = 66.16('.')[-1]
        29:
            18 = 18.16('?')[0]
        11d: 1b
        29:
            18 = 18.16('%')[0]
        11d: 1b
        14('[65 11c]' + 18.70() + '[/65] - ' + 7 ,66, 2, 12, f4,'')

31 3c(66):

    1a 35 '5a' 22 66:
        7a=13(66).37()
    32:
        7a = 6c(66)
    7a = 7a.101('#9c:','#f8:')
    7a = 7a.101('#cb:','#f8:')
    40=11a.57('^#f8:-?[0-9]*(.*?),(.*?)\78(.*?)$',11a.108+11a.116+11a.f7+11a.115).59(7a)
    ce = []
    58 11e, 4d, 66 22 40:
        25 = {"11e": 11e, "4d": 4d, "66": 66}
        ce.7f(25)
    5d = []
    58 1c 22 ce:
        25 = {"4d": 1c["4d"], "66": 1c["66"]}
        40=11a.57(' (.+?)="(.+?)"',11a.108+11a.116+11a.f7+11a.115).59(1c["11e"])
        58 9a, 93 22 40:
            25[9a.97().d4().101('-', '11f')] = 93.97()
        5d.7f(25)

    f3 5d

31 23(1f):
    29:
        84 72
        1f = 1f.c3(72.c8(1f)["ac"]).80("c1-8")
    11d:
        29:
            1f = 1f.80("c1-8")
        11d:
            1b
    f3 1f

31 1e(7,66,119):

    1a "34" 22 66:
        a=13(aa).37()
        b=a.101('<11>'+66+'</11>\78','\78')
        f= 13(aa, 7d='ae')
        f.2b(1f(b))
        f.24()
        a=13(aa).37()
        b=a.101('#2a 6d 3a#', '#2a 6d 3a#\78<11>'+66+'</11>\78')
        f= 13(aa, 7d='ae')
        f.2b(1f(b))
        f.24()
    43 35 "7c" 22 66:
        a=13(aa).37()
        b=a.101('<11>'+66+'</11>\78','\78')
        f= 13(aa, 7d='ae')
        f.2b(1f(b))
        f.24()
        a=13(aa).37()
        b=a.101('#2a 6d 3a#', '#2a 6d 3a#\78<11>'+66+'</11>\78')
        f= 13(aa, 7d='ae')
        f.2b(1f(b))
        f.24()

    1a 35 '103'22 66:
        1a '.34'22 66:
            66 = '19://19.4a.33/?3d=4f&60;7='+7+'&60;66='+66        
        43 '.e4'22 66:
            66 = 66.101('.e4','.34')
            66 = '19://19.4a.33/?3d=4f&60;7='+7+'&60;66='+66        
        43 '.81'22 66:
            66 = 66.101('.81','.34')
            66 = '19://19.4a.33/?3d=4f&60;7='+7+'&60;66='+66    

    1a "19://" 22 66:
        1a 35 48.2c.87(6f):
            61.74('[65 a0]6f d1 fe 9b![/65]', "ed 11 a4 6f bf be a1. c4 b7 6f ee f6 d8 e7 10c 5a://cc.a7.10d")
            6a()
        66 = "9d("+66+")"
        20.26(66)
        6a()

    1a '5a' 22 66:
        66 = 66 + '|a9-8f=73/5.0 (d2; f7; ba 4.0.3; 107-114; 10b-db e1/c7) 8e/c6.30 (99, 88 92) bb/4.0 c0 85/c6.30'
    44 = 1d.52(66, 46=12, 27=12)
    20.1e ().e5(66, 44, 5e)
    6a()

31 6c(66):

    9f = 56.b8(66)
    9f.94('a9-8f', '73/5.0 (b9 110 6.1) 8c/c9.36 (99, 88 92) cf/41.0.e8.0 85/c9.36')
    7a = 56.b2(9f)
    11=7a.37()
    7a.24()
    f3 11

31 14(7, 66, 7d, 119, f4, e=''):

    44=1d.52(7, 46="79.c2", 27=119)
    44.54('53', f4)
    e6=4b.3f[0]+"?66="+c.10(66)+"&7d="+1f(7d)+"&7="+c.10(7)+"&e="+1f(e)+"&f4="+c.10(f4)
    74=89
    74=2e.38(83=82(4b.3f[1]),66=e6,6b=44,67=5e)
    f3 74

31 51(7,66,7d,119,f4,e=''):
    e6=4b.3f[0]+"?66="+c.10(66)+"&7d="+1f(7d)+"&7="+c.10(7)+"&119="+c.10(119)+"&e="+c.10(e)
    74=89
    44=1d.52(7, 46=119, 27=119)
    44.b5( ec="de", 90={ "df": 7, 'f5': e } )
    44.54('53', f4)
    74=2e.38(83=82(4b.3f[1]),66=e6,6b=44,67=89)
    f3 74

31 5b():
        5f=[]
        55=4b.3f[2]
        1a 64(55)>=2:
                11e=4b.3f[2]
                49=11e.101('?','')
                1a (11e[64(11e)-1]=='/'):
                        11e=11e[0:64(11e)-2]
                2f=49.16('&')
                5f={}
                58 10e 22 e0(64(2f)):
                        17={}
                        17=2f[10e].16('=')
                        1a (64(17))==2:
                                5f[17[0]]=17[1]

        f3 5f

11e=5b(); 66=109; 7=109; 7d=109; 7b=109; 119=109
29: 7b=c.15(11e["7b"])
11d: 1b
29: 66=c.15(11e["66"])
11d: 1b
29: 7=c.15(11e["7"])
11d: 1b
29: 7d=82(11e["7d"])
11d: 1b
29: 119=c.15(11e["119"])
11d: 1b
29: f4=c.15(11e["f4"])
11d: 1b

1a 7d==109 ad 66==109 ad 64(66)<1: 76()
43 7d==1:68(66)
43 7d==2:1e(7,66,119)
43 7d==3:47()
43 7d==4:42()

2e.71(82(4b.3f[1]))

现在我不知道如何处理这段代码。

1 个答案:

答案 0 :(得分:1)

  

我将'exec'更改为'print'并且我有一个错误

嗯......你一定做错了,因为它有效...... https://repl.it/GDDi/0

代码变为:

import xbmc,xbmcaddon,xbmcgui,xbmcplugin,urllib,urllib2,os,re,sys

addon_id            = 'plugin.video.echoplayer'
AddonTitle          = '[COLOR yellowgreen]ECHO Player[/COLOR]'
fanart              = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id , 'fanart.jpg'))
icon                = xbmc.translatePath(os.path.join('special://home/addons/' + addon_id, 'icon.png'))
dialog              = xbmcgui.Dialog()
dp                  = xbmcgui.DialogProgress()
HISTORY             = xbmc.translatePath(os.path.join('special://home/userdata/addon_data/' + addon_id , 'history.xml'))
DATA_FOLDER         = xbmc.translatePath(os.path.join('special://home/userdata/addon_data/' + addon_id))
F4M                 = xbmc.translatePath(os.path.join('special://home/addons/plugin.video.f4mTester'))
HOME                = xbmc.translatePath(os.path.join('special://home'))

def GetMenu():

    if not os.path.exists(DATA_FOLDER):
        os.makedirs(DATA_FOLDER)

    if not os.path.isfile(HISTORY):
        f = open(HISTORY,'w')
        f.write('#START OF FILE#')
        f.close()

    addDir('[COLOR yellowgreen]Play URL.............[/COLOR]','none',1,icon,fanart)
    addDir('[COLOR yellowgreen]Play Local File.............[/COLOR]','none',4,icon,fanart)
    addLink('[COLOR dodgerblue]Supported: TS, M3U, M3U8, MP4, AVI, MKV, MP3 and MORE![/COLOR]','none',999,icon,fanart)
    addLink('[COLOR white]################HISTORY###################[/COLOR]','none',999,icon,fanart)
    addLink('[COLOR red]Clear History[/COLOR]','none',3,icon,fanart)

    vers = open(HISTORY, "r")
    regex = re.compile(r'<link>(.+?)</link>')
    for line in vers:
        file = regex.findall(line)
        for url in file:
            if not url == "none":
                if "m3u" in url:
                    if "m3u8" in url:
                        ext = url.split('.')[-1]
                        try:
                            ext = ext.split('?')[0]
                        except: pass
                        try:
                            ext = ext.split('%')[0]
                        except: pass
                        addLink('[COLOR yellowgreen]' + ext.upper() + '[/COLOR] - ' + url,url,1,icon,fanart)
                    else:
                        addDir("[COLOR yellowgreen]LIST[/COLOR] - " + url,url,1,icon,fanart)
                else:
                    ext = url.split('.')[-1]
                    try:
                        ext = ext.split('?')[0]
                    except: pass
                    try:
                        ext = ext.split('%')[0]
                    except: pass
                    addLink('[COLOR yellowgreen]' + ext.upper() + '[/COLOR] - ' + url,url,1,icon,fanart)

    xbmc.executebuiltin('Container.SetViewMode(50)')

def Get_Local_File():

    url = dialog.browse(1, AddonTitle, 'files', '', False, False, HOME)

    if '.m3u' in url:
        if not 'm3u8' in url:
            List_M3U8(url)
        else:
            Player(url,url,icon)
    else:
        Player(url,url,icon)

def Clear_History():

    if os.path.isfile(HISTORY):
        choice = xbmcgui.Dialog().yesno(AddonTitle, '[COLOR white]Would you like to clear all stored history?[/COLOR]','',yeslabel='[COLOR lime]YES[/COLOR]',nolabel='[B][COLOR red]NO[/COLOR][/B]')
        if choice == 1:
            os.remove(HISTORY)
            f = open(HISTORY,'w')
            f.write('#START OF FILE#')
            f.close()
    xbmc.executebuiltin("Container.Refresh")

def Find_Out(url):

    if url == "none":

        string =''
        keyboard = xbmc.Keyboard(string, 'Enter The URL To Play')
        keyboard.doModal()
        if keyboard.isConfirmed():
            string = keyboard.getText().replace(' ','')
            if not (string == "") or (string == " "):
                if not ('http://') or ('https://') in string:
                    url = "http://" + string
                else: url = string
            else: quit()

    if '.m3u' in url:
        if not 'm3u8' in url:
            List_M3U8(url)
        else:
            Player(name,url,iconimage)
    else:
        Player(name,url,iconimage)

def List_M3U8(url):

    list = CREATE_M3U_LIST(url)

    a=open(HISTORY).read()
    b=a.replace('<link>'+url+'</link>\n','\n')
    f= open(HISTORY, mode='w')
    f.write(str(b))
    f.close()
    a=open(HISTORY).read()
    b=a.replace('#START OF FILE#', '#START OF FILE#\n<link>'+url+'</link>\n')
    f= open(HISTORY, mode='w')
    f.write(str(b))
    f.close()

    addLink("[COLOR yellowgreen]Play The List[/COLOR]" ,url, 2, icon, fanart,'')
    addLink("###########################################" ,url, 999, icon, fanart,'')

    for channel in list:
        name = GetEncodeString(channel["display_name"])
        url = GetEncodeString(channel["url"])
        url = url.replace('\\r','').replace('\\t','').replace('\r','').replace('\t','').replace(' ','').replace('m3u8','m3u8')
        ext = url.split('.')[-1]
        try:
            ext = ext.split('?')[0]
        except: pass
        try:
            ext = ext.split('%')[0]
        except: pass
        addLink('[COLOR yellowgreen]' + ext.upper() + '[/COLOR] - ' + name ,url, 2, icon, fanart,'')

def CREATE_M3U_LIST(url):

    if not 'http' in url:
        response=open(url).read()
    else:
        response = open_url(url)
    response = response.replace('#AAASTREAM:','#A:')
    response = response.replace('#EXTINF:','#A:')
    matches=re.compile('^#A:-?[0-9]*(.*?),(.*?)\n(.*?)$',re.I+re.M+re.U+re.S).findall(response)
    li = []
    for params, display_name, url in matches:
        item_data = {"params": params, "display_name": display_name, "url": url}
        li.append(item_data)
    list = []
    for channel in li:
        item_data = {"display_name": channel["display_name"], "url": channel["url"]}
        matches=re.compile(' (.+?)="(.+?)"',re.I+re.M+re.U+re.S).findall(channel["params"])
        for field, value in matches:
            item_data[field.strip().lower().replace('-', '_')] = value.strip()
        list.append(item_data)

    return list

def GetEncodeString(str):
    try:
        import chardet
        str = str.decode(chardet.detect(str)["encoding"]).encode("utf-8")
    except:
        try:
            str = str.encode("utf-8")
        except:
            pass
    return str

def Player(name,url,iconimage):

    if "m3u8" in url:
        a=open(HISTORY).read()
        b=a.replace('<link>'+url+'</link>\n','\n')
        f= open(HISTORY, mode='w')
        f.write(str(b))
        f.close()
        a=open(HISTORY).read()
        b=a.replace('#START OF FILE#', '#START OF FILE#\n<link>'+url+'</link>\n')
        f= open(HISTORY, mode='w')
        f.write(str(b))
        f.close()
    elif not "m3u" in url:
        a=open(HISTORY).read()
        b=a.replace('<link>'+url+'</link>\n','\n')
        f= open(HISTORY, mode='w')
        f.write(str(b))
        f.close()
        a=open(HISTORY).read()
        b=a.replace('#START OF FILE#', '#START OF FILE#\n<link>'+url+'</link>\n')
        f= open(HISTORY, mode='w')
        f.write(str(b))
        f.close()

    if not 'f4m'in url:
        if '.m3u8'in url:
            url = 'plugin://plugin.video.f4mTester/?streamtype=HLSRETRY&amp;name='+name+'&amp;url='+url     
        elif '.ts'in url:
            url = url.replace('.ts','.m3u8')
            url = 'plugin://plugin.video.f4mTester/?streamtype=HLSRETRY&amp;name='+name+'&amp;url='+url     
        elif '.mpegts'in url:
            url = url.replace('.mpegts','.m3u8')
            url = 'plugin://plugin.video.f4mTester/?streamtype=HLSRETRY&amp;name='+name+'&amp;url='+url 

    if "plugin://" in url:
        if not os.path.exists(F4M):
            dialog.ok('[COLOR red]F4M TESTER NOT INSTALLED![/COLOR]', "This link requires F4M Tester be installed. Please install F4M from the Shani Repo at http://fusion.tvaddons.ag")
            quit()
        url = "PlayMedia("+url+")"
        xbmc.executebuiltin(url)
        quit()

    if 'http' in url:
        url = url + '|User-Agent=Mozilla/5.0 (Linux; U; Android 4.0.3; ko-kr; LG-L160L Build/IML74K) AppleWebkit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30'
    liz = xbmcgui.ListItem(url, iconImage=icon, thumbnailImage=icon)
    xbmc.Player ().play(url, liz, False)
    quit()

def open_url(url):

    req = urllib2.Request(url)
    req.add_header('User-Agent', 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36')
    response = urllib2.urlopen(req)
    link=response.read()
    response.close()
    return link

def addLink(name, url, mode, iconimage, fanart, description=''):

    liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
    liz.setProperty('fanart_image', fanart)
    u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)+"&description="+str(description)+"&fanart="+urllib.quote_plus(fanart)
    ok=True
    ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=False)
    return ok

def addDir(name,url,mode,iconimage,fanart,description=''):
    u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)+"&iconimage="+urllib.quote_plus(iconimage)+"&description="+urllib.quote_plus(description)
    ok=True
    liz=xbmcgui.ListItem(name, iconImage=iconimage, thumbnailImage=iconimage)
    liz.setInfo( type="Video", infoLabels={ "Title": name, 'plot': description } )
    liz.setProperty('fanart_image', fanart)
    ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
    return ok

def get_params():
        param=[]
        paramstring=sys.argv[2]
        if len(paramstring)>=2:
                params=sys.argv[2]
                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(); url=None; name=None; mode=None; site=None; iconimage=None
try: site=urllib.unquote_plus(params["site"])
except: pass
try: url=urllib.unquote_plus(params["url"])
except: pass
try: name=urllib.unquote_plus(params["name"])
except: pass
try: mode=int(params["mode"])
except: pass
try: iconimage=urllib.unquote_plus(params["iconimage"])
except: pass
try: fanart=urllib.unquote_plus(params["fanart"])
except: pass

if mode==None or url==None or len(url)<1: GetMenu()
elif mode==1:Find_Out(url)
elif mode==2:Player(name,url,iconimage)
elif mode==3:Clear_History()
elif mode==4:Get_Local_File()

xbmcplugin.endOfDirectory(int(sys.argv[1]))