squid Wrote:dude - it seems to me like you're doing fine with python.... it's listing the files as before now.
having trouble with playing some of the files though - only some work on PS and nearly all of the ones on RedTube only last for 10 seconds... not sure if it's just bad karma though - will try again later.
It may be something to do with your cache settings. You need to be playing through MPlayer for it to use the cache. For some reason the DVD player does not seem to cache. Failing that try downloading the videos. I have put the download feature from PS into Redtube and also changed the default player to Mplayer. Should make it better for those of us, like me, who have a slow internet speed.
The code changes for Redtube (open chn_redtube.py in notepad) are:
Change
Code:
self.contextMenuEnabled = False
To
Code:
self.contextMenuEnabled = True
Then add the following code at the bottom
Code:
#==============================================================================
def DownloadEpisode(self, item):
#check if data is already present and if video or folder
if item.type == 'folder':
logFile.warning("Cannot download a folder")
elif item.type == 'video':
if item.complete == False:
logFile.info("Fetching MediaUrl for VideoItem")
item = self.UpdateVideoItem(item)
_destFilename = item.name + ".divx"
if item.mediaurl=="":
logFile.error("Cannot determine mediaurl")
return item
logFile.info("Going to download %s", _destFilename)
_downLoader = uriHandler.Download(item.mediaurl, _destFilename)
item.downloaded = True
return item
else:
logFile.warning('Error determining folder/video type of selected item');
def PlayVideoItem(self, item, player="mplayer"):
""" NOT USER EDITABLE
Accepts an item with or without MediaUrl and playback the item. If no
MediaUrl is present, one will be retrieved.
"""
logFile.info("Starting Video Playback using the %s", player)
try:
logFile.info('opening '+ item.mediaurl)
if player=="mplayer":
logFile.info("Playing using MPlayer")
xbmc.Player(xbmc.PLAYER_CORE_MPLAYER).play(item.mediaurl)
else:
xbmc.Player().play(item.mediaurl)
except:
dialog = xbmcgui.Dialog()
dialog.ok(config.appName,"Kan dit programma niet afspelen.")
logFile.critical("Could not playback the url", exc_info=True)
To change PS default player to Mplayer start at the line
Code:
def PlayVideoItem(self, item, player="dvdplayer"):
and change dvdplayer to mplayer all the way down keeping the same case.
May I just emphasise that none of the code is my own, it is rootyb's.