Advertisement
Guest User

proxer.me

a guest
Mar 10th, 2014
1,333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 11.17 KB | None | 0 0
  1. import urllib,urllib2,re
  2. import xbmcplugin,xbmcgui
  3. import xbmcaddon,xbmc
  4. import urlresolver
  5. #proxer.me addon by deboy1337
  6.  
  7.  
  8. pluginhandle = int(sys.argv[1])
  9.  
  10. def CATEGORIES():
  11.         addDir('Serien','http://proxer.me/anime?set=serie#top',1,'')
  12.         addDir('Filme','http://proxer.me/anime?set=movie#top',1,'')
  13.         addDir('OVA','http://proxer.me/anime?set=ova#top',1,'')
  14.         addDir('Top-Bewertungen','http://proxer.me/anime/animeseries/rating/all#top',2,'')
  15.         addDir('Top-Zugriffe','http://proxer.me/anime/animeseries/clicks/all#top',2,'')
  16.         addDir('Airing-Anime','http://proxer.me/anime/airing#top',2,'')
  17.         addDir('HD-Streams','http://proxer.me/misc/hdstream#top',2,'')
  18.         addDir('Seasons','http://proxer.me/season#top',3,'')
  19.         addDir('Suche','http://proxer.me/search?s=search&name=',5,'')
  20.                        
  21. def ALPHABET(url):
  22.         html = getUrl(url)
  23.         abc=re.compile('<td colspan="2">(.*?)</td>', re.DOTALL).findall(html)
  24.         match=re.compile('<a data-ajax="true" class="menu" href="/anime/(.+?)">(.+?)</a>').findall(abc[0])
  25.         for url,name in match:
  26.                 addDir(name,'http://proxer.me/anime/'+url,2,'')
  27.  
  28. def ANIME(url):
  29.         html = getUrl(url)
  30.         match=re.compile('<a data-ajax="true" class="tip" title="Cover:(.+?)" href="(.+?)#top".*?>(.+?)</a>').findall(html)
  31.         for img,url,name in match:
  32.                 addDir(name,'http://proxer.me'+url+'/list',9,'http://upload.proxer.me/cover/'+ img + '.jpg')
  33.         try:
  34.                 next=re.compile('<td align="right">(.*?)</td>', re.DOTALL).findall(html)
  35.                 match2=re.compile('<a class="menu" data-ajax="true" href="(.+?)">(.+?)</a>').findall(next[0])
  36.                 for url,name in match2:
  37.                         if '>' in name:
  38.                                 addDir('Weiter','http://proxer.me'+url,2,'')
  39.                         else:
  40.                                 pass
  41.         except:
  42.                 pass
  43.  
  44.  
  45.  
  46. def SEASON(url):
  47.         html = getUrl(url)
  48.         match=re.compile('<a href="/info/(.+?)#top" data-ajax="true">(.+?)</a>').findall(html)
  49.         for url,name in match:
  50.                 if 'Details' in name:
  51.                   html2 = getUrl('http://proxer.me/info/' + url + '#top')
  52.                   match2=re.compile('<span class="fn">(.+?)</span>').findall(html2)
  53.                   cover=re.compile('<img src="(.+?)" style="width:.+?; height:.+?;">').findall(html2)
  54.                   addDir(match2[0],'http://proxer.me/info/'+url+'/list',9,cover[0])
  55.                   print url
  56.  
  57.  
  58.                
  59. def SUFU(url):
  60.         kb = xbmc.Keyboard('', 'Suche', False)
  61.         kb.doModal()
  62.         search_entered = kb.getText().replace(' ','+')
  63.         url2 = url + search_entered + '&sprache=alle&typ=all-anime&genre=&nogenre=&sort=name&length=&length-limit=down#search'
  64.         html = getUrl(url2)
  65.         match=re.compile('<td><a data-ajax="true" class="tip" title="Cover:(.+?)" href="(.+?)#top">(.+?)</a></td>').findall(html)
  66.         for img,url,name in match:
  67.                 addDir(name,'http://proxer.me'+url+'/list',9,'http://upload.proxer.me/cover/'+ img + '.jpg')
  68.  
  69.         match2=re.compile('<a class="menu" data-ajax="true" href="(.+?)">(.+?)</a>').findall(html)
  70.         for url,name in match2:
  71.                 if '>' in name:
  72.                         addDir(name,'http://proxer.me'+url,4,'')
  73.                 else:
  74.                         pass
  75.  
  76.  
  77. def SELECTSUB(url):
  78.         html = getUrl(url)
  79.         match=re.findall('<li class="active"><a data-ajax="true" href="/info/(.+?)/list#top">(.+?)</a>', html, re.DOTALL)
  80.         for url,name in match:
  81.                 addDir(name + ' - Ger Sub','http://proxer.me/info/'+url+'/list#top',10,'')
  82.         for url,name in match:
  83.                 addDir(name + ' - Eng Sub','http://proxer.me/info/'+url+'/list#top',11,'')
  84.  
  85. def GERSUB(url):
  86.         html = getUrl(url)
  87.         match=re.compile('<td><span id="listTitle(.+?)">(.+?)</span></td>').findall(html)
  88.         animeid=re.compile('<li class="active"><a data-ajax="true" href="/info/(.+?)/list#top">Episoden</a></li>').findall(html)
  89.         for url,name in match:
  90.                 addDir(name,'http://proxer.me/watch/'+ animeid[0] +'/'+url+'/gersub',12,'')
  91.  
  92.         try:
  93.                 pages=re.compile('<p align="center">(.*?)</p>').findall(html)
  94.                 match2=re.compile('<a class="menu" data-ajax="true" href="/info/(.+?)">(.+?)</a>').findall(pages[0])
  95.                 for url,name in match2:
  96.                         addDir(name,'http://proxer.me/info/' + url ,10,'')
  97.         except:
  98.                 pass
  99.  
  100. def ENGSUB(url):
  101.         html = getUrl(url)
  102.         match=re.compile('<td><span id="listTitle(.+?)">(.+?)</span></td>').findall(html)
  103.         animeid=re.compile('<li class="active"><a data-ajax="true" href="/info/(.+?)/list#top">Episoden</a></li>').findall(html)
  104.         for url,name in match:
  105.                 addDir(name,'http://proxer.me/watch/'+ animeid[0] +'/'+url+'/engsub',12,'')
  106.  
  107.         try:
  108.                 pages=re.compile('<p align="center">(.*?)</p>').findall(html)
  109.                 match2=re.compile('<a class="menu" data-ajax="true" href="/info/(.+?)">(.+?)</a>').findall(pages[0])
  110.                 for url,name in match2:
  111.                         addDir(name,'http://proxer.me/info/' + url ,11,'')
  112.         except:
  113.                 pass
  114.  
  115. def GETHOST(url):
  116.         html = getUrl(url)
  117.         match=re.findall('"code":"(.+?)","type":"(.+?)","htype":".+?","replace":".+?embed.+?",', html, re.DOTALL)
  118.         for url,name in match:
  119.           if 'putlocker' in name:
  120.                   addDir(name,'http://putlocker.com/embed/' + url,13,'')
  121.           elif 'streamcloud' in name :
  122.                   url = url.replace('\\','')
  123.                   addDir(name,url,13,'')
  124.           elif 'sockshare' in name :
  125.                   addDir(name,'http://www.sockshare.com/embed/' + url,13,'')
  126.           elif 'dailymotion' in name :
  127.                   addDir(name,'http://www.dailymotion.com/embed/video/' + url,13,'')
  128.           elif 'mp4upload' in name :
  129.                   addDir(name,'http://www.mp4upload.com/embed-' + url + '.html',14,'')
  130.           elif 'myvideo' in name :
  131.                   addDir(name + ' dont work','http://www.myvideo.de/watch/' + url,13,'')
  132.           elif 'rutube' in name :
  133.                   addDir(name + ' dont work','http://rutube.ru/video/embed/' + url,13,'')
  134.           elif 'veevr' in name :
  135.                   addDir(name + ' dont work','http://veevr.com/embed/' + url,13,'')
  136.           elif 'novamov' in name :
  137.                   addDir(name,'http://embed.novamov.com//embed.php?v=' + url,13,'')
  138.           elif 'videoweed' in name :
  139.                   addDir(name,'http://embed.videoweed.es//embed.php?v=' + url,13,'')
  140.           elif 'faststream' in name :
  141.                   addDir(name + ' dont work','http://faststream.in//embed-' + url + '.html',13,'')
  142.           elif 'myvi' in name :
  143.                   addDir(name + ' dont work','http://myvi.ru//ru//flash//player//' + url,13,'')
  144.           elif 'proxer-stream' in name :
  145.                   addDir(name ,'http://stream.proxer.me/embed-'+ url + '-728x504.html',15,'')
  146.           elif 'uploadc' in name :
  147.                   url = url.replace('\/','/')
  148.                   addDir(name + ' dont work',url,13,'')
  149.  
  150. def video(url):
  151.         videoLink = urlresolver.resolve(url)
  152.         listitem = xbmcgui.ListItem(path=videoLink)
  153.         xbmcplugin.setResolvedUrl(pluginhandle, True, listitem)
  154.  
  155. def mp4upload(url):
  156.         html = getUrl(url)
  157.         match=re.findall("'file': '(.+?)'", html, re.DOTALL)
  158.         vidlink = match[0]
  159.         listitem = xbmcgui.ListItem(path=vidlink)
  160.         xbmcplugin.setResolvedUrl(pluginhandle, True, listitem)
  161.  
  162.        
  163. def proxerhd(url):
  164.         html = getUrl(url)
  165.     parameters = re.findall(";',.*?'(.*?)'", html)
  166.     parameters = parameters[0].split('|')
  167.     code = re.findall('c:".+?://(.*?)"', html)
  168.     code = list(code[0])
  169.     stream = ''
  170.     var = code[-7]
  171.     for code in code:
  172.       code = code.replace('a','10').replace('b','11').replace('c','12').replace('d','13').replace('e','14')
  173.       try:
  174.         code = parameters[int(code)]
  175.       except:
  176.         pass
  177.       stream += code
  178.     stream = 'http://' + stream.replace('//','/'+var+'/')
  179.     addLink(name,stream,'')
  180.        
  181.  
  182.                
  183. def get_params():
  184.         param=[]
  185.         paramstring=sys.argv[2]
  186.         if len(paramstring)>=2:
  187.                 params=sys.argv[2]
  188.                 cleanedparams=params.replace('?','')
  189.                 if (params[len(params)-1]=='/'):
  190.                         params=params[0:len(params)-2]
  191.                 pairsofparams=cleanedparams.split('&')
  192.                 param={}
  193.                 for i in range(len(pairsofparams)):
  194.                         splitparams={}
  195.                         splitparams=pairsofparams[i].split('=')
  196.                         if (len(splitparams))==2:
  197.                                 param[splitparams[0]]=splitparams[1]
  198.                                
  199.         return param
  200.  
  201.  
  202.  
  203.  
  204. def addLink(name,url,iconimage):
  205.         ok=True
  206.         liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
  207.         liz.setInfo( type="Video", infoLabels={ "Title": name } )
  208.         liz.setProperty('IsPlayable', 'true')
  209.         ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
  210.         return ok
  211.  
  212.  
  213. def addDir(name,url,mode,iconimage):
  214.         u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
  215.         ok=True
  216.         liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
  217.         liz.setInfo( type="Video", infoLabels={ "Title": name } )
  218.         ok=xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=True)
  219.         return ok
  220.  
  221.  
  222. def getUrl(url):
  223.         req = urllib2.Request(url)
  224.         req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3')
  225.         response = urllib2.urlopen(req)
  226.         link=response.read()
  227.         response.close()
  228.         return link        
  229.              
  230. params=get_params()
  231. url=None
  232. name=None
  233. mode=None
  234.  
  235. try:
  236.         url=urllib.unquote_plus(params["url"])
  237. except:
  238.         pass
  239. try:
  240.         name=urllib.unquote_plus(params["name"])
  241. except:
  242.         pass
  243. try:
  244.         mode=int(params["mode"])
  245. except:
  246.         pass
  247.  
  248. print "Mode: "+str(mode)
  249. print "URL: "+str(url)
  250. print "Name: "+str(name)
  251.  
  252. if mode==None or url==None or len(url)<1:
  253.         print ""
  254.         CATEGORIES()
  255.        
  256. elif mode==1:
  257.         print ""+url
  258.         ALPHABET(url)
  259.  
  260. elif mode==2:
  261.         print ""+url
  262.         ANIME(url)
  263.  
  264. elif mode==3:
  265.         print ""+url
  266.         SEASON(url)
  267.  
  268.  
  269. elif mode==5:
  270.         print ""+url
  271.         SUFU(url)
  272.  
  273. elif mode==9:
  274.         print ""+url
  275.         SELECTSUB(url)
  276.  
  277. elif mode==10:
  278.         print ""+url
  279.         GERSUB(url)
  280.  
  281. elif mode==11:
  282.         print ""+url
  283.         ENGSUB(url)
  284.  
  285. elif mode==12:
  286.         print ""+url
  287.         GETHOST(url)
  288.  
  289. elif mode==13:
  290.         print ""+url
  291.         video(url)
  292.  
  293. elif mode==14:
  294.         print ""+url
  295.         mp4upload(url)
  296.  
  297. elif mode==15:
  298.         print ""+url
  299.         proxerhd(url)
  300.  
  301. xbmcplugin.endOfDirectory(int(sys.argv[1]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement