zdravím, mám program , který mi spouští IPTV přes omxplayer do raspberry pi.
problém je v tom , že když vyberu jednu stanici , zapnou se mi vžechny najednou...
zkoušel jsem místo if dát elif ale pak mi to hlásí chybu.
prosím o radu , předem děkuji :)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import time
import subprocess
from subprocess import Popen
from time import sleep
#Televizni stanice
barrandov= 'rtsp://otv-enc1.inext.cz:1935/barrandov/iptv'
barrandovplus= 'rtsp://otv-enc1.inext.cz:1935/barrandov_plus/iptv'
ct1= 'rtsp://otv-enc1.inext.cz:1935/ct1/iptv'
ct2= 'rtsp://otv-enc1.inext.cz:1935/ct2/iptv'
ct24= 'rtsp://otv-enc1.inext.cz:1935/ct24/iptv'
ctd= 'rtsp://otv-enc1.inext.cz:1935/ct_d_art/iptv'
ctsport= 'rtsp://otv-enc1.inext.cz:1935/ct4_sport/iptv'
doma= 'rtsp://otv-enc1.inext.cz:1935/doma/iptv'
jojplus= 'rtsp://otv-enc1.inext.cz:1935/joj_plus/iptv'
kinobarrandov= 'rtsp://otv-enc1.inext.cz:1935/kino_barrandov/iptv'
markiza= 'rtsp://otv-enc1.inext.cz:1935/markiza/iptv'
ocko= 'rtsp://otv-enc1.inext.cz:1935/ocko/iptv'
ockogold= 'rtsp://otv-enc1.inext.cz:1935/ockogold/iptv'
prima= 'rtsp://otv-enc1.inext.cz:1935/prima/iptv'
primacool= 'rtsp://otv-enc1.inext.cz:1935/prima_cool/iptv'
primalove= 'rtsp://otv-enc1.inext.cz:1935/prima_love/iptv'
slagrtv= 'rtsp://otv-enc1.inext.cz:1935/slagr_tv/iptv'
stv1= 'rtsp://otv-enc1.inext.cz:1935/stv1/iptv'
stv2= 'rtsp://otv-enc1.inext.cz:1935/stv2/iptv'
ta3= 'rtsp://otv-enc1.inext.cz:1935/ta3/iptv'
tvjoj = 'rtsp://otv-enc1.inext.cz:1935/joj/iptv'
tvnoe = 'rtsp://otv-enc1.inext.cz:1935/noe/iptv'
#Radia
evropa2 = 'http://icecast3.play.cz/evropa2-128.mp3'
frekvence1 = 'http://icecast3.play.cz/frekvence1-128.mp3'
from subprocess import Popen
print("Televizni stanice:")
print("1.BARRANDOV")
print("2.BARRANDOV PLUS")
print("3.CT1")
print("4.CT2")
print("5.CT24")
print("6.CT DECKO/ART")
print("7.CT SPORT")
print("8.DOMA")
print("9.JOJ PLUS")
print("10.KINO BARRANDOV")
print("11.MARKIZA")
print("12.OCKO")
print("13.OCKO GOLD")
print("14.PRIMA")
print("15.PRIMA COOL")
print("16.PRIMA LOVE")
print("17.SLAGR TV")
print("18.STV1")
print("19.STV2")
print("20.ta3")
print("21.TV JOJ")
print("22.TV NOE")
print("-----------------------------")
print("Radia:")
print("23.EVROPA 2")
print("24.FREKVENCE 1")
print("-----------------------------")
volba = input("Vyberte stanici [1-24] :")
if volba == 666:
print("Tajna myskaVec!")
if volba == 1:
print("Spoustim BARRANDOV")
omxp = Popen(['omxplayer',barrandov])
if volba == 2:
print("Spoustim BARRANDOV PLUS")
omxp = Popen(['omxplayer',barrandovplus])
if volba == 3:
print("Spoustim CT1")
omxp = Popen(['omxplayer',ct1])
if volba == 4:
print("Spoustim CT2")
omxp = Popen(['omxplayer',ct2])
if volba == 5:
print("Spoustim CT24")
omxp = Popen(['omxplayer',ct24])
if volba == 6:
print("Spoustim CT DECKO/ART")
omxp = Popen(['omxplayer',ctd])
if volba == 7:
print("Spoustim CT SPORT")
omxp = Popen(['omxplayer',ctsport])
if volba == 8:
print("Spoustim DOMA")
omxp = Popen(['omxplayer',doma])
if volba == 9:
print("Spoustim JOJ PLUS")
omxp = Popen(['omxplayer',jojplus])
if volba == 10:
print("Spoustim KINO BARRANDOV")
omxp = Popen(['omxplayer',kinobarrandov])
if volba == 11:
print("Spoustim MARKIZA")
omxp = Popen(['omxplayer',markiza])
if volba == 12:
print("Spoustim OCKO")
omxp = Popen(['omxplayer',ocko])
if volba == 13:
print("Spoustim OCKO GOLD")
omxp = Popen(['omxplayer',ockogold])
if volba == 14:
print("Spoustim PRIMA")
omxp = Popen(['omxplayer',prima])
if volba == 15:
print("Spoustim PRIMA COOL")
omxp = Popen(['omxplayer',primacool])
if volba == 16:
print("Spoustim PRIMA LOVE")
omxp = Popen(['omxplayer',primalove])
if volba == 17:
print("Spoustim SLAGR TV")
omxp = Popen(['omxplayer',slagrtv])
if volba == 18:
print("Spoustim STV1")
omxp = Popen(['omxplayer',stv1])
if volba == 19:
print("Spoustim STV2")
omxp = Popen(['omxplayer',stv2])
if volba == 20:
print("Spoustim TA3")
omxp = Popen(['omxplayer',ta3])
if volba == 21:
print("Spoustim TV JOJ")
omxp = Popen(['omxplayer',tvjoj])
if volba == 22:
print("Spoustim TV NOE")
omxp = Popen(['omxplayer',tvnoe])
if volba == 23:
print("Spoustim EVROPA 2")
omxp = Popen(['omxplayer',evropa2])
if volba == 23:
print("Spoustim FREKVENCE 1")
omxp = Popen(['omxplayer',frekvence1])
#input ("Stisknete ENTER pro exit")