Created
September 24, 2012 14:10
-
-
Save jk0/3776136 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@route("/video/amazoninstantvideo/getvideoobject") | |
def GetVideoObject(url, video_type, title=None, summary=None, thumb_url=None): | |
thumb = Resource.ContentsOfURLWithFallback(url=thumb_url, fallback=PLUGIN_ICON_DEFAULT) | |
if video_type == "episode": | |
return EpisodeObject(key=Callback(VideoDetails, url), rating_key=url, items=video_items(url), title=title, summary=summary, thumb=thumb) | |
else: | |
return MovieObject(key=Callback(VideoDetails, url), rating_key=url, items=video_items(url), title=title, summary=summary, thumb=thumb) | |
@route("/video/amazoninstantvideo/videodetails") | |
def VideoDetails(url): | |
oc = ObjectContainer() | |
oc.add(VideoClipObject(key=Callback(VideoDetails, url=url), rating_key=url, items=video_items(url))) | |
return oc | |
def video_items(url): | |
return [ | |
MediaObject( | |
parts=[ | |
PartObject(key=Callback(PlayVideo, url=url)) | |
] | |
) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment