Skip to content

Commit

Permalink
*api: cookie states saved
Browse files Browse the repository at this point in the history
       *api: name matching algo improved
       *api: improved title comaprison for eastern langs
       *ann: episode handling improved
       *ann: pagination implemented. faster browsing
       *ann: fixed anime/serie definitions 
       *ann: fixed issues with json keys to be parsed as strings
 *kissanime: new link provider for animes
  • Loading branch information
hbiyik committed Aug 5, 2015
0 parents commit 76f341a
Show file tree
Hide file tree
Showing 85 changed files with 4,804 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**.pyc
**.pyo
**.bak
**.pyd
**Thumbs.db
339 changes: 339 additions & 0 deletions LICENSE.txt

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# plugin.program.ump
plugin.program.ump
65 changes: 65 additions & 0 deletions addon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import sys
import os
import xbmc
import xbmcaddon
import xbmcgui
import xbmcplugin
import threading
import time
import gc

addon = xbmcaddon.Addon('plugin.program.ump')
addon_dir = xbmc.translatePath( addon.getAddonInfo('path') )
sys.path.append(os.path.join( addon_dir, 'resources', 'lib' ) )

from ump import providers
from ump import api
from ump import ui

ump=api.ump()

print "HANDLE : " + str(ump.handle)
print "MODULE : " + str(ump.module)
print "PAGE : " + str(ump.page)
#print "ARGS : " + str(ump.args)
print "CONTENT_TYPE : " + str(ump.content_type)
print "INFO : " + str(ump.info)
print "ART : " + str(ump.art)


indexers=providers.find(ump.content_type,"index")
url_providers=providers.find(ump.content_type,"url")
link_providers=providers.find(ump.content_type,"link")

if False:
iwin=ui.imagewindow('picture.xml', addon_dir,"Default","720p",playlist=[])

if ump.module == "ump":
if ump.page is "root":
for provider in indexers:
provider_cat,provider_type,provider_name=provider
li=xbmcgui.ListItem(provider_name, iconImage="DefaultFolder.png", thumbnailImage="DefaultFolder.png")
xbmcplugin.addDirectoryItem(ump.handle,ump.link_to(module=provider_name),li,True)
xbmcplugin.endOfDirectory(ump.handle)
elif ump.page== "urlselect":
# threads=[]
if len(link_providers)==0:
ump.dialog.notification("ERROR","There is no available providers for %s"%ump.content_type)
else:
gid=ump.tm.create_gid()
for provider in link_providers:
provider=providers.load(ump.content_type,"link",provider[2])
ump.tm.add_queue(provider.run, (ump,),gid=gid)
ump.window.doModal()
ump.tm.join(gid)
elif providers.is_loadable(ump.content_type,"index",ump.module,indexers):
providers.load(ump.content_type,"index",ump.module).run(ump)
ump.tm.join()
ump.tm.stop()
ump.shut()
print "CONTENT_CAT : " + str(ump.content_cat)
del gc.garbage[:]
gc.collect()
while not len(threading.enumerate())==1:
print threading.enumerate()
print "EOF"
25 changes: 25 additions & 0 deletions addon.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?><addon id="plugin.program.ump" name="Universal Media Provider" provider-name="boogiepop" version="0.0.4">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.unidecode" version="0.4.16"/>
<import addon="script.module.dateutil" version="2.4.0"/>
</requires>
<extension library="addon.py" point="xbmc.python.pluginsource">
<provides>video audio image</provides>
</extension>
<extension name="Boogie's Kodi Repo" point="xbmc.addon.repository">
<info compressed="false">http://raw.github.com/huseyinbiyik/repository.boogie.dist/master/addons.xml</info>
<checksum>http://raw.github.com/huseyinbiyik/repository.boogie.dist/master/addons.xml.md5</checksum>
<datadir zip="true">http://raw.github.com/huseyinbiyik/repository.boogie.dist/master</datadir>
</extension>
<extension point="xbmc.addon.metadata">
<platform>all</platform>
<summary lang="en">Universal Media Provider</summary>
<description lang="en">Universal Media Provider</description>
<license>GNU General Public License, v2</license>
<language/>
<forum>https://github.com/huseyinbiyik/plugin.program.ump/issues</forum>
<source/>
<email>boogiepop</email>
</extension>
</addon>
Empty file added changelog.txt
Empty file.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions resources/data/cookie
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#LWP-Cookies-2.0
Set-Cookie3: __cfduid=d8b1ef68e9b38790c2ff5c7c5bb1382a11438795214; path="/"; domain=".animenewsnetwork.com"; path_spec; domain_dot; expires="2016-08-04 17:20:14Z"; HttpOnly=None; version=0
Set-Cookie3: __cfduid=d3fd6642e4829dcf52c16cde2bd7005fc1438795226; path="/"; domain=".dizipub.com"; path_spec; domain_dot; expires="2016-08-04 17:20:26Z"; HttpOnly=None; version=0
Set-Cookie3: __cfduid=d7e48d6ab079c648d90ae17d1a38f87e51438795226; path="/"; domain=".kissanime.com"; path_spec; domain_dot; expires="2016-08-04 17:20:26Z"; HttpOnly=None; version=0
Set-Cookie3: cf_clearance="58aa2e630fef735a8a21f72a2ade38846f367d21-1438795230-604800"; path="/"; domain=".kissanime.com"; path_spec; domain_dot; expires="2015-08-12 18:20:30Z"; HttpOnly=None; version=0
Set-Cookie3: UniversalUserID=9ce60dfa54c2472dbe135bed89a91a4c; path="/"; domain=".myvi.ru"; path_spec; expires="2016-08-05 17:20:32Z"; version=0
Set-Cookie3: vp="0.5"; path="/"; domain=".myvi.ru"; path_spec; expires="2015-08-06 17:20:33Z"; version=0
Set-Cookie3: __cfduid=dd699e4f470f4630b73af7eaf8da5a4901438795226; path="/"; domain=".turkanime.tv"; path_spec; domain_dot; expires="2016-08-04 17:20:26Z"; HttpOnly=None; version=0
Set-Cookie3: remixlang=3; path="/"; domain=".vk.com"; path_spec; domain_dot; expires="2016-08-14 01:06:58Z"; version=0
Binary file added resources/images/cloudy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/divxstage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/google.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/kiwi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/mailru.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/mangafox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/movshare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/myvi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/novamov.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/nowvideo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/okru.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/plusplayer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/redmp3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/sharerepo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/sharesix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/videoweed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/vk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/vkext.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/vkfix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/vkplayer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/vodlocker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
235 changes: 235 additions & 0 deletions resources/lib/providers/audio_index_lastfm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
import xbmc
import xbmcgui
import xbmcplugin
from datetime import date
from urllib import quote_plus
from urllib import urlencode
import time
import re
import json
from xml.dom import minidom
import random
import dateutil.parser as dparser

mirror="http://ws.audioscrobbler.com/2.0/"
encoding="utf-8"
apikey="ff9469649c8c7d2120758deca5ffa586"
recnum=50

def get_img(ops,default="DefaultFolder.png"):
im=default
for image in reversed(ops):
if image["#text"].startswith("http"):
im=image["#text"]
break
return im

def run(ump):
globals()['ump'] = ump
cacheToDisc=True
if ump.page == "root":
li=xbmcgui.ListItem("Search", iconImage="DefaultFolder.png", thumbnailImage="DefaultFolder.png")
xbmcplugin.addDirectoryItem(ump.handle,ump.link_to("search",{"serach":True}),li,True)


elif ump.page == "search":
kb = xbmc.Keyboard('default', 'Search Audio', True)
kb.setDefault("")
kb.setHiddenInput(False)
kb.doModal()
what=kb.getText()
li=xbmcgui.ListItem("Search %s in Artists" % what, iconImage="DefaultFolder.png", thumbnailImage="DefaultFolder.png")
u=ump.link_to("searchresult",{"what":what,"where":"artist"})
xbmcplugin.addDirectoryItem(ump.handle,u,li,True)

li=xbmcgui.ListItem("Search %s in Albums" % what, iconImage="DefaultFolder.png", thumbnailImage="DefaultFolder.png")
u=ump.link_to("searchresult",{"what":what,"where":"album"})
xbmcplugin.addDirectoryItem(ump.handle,u,li,True)

li=xbmcgui.ListItem("Search %s in Tracks" % what, iconImage="DefaultFolder.png", thumbnailImage="DefaultFolder.png")
u=ump.link_to("searchresult",{"what":what,"where":"track"})
xbmcplugin.addDirectoryItem(ump.handle,u,li,True)

elif ump.page == "searchresult":
what=ump.args["what"]
where=ump.args["where"]
q={"method":where+".search",where:what,"api_key":apikey,"format":"json"}
js=json.loads(ump.get_page(mirror,None,query=q))

try:
results=js["results"][where+"matches"][where]
except:
return None
if not isinstance(results,list):
return None

if where=="artist":
ump.set_content(ump.defs.CC_ARTISTS)
for result in results:
mbid=result["mbid"]
title=result["name"]
im=get_img(result.get("image",[]))
li=xbmcgui.ListItem(title, iconImage=im, thumbnailImage=im)
u=ump.link_to(where,{"mbid":mbid,"name":result["name"],"artim":im})
xbmcplugin.addDirectoryItem(ump.handle,u,li,True)
if where=="album":
ump.set_content(ump.defs.CC_ALBUMS)
for result in results:
mbid=result["mbid"]
title=result["name"]
artist=result["artist"]
im=get_img(result.get("image",[]))
li=xbmcgui.ListItem(artist+ " - "+title, iconImage=im, thumbnailImage=im)
u=ump.link_to(where,{"mbid":mbid,"name":result["name"],"artim":im})
xbmcplugin.addDirectoryItem(ump.handle,u,li,True)
if where=="track":
ump.set_content(ump.defs.CC_SONGS)
for result in results:
mbid=result["mbid"]
title=result["name"]
artist=result["artist"]
im=get_img(result.get("image",[]))
audio={}
audio["info"]={
"year":"",
"tracknumber":-1,
"duration":"",
"album":"",
"artist":artist,
"title":title,
"code":mbid,
}
audio["art"]={
"thumb":im,
"poster":im,
}
li=xbmcgui.ListItem(artist+ " - "+title, iconImage=im, thumbnailImage=im)
ump.art=audio["art"]
ump.info=audio["info"]
u=ump.link_to("urlselect")
xbmcplugin.addDirectoryItem(ump.handle,u,li,True)




elif ump.page == "artist":
ump.set_content(ump.defs.CC_ALBUMS)
ambid=ump.args["mbid"]
name=ump.args["name"]
artim=ump.args["artim"]
q={"method":"artist.topalbums","mbid":ambid,"api_key":apikey,"format":"json"}
js=json.loads(ump.get_page(mirror,None,query=q))
results=js.get("topalbums",{"album":[]})["album"]

audio={}
audio["info"]={
"year":"",
"tracknumber":-1,
"duration":"",
"album":"",
"artist":name,
"title":"",
"code":ambid,
}
audio["art"]={
"thumb":artim,
"poster":artim,
}
li=xbmcgui.ListItem("Play Artist: %s"%name, iconImage=artim, thumbnailImage=artim)
li.setInfo("audio",audio["info"])
li.setArt(audio["art"])
ump.art=audio["art"]
ump.info=audio["info"]
u=ump.link_to("urlselect")
xbmcplugin.addDirectoryItem(ump.handle,u,li,True)

for result in results:
audio={}
mbid=result["mbid"]
im=get_img(result.get("image",[]))
audio["info"]={
"year":"",
"tracknumber":-1,
"duration":"",
"album":result["name"],
"artist":name,
"title":"",
"code":mbid,
}
audio["art"]={
"thumb":im,
"poster":im,
}
li=xbmcgui.ListItem(name + " - " +result["name"], iconImage=im, thumbnailImage=im)
li.setInfo("audio",audio["info"])
li.setArt(audio["art"])
u=ump.link_to("album",{"mbid":mbid,"name":result["name"]})
xbmcplugin.addDirectoryItem(ump.handle,u,li,True)



elif ump.page == "album":
ump.set_content(ump.defs.CC_SONGS)
mbid=ump.args["mbid"]
name=ump.args["name"]
q={"method":"album.getinfo","mbid":mbid,"api_key":apikey,"format":"json"}
js=json.loads(ump.get_page(mirror,None,query=q))
alb=js.get("album",None)
if alb:
album=alb["name"]
artist=alb["artist"]
release=alb["releasedate"]
alid=alb["mbid"]
relyear=2000
albumimage=get_img(alb.get("image",[]))
results=alb.get("tracks",{"track":[]})["track"]
i=0
audio={}
audio["info"]={
"year":relyear,
"tracknumber":-1,
"duration":"",
"album":alb["name"],
"artist":artist,
"title":"",
"code":alid,
}
audio["art"]={
"thumb":albumimage,
"poster":albumimage,
}
li=xbmcgui.ListItem("Play Album: %s"%alb["name"], iconImage=albumimage, thumbnailImage=albumimage)
li.setInfo("audio",audio["info"])
li.setArt(audio["art"])
ump.art=audio["art"]
ump.info=audio["info"]
u=ump.link_to("urlselect")
xbmcplugin.addDirectoryItem(ump.handle,u,li,True)

for result in results:
i+=1
audio={}
mbid=result["mbid"]
audio["info"]={
"year":relyear,
"tracknumber":i,
"duration":int(result["duration"]),
"album":album,
"artist":artist,
"title":result["name"],
"code":mbid,
}
audio["art"]={
"thumb":albumimage,
"poster":albumimage,
}
li=xbmcgui.ListItem(album+" - "+result["name"], iconImage=albumimage, thumbnailImage=albumimage)
li.setInfo("audio",audio["info"])
li.setArt(audio["art"])
ump.art=audio["art"]
ump.info=audio["info"]
u=ump.link_to("urlselect")
xbmcplugin.addDirectoryItem(ump.handle,u,li,True)


xbmcplugin.endOfDirectory(ump.handle,cacheToDisc=cacheToDisc)
Loading

0 comments on commit 76f341a

Please sign in to comment.