Esempio n. 1
0
__author__ = "bison"

print("FOO")
import souper

soup = souper.souperDuper("bison")
soupNext = soup.grabPart()
soupNext.__next__()
exit()

import pychromecast
from pychromecast.controllers.youtube import YouTubeController
from pychromecast.controllers.media import MediaController
import time

myIp = "172.22.27.204"  #'172.22.27.48'

print("start discovery")
allCastNames = pychromecast.get_chromecasts_as_dict().keys()
allCasts = {}
video = "C_XyuvPE9t4"
print("end discovery")

castIndex = {}
for castName in allCastNames:
    cast = pychromecast.get_chromecast(friendly_name=castName)
    allCasts[castName] = cast
    castIndex[castName] = len(castIndex)

for castName, cast in allCasts.items():
    # cast.quit_app()
Esempio n. 2
0
if conf.closeCurrentApp:
    for castName, cast in allCasts.items():
        cast.quit_app()

print(castIndex)

onlyfiles = []

soup = None
soupNext = None
if conf.imageSource == 'local':
    onlyfiles = [ f for f in os.listdir(conf.pathWithImages) if os.path.isfile(os.path.join(conf.pathWithImages,f)) ]
elif conf.imageSource == 'soup':
    import souper
    soup = souper.souperDuper(conf.soup)
    soupNext = soup.grabPart()

while True:
    if soupNext != None:
        soupNext.__next__()
        onlyfiles = list(soup.knownUrls.keys())

    from os import listdir
    from os.path import isfile, join
    import random

    imgFile = random.choice(onlyfiles)
    for castName, cast in allCasts.items():
        if not castName in conf.blacklist:
            castMc = cast.media_controller