I've developed a little python script to replay the last France24 news, it works but I've got 1 question : is there a way to specify with xbmc.Player the parameter for aspect ratio and zoom?
I've set on "cut the black lines" but strangely it doesn't work well...
is there a way to specify these parameters before launching the video url?
Also I'm not sure how I can test if an url is valid...
Code: Select all
import time
import xbmc, xbmcgui
from datetime import datetime, timedelta
from xbmc import log
now = datetime.now()
t = now
currentMin= int(t.strftime ('%M'))
if currentMin < 20:
t = now - timedelta(hours=1)
currentMin = "30"
URLFallBackMin = "00"
else:
if currentMin < 50:
currentMin ="00"
URLFallBackMin = "30"
else:
currentMin = "30"
URLFallBackMin = "00"
# some vars
Year = str(t.strftime ('%y'))
Month= str(t.strftime ('%m'))
Day = str(t.strftime ('%d'))
currentHour= str(t.strftime ('%H'))
if len(Day)<2:
Day="0"+Day
URL="http://medias.france24.com/fr/vod/jt/FRAN" + Year + Month + Day + "-" + currentHour + currentMin + "-Live.flv"
URLFallBack = "http://medias.france24.com/fr/vod/jt/FRAN" + Year + Month + Day + "-" + currentHour + URLFallBackMin + "-Live.flv"
listitem = xbmcgui.ListItem('France 24')
listitem.setInfo('video', {'Title': 'France 24 dernier JT', 'Genre': 'News'})
try:
# xbmc.log ( 'TRYING URL : ' + url , xbmc.LOGDEBUG)
xbmc.Player( xbmc.PLAYER_CORE_MPLAYER ).play( URL, listitem )
except:
# xbmc.log ( 'TRYING URL : ' + URLFallBack , xbmc.LOGDEBUG)
xbmc.Player( xbmc.PLAYER_CORE_MPLAYER ).play( URLFallBack, listitem )
pass