diff options
Diffstat (limited to 'plugin.video.crackle/resources')
-rw-r--r-- | plugin.video.crackle/resources/language/resource.language.en_gb/strings.po | 38 | ||||
-rw-r--r-- | plugin.video.crackle/resources/lib/globals.py | 91 | ||||
-rw-r--r-- | plugin.video.crackle/resources/settings.xml | 5 |
3 files changed, 48 insertions, 86 deletions
diff --git a/plugin.video.crackle/resources/language/resource.language.en_gb/strings.po b/plugin.video.crackle/resources/language/resource.language.en_gb/strings.po index 894481f..f9cd354 100644 --- a/plugin.video.crackle/resources/language/resource.language.en_gb/strings.po +++ b/plugin.video.crackle/resources/language/resource.language.en_gb/strings.po @@ -1,6 +1,6 @@ # Kodi Media Center language file -# Addon Name: Simpsons World -# Addon id: plugin.video.simpsonsworld +# Addon Name: Crackle +# Addon id: plugin.video.crackle # Addon Provider: eracknaphobia msgid "" msgstr "" @@ -17,37 +17,5 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" msgctxt "#30000" -msgid "The Simpsons" +msgid "Crackle" msgstr "" - -msgctxt "#30001" -msgid "General" -msgstr "" - -msgctxt "#30002" -msgid "Comedy" -msgstr "" - -msgctxt "#30010" -msgid "Screen Ratio" -msgstr "" - -msgctxt "#30020" -msgid "Audio Commentary" -msgstr "" - -msgctxt "#30900" -msgid "Deauthorizie Device" -msgstr "" - -msgctxt "#30901" -msgid "This device has been succesfully deauthorized." -msgstr "" - -msgctxt "#30910" -msgid "Your device is not currently authorized to view the selected content.\n Would you like to authorize this device now?" -msgstr "" - -msgctxt "#30911" -msgid "Device Not Authorized" -msgstr ""
\ No newline at end of file diff --git a/plugin.video.crackle/resources/lib/globals.py b/plugin.video.crackle/resources/lib/globals.py index db70140..d9bc030 100644 --- a/plugin.video.crackle/resources/lib/globals.py +++ b/plugin.video.crackle/resources/lib/globals.py @@ -12,39 +12,39 @@ FANART = ROOTDIR+"/resources/media/fanart.jpg" ICON = os.path.join(ROOTDIR,"/resources/media/icon.png") -#Addon Settings +#Addon Settings LOCAL_STRING = ADDON.getLocalizedString UA_CRACKLE = 'Crackle/7.60 CFNetwork/808.3 Darwin/16.3.0' UA_WEB = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36' UA_ANDROID = 'Android 4.1.1; E270BSA; Crackle 4.4.5.0' -PRIVATE_KEY = 'MIRNPSEZYDAQASLX' +PRIVATE_KEY = 'MIRNPSEZYDAQASLX' VENDOR_ID = '25' BASE_URL = 'http://android-tv-api-us.crackle.com/Service.svc' -def mainMenu(): +def mainMenu(): addDir('Movies','/movies',101,ICON) addDir('TV','/tv',100,ICON) -def listMovies(): +def listMovies(): url = '/browse/movies/full/all/alpha-asc/US' url += '?pageSize=500' url += '&pageNumber=1' url += '&format=json' json_source = jsonRequest(url) - - for movie in json_source['Entries']: + + for movie in json_source['Entries']: title = movie['Title'] url = str(movie['ID']) icon = movie['ChannelArtTileLarge'] fanart = movie['Images']['Img_1920x1080'] info = None info = {'plot':movie['Description'], - 'genre':movie['Genre'], - 'year':movie['ReleaseYear'], - 'mpaa':movie['Rating'], + 'genre':movie['Genre'], + 'year':movie['ReleaseYear'], + 'mpaa':movie['Rating'], 'title':title, 'originaltitle':title, 'duration':movie['DurationInSeconds'] @@ -54,34 +54,34 @@ def listMovies(): -def listShows(): +def listShows(): url = '/browse/shows/full/all/alpha-asc/US' url += '?pageSize=500' url += '&pageNumber=1' url += '&format=json' json_source = jsonRequest(url) - for show in json_source['Entries']: + for show in json_source['Entries']: title = show['Title'] url = str(show['ID']) icon = show['ChannelArtTileLarge'] fanart = show['Images']['Img_1920x1080'] info = None info = {'plot':show['Description'], - 'genre':show['Genre'], - 'year':show['ReleaseYear'], - 'mpaa':show['Rating'], + 'genre':show['Genre'], + 'year':show['ReleaseYear'], + 'mpaa':show['Rating'], 'title':title, 'originaltitle':title, 'duration':show['DurationInSeconds'] } - + addDir(title,url,102,icon,fanart,info) -def getEpisodes(channel): +def getEpisodes(channel): url = '/channel/'+channel+'/playlists/all/US?format=json' - json_source = jsonRequest(url) + json_source = jsonRequest(url) for episode in json_source['Playlists'][0]['Items']: episode = episode['MediaInfo'] @@ -91,9 +91,9 @@ def getEpisodes(channel): fanart = episode['Images']['Img_1920x1080'] info = None info = {'plot':episode['Description'], - #'genre':episode['Genre'], - 'year':episode['ReleaseYear'], - 'mpaa':episode['Rating'], + #'genre':episode['Genre'], + 'year':episode['ReleaseYear'], + 'mpaa':episode['Rating'], 'title':title, 'originaltitle':title, 'duration':episode['Duration'], @@ -101,21 +101,21 @@ def getEpisodes(channel): 'episode':episode['Episode'] } - addStream(title,id,'tvshows',icon,fanart,info) + addStream(title,id,'tvshows',icon,fanart,info) -def getMovieID(channel): +def getMovieID(channel): url = '/channel/'+str(channel)+'/playlists/all/US?format=json' json_source = jsonRequest(url) return str(json_source['Playlists'][0]['Items'][0]['MediaInfo']['Id']) -def getStream(id): +def getStream(id): url = '/details/media/'+id+'/US?format=json' json_source = jsonRequest(url) - + for stream in json_source['MediaURLs']: if 'AppleTV' in stream['Type']: stream_url = stream['Path'] @@ -125,30 +125,29 @@ def getStream(id): stream_url += '|User-Agent='+UA_CRACKLE listitem = xbmcgui.ListItem(path=stream_url) xbmcplugin.setResolvedUrl(addon_handle, True, listitem) - -def jsonRequest(url): + +def jsonRequest(url): url = BASE_URL + url req = urllib2.Request(url) - req.add_header("Connection", "keep-alive") - req.add_header("User-Agent", UA_ANDROID) + req.add_header("Connection", "keep-alive") + req.add_header("User-Agent", UA_ANDROID) req.add_header("Authorization", getAuth(url)) - - response = urllib2.urlopen(req) - json_source = json.load(response) - response.close() + + response = urllib2.urlopen(req) + json_source = json.load(response) + response.close() return json_source -def calcHmac(src): +def calcHmac(src): return hmac.new(PRIVATE_KEY, src, hashlib.md5).hexdigest() -def getAuth(url): +def getAuth(url): timestamp = datetime.utcnow().strftime('%Y%m%d%H%M') encoded_url = str(calcHmac(url+"|"+timestamp)).upper() + "|" + timestamp + "|" + VENDOR_ID - xbmc.log(encoded_url) return encoded_url @@ -157,25 +156,25 @@ def addStream(name, id, stream_type, icon,fanart,info=None): ok=True u=sys.argv[0]+"?id="+urllib.quote_plus(id)+"&mode="+str(103)+"&type="+urllib.quote_plus(stream_type) liz=xbmcgui.ListItem(name) - liz.setArt({'icon': ICON, 'thumb': icon, 'fanart': fanart}) + liz.setArt({'icon': ICON, 'thumb': icon, 'fanart': fanart}) liz.setProperty("IsPlayable", "true") liz.setInfo( type="Video", infoLabels={ "Title": name } ) if info != None: - liz.setInfo( type="Video", infoLabels=info) + liz.setInfo( type="Video", infoLabels=info) ok=xbmcplugin.addDirectoryItem(handle=addon_handle,url=u,listitem=liz,isFolder=False) - xbmcplugin.setContent(addon_handle, stream_type) + xbmcplugin.setContent(addon_handle, stream_type) return ok -def addDir(name,id,mode,iconimage,fanart=None,info=None): - params = get_params() - ok=True +def addDir(name,id,mode,iconimage,fanart=None,info=None): + params = get_params() + ok=True u=sys.argv[0]+"?id="+urllib.quote_plus(id)+"&mode="+str(mode) liz=xbmcgui.ListItem(name) - liz.setArt({'icon': ICON, 'thumb': iconimage, 'fanart': fanart}) + liz.setArt({'icon': ICON, 'thumb': iconimage, 'fanart': fanart}) if info != None: - liz.setInfo( type="Video", infoLabels=info) - ok=xbmcplugin.addDirectoryItem(handle=addon_handle,url=u,listitem=liz,isFolder=True) + liz.setInfo( type="Video", infoLabels=info) + ok=xbmcplugin.addDirectoryItem(handle=addon_handle,url=u,listitem=liz,isFolder=True) xbmcplugin.setContent(addon_handle, 'tvshows') return ok @@ -195,5 +194,5 @@ def get_params(): splitparams=pairsofparams[i].split('=') if (len(splitparams))==2: param[splitparams[0]]=splitparams[1] - - return param
\ No newline at end of file + + return param diff --git a/plugin.video.crackle/resources/settings.xml b/plugin.video.crackle/resources/settings.xml index cf86ce6..0da8c36 100644 --- a/plugin.video.crackle/resources/settings.xml +++ b/plugin.video.crackle/resources/settings.xml @@ -1,9 +1,4 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <settings> <!-- General --> - <category label="30001"> - <setting id="ratio" type="labelenum" label="30010" lvalues="16x9|4x3" default="16x9" /> - <setting id="commentary" type="bool" label="30020" default="false" /> - <setting id="deauthorize" type="action" label="30900" action="RunPlugin(plugin://plugin.video.simpsonsworld/?url=junk&mode=999)" option="close" /> - </category> </settings> |