Beispiel #1
0
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.name = kwargs.get('name', 'radiotimeStore')
        self.refresh = int(kwargs.get('refresh', 60)) * 60

        self.browse_url = self.config.get('browse_url', OPML_BROWSE_URL)
        self.partner_id = self.config.get('partner_id', 'TMe3Cn6v')
        self.username = self.config.get('username', None)
        self.locale = self.config.get('locale', 'en')
        self.serial = server.uuid if server else 'n/a'

        # construct URL for root menu
        if self.username is not None:
            identification_param = f'username={self.username}'
        else:
            identification_param = f'serial={self.serial}'
        formats_value = DEFAULT_FORMAT
        root_url = \
            f'{self.browse_url}?partnerId={self.partner_id}&' \
            f'{identification_param}&formats={formats_value}&' \
            f'locale={self.locale}'

        # set root item
        root_item = LazyContainer(None,
                                  'root',
                                  'root',
                                  self.refresh,
                                  self.retrieveItemsForOPML,
                                  url=root_url)
        self.set_root_item(root_item)

        self.init_completed()
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.name = kwargs.get('name', 'radiotimeStore')
        self.refresh = int(kwargs.get('refresh', 60)) * 60

        self.browse_url = self.config.get('browse_url', OPML_BROWSE_URL)
        self.partner_id = self.config.get('partner_id', 'TMe3Cn6v')
        self.username = self.config.get('username', None)
        self.locale = self.config.get('locale', 'en')
        self.serial = server.uuid

        # construct URL for root menu
        if self.username is not None:
            identification_param = "username=%s" % self.username
        else:
            identification_param = "serial=%s" % self.serial
        formats_value = DEFAULT_FORMAT
        root_url = "%s?partnerId=%s&%s&formats=%s&locale=%s" % (self.browse_url, self.partner_id, identification_param, formats_value, self.locale)

        # set root item
        root_item = LazyContainer(None, "root", "root", self.refresh, self.retrieveItemsForOPML, url = root_url)
        self.set_root_item(root_item)

        self.init_completed()
Beispiel #3
0
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.name = kwargs.get('name', 'iRadioStore')
        self.refresh = int(kwargs.get('refresh', 60)) * 60

        self.shoutcast_ws_url = self.config.get(
            'genrelist',
            SC_URL_GENRE_LIST.format(api_url=SC_API_URL, key=SC_KEY),
        )

        # set root item
        root_item = Container(None, self.name)
        self.set_root_item(root_item)

        # set root-level genre family containers and populate the genre_
        # parent_items dict from the family hierarchy information
        for family, genres in list(genre_families.items()):
            family_item = self.append_genre(root_item, family)
            if family_item is not None:
                self.genre_parent_items[family] = root_item
                for genre in genres:
                    self.genre_parent_items[genre] = family_item

        # retrieve asynchronously the list of genres from
        # the souhtcast server genres not already attached to
        # a family will be attached to the 'Misc' family
        self.retrieveGenreList_attemptCount = 0
        deferredRoot = self.retrieveGenreList()
Beispiel #4
0
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self,server,**kwargs)
 
        self.name = kwargs.get('name','iRadioStore')
        self.refresh = int(kwargs.get('refresh',60))*60

        self.shoutcast_ws_url = self.config.get('genrelist',SHOUTCAST_WS_URL)
        
        # set root item
        root_item = Container(None, self.name)
        self.set_root_item(root_item)

        # set root-level genre family containers
        # and populate the genre_parent_items dict from the family hierarchy information
        for family, genres in genre_families.items():
            family_item = self.append_genre(root_item, family)           
            if family_item is not None:
                self.genre_parent_items[family] = root_item
                for genre in genres:
                    self.genre_parent_items[genre] = family_item
        
        # retrieve asynchronously the list of genres from the souhtcast server
        # genres not already attached to a family will be attached to the "Misc" family           
        self.retrieveGenreList_attemptCount = 0
        deferredRoot = self.retrieveGenreList()
Beispiel #5
0
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.name = kwargs.get('name', 'Picasa Web Albums')

        self.refresh = int(kwargs.get('refresh', 60)) * 60

        self.login = kwargs.get('userid', kwargs.get('login', ''))
        self.password = kwargs.get('password', '')

        rootContainer = Container(None, self.name)
        self.set_root_item(rootContainer)

        self.AlbumsContainer = LazyContainer(rootContainer, 'My Albums', None,
                                             self.refresh, self.retrieveAlbums)
        rootContainer.add_child(self.AlbumsContainer)

        self.FeaturedContainer = LazyContainer(
            rootContainer,
            'Featured photos',
            None,
            self.refresh,
            self.retrieveFeaturedPhotos,
        )
        rootContainer.add_child(self.FeaturedContainer)

        self.init_completed()
Beispiel #6
0
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.playlist_url = self.config.get('playlist_url', 'http://mafreebox.freebox.fr/freeboxtv/playlist.m3u')
        self.name = self.config.get('name', 'playlist')

        self.init_completed()
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.name = kwargs.get('name', 'radiotimeStore')
        self.refresh = int(kwargs.get('refresh', 60)) * 60

        self.browse_url = self.config.get('browse_url', OPML_BROWSE_URL)
        self.partner_id = self.config.get('partner_id', 'TMe3Cn6v')
        self.username = self.config.get('username', None)
        self.locale = self.config.get('locale', 'en')
        self.serial = server.uuid

        # construct URL for root menu
        if self.username is not None:
            identification_param = "username=%s" % self.username
        else:
            identification_param = "serial=%s" % self.serial
        formats_value = DEFAULT_FORMAT
        root_url = "%s?partnerId=%s&%s&formats=%s&locale=%s" % (
            self.browse_url, self.partner_id, identification_param,
            formats_value, self.locale)

        # set root item
        root_item = LazyContainer(None,
                                  "root",
                                  "root",
                                  self.refresh,
                                  self.retrieveItemsForOPML,
                                  url=root_url)
        self.set_root_item(root_item)

        self.init_completed()
Beispiel #8
0
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.name = 'audio CD'
        self.device_name = kwargs.get('device_name', "/dev/cdom")

        threads.deferToThread(self.extractAudioCdInfo)
Beispiel #9
0
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.playlist_url = self.config.get('playlist_url', 'http://mafreebox.freebox.fr/freeboxtv/playlist.m3u')
        self.name = self.config.get('name', 'playlist')

        self.init_completed()
Beispiel #10
0
  def __init__(self, server, **kwargs):
    AbstractBackendStore.__init__(self, server, **kwargs)

    self.name = self.config.get('name', 'twitch.tv')
    self.uuid = self.config.get('uuid', 'twitch_tv')
    self.access_token = self.config.get('access_token')

    self.init_completed()
Beispiel #11
0
  def __init__(self, server, **kwargs):
    AbstractBackendStore.__init__(self, server, **kwargs)

    self.name = self.config.get('name', 'twitch.tv')
    self.uuid = self.config.get('uuid', 'twitch_tv')
    self.access_token = self.config.get('access_token')

    self.init_completed()
	def __init__(self, server, *args, **kwargs):
		AbstractBackendStore.__init__(self, server, **kwargs)

		self.name = kwargs.get('name','Dreambox (TV)')
		# streaminghost is the ip address of the dreambox machine, defaults to localhost
		self.streaminghost = kwargs.get('streaminghost', self.server.coherence.hostname)

		self.refresh = float(kwargs.get('refresh', 1)) * 60
		self.init_root()
		self.init_completed()
Beispiel #13
0
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.name = kwargs.get('name', 'YAMJ')
        self.yamj_url = kwargs.get('yamj_url', 'http://localhost/yamj')
        self.jukebox_url = self.yamj_url + '/Jukebox/'
        self.refresh = int(kwargs.get('refresh', 60)) * 60

        self.nbMoviesPerFile = None

        rootItem = Container(None, self.name)
        self.set_root_item(rootItem)

        d = self.retrieveCategories(rootItem)
Beispiel #14
0
	def __init__(self, server, *args, **kwargs):
		AbstractBackendStore.__init__(self, server, **kwargs)
		self._db = eMediaDatabase.getInstance()

		self.next_id = 1000
		self.name = kwargs.get('name', 'Dreambox Mediaserver')
		# streaminghost is the ip address of the dreambox machine, defaults to localhost
		self.streaminghost = kwargs.get('streaminghost', self.server.coherence.hostname)

		self.refresh = float(kwargs.get('refresh', 1)) * 60
		self.init_root()
		self.init_completed()

		self._cover_root = None
Beispiel #15
0
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.name = kwargs.get('name', 'YAMJ')
        self.yamj_url = kwargs.get('yamj_url', "http://localhost/yamj")
        self.jukebox_url = self.yamj_url + "/Jukebox/"
        self.refresh = int(kwargs.get('refresh', 60)) * 60

        self.nbMoviesPerFile = None

        rootItem = Container(None, self.name)
        self.set_root_item(rootItem)

        d = self.retrieveCategories(rootItem)
Beispiel #16
0
    def __init__(self, server, *args, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)
        self._db = eMediaDatabase.getInstance()

        self.next_id = 1000
        self.name = kwargs.get('name', 'Dreambox Mediaserver')
        # streaminghost is the ip address of the dreambox machine, defaults to localhost
        self.streaminghost = kwargs.get('streaminghost',
                                        self.server.coherence.hostname)

        self.refresh = float(kwargs.get('refresh', 1)) * 60
        self.init_root()
        self.init_completed()

        self._cover_root = None
Beispiel #17
0
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.name = kwargs.get('name', 'Picasa Web Albums')

        self.refresh = int(kwargs.get('refresh', 60)) * 60

        self.login = kwargs.get('userid', kwargs.get('login', ''))
        self.password = kwargs.get('password', '')

        rootContainer = Container(None, self.name)
        self.set_root_item(rootContainer)

        self.AlbumsContainer = LazyContainer(rootContainer, 'My Albums', None, self.refresh, self.retrieveAlbums)
        rootContainer.add_child(self.AlbumsContainer)

        self.FeaturedContainer = LazyContainer(rootContainer, 'Featured photos', None, self.refresh, self.retrieveFeaturedPhotos)
        rootContainer.add_child(self.FeaturedContainer)

        self.init_completed()
Beispiel #18
0
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.name = kwargs.get('name', 'MiroGuide')

        self.language = kwargs.get('language', 'English')

        self.refresh = int(kwargs.get('refresh', 60)) * 60

        self.proxy_mode = kwargs.get('proxy_mode', 'redirect')
        self.cache_directory = kwargs.get('cache_directory', '/tmp/coherence-cache')
        try:
            if self.proxy_mode != 'redirect':
                os.mkdir(self.cache_directory)
        except:
            pass
        self.cache_maxsize = kwargs.get('cache_maxsize', 100000000)
        self.buffer_size = kwargs.get('buffer_size', 750000)

        rootItem = Container(None, self.name)
        self.set_root_item(rootItem)

        categoriesItem = Container(rootItem, "All by Categories")
        rootItem.add_child(categoriesItem)
        languagesItem = Container(rootItem, "All by Languages")
        rootItem.add_child(languagesItem)

        self.appendLanguage("Recent Videos", self.language, rootItem, sort='-age', count=15)
        self.appendLanguage("Top Rated", self.language, rootItem, sort='rating', count=15)
        self.appendLanguage("Most Popular", self.language, rootItem, sort='-popular', count=15)

        def gotError(error):
            print("ERROR: %s" % error)

        def gotCategories(result):
            if result is None:
                print("Unable to retrieve list of categories")
                return
            data, header = result
            categories = eval(data)  # FIXME add some checks to avoid code injection
            for category in categories:
                name = category['name'].encode('ascii', 'strict')
                category_url = category['url'].encode('ascii', 'strict')
                self.appendCategory(name, name, categoriesItem)

        categories_url = "https://www.miroguide.com/api/list_categories"
        d1 = utils.getPage(categories_url)
        d1.addCallbacks(gotCategories, gotError)

        def gotLanguages(result):
            if result is None:
                print("Unable to retrieve list of languages")
                return
            data, header = result
            languages = eval(data)  # FIXME add some checks to avoid code injection
            for language in languages:
                name = language['name'].encode('ascii', 'strict')
                language_url = language['url'].encode('ascii', 'strict')
                self.appendLanguage(name, name, languagesItem)

        languages_url = "https://www.miroguide.com/api/list_languages"
        d2 = utils.getPage(languages_url)
        d2.addCallbacks(gotLanguages, gotError)

        self.init_completed()
Beispiel #19
0
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.name = kwargs.get('name', 'MiroGuide')

        self.language = kwargs.get('language', 'English')

        self.refresh = int(kwargs.get('refresh', 60)) * 60

        self.proxy_mode = kwargs.get('proxy_mode', 'redirect')
        self.cache_directory = kwargs.get('cache_directory', '/tmp/coherence-cache')
        try:
            if self.proxy_mode != 'redirect':
                os.mkdir(self.cache_directory)
        except:
            pass
        self.cache_maxsize = kwargs.get('cache_maxsize', 100000000)
        self.buffer_size = kwargs.get('buffer_size', 750000)

        rootItem = Container(None, self.name)
        self.set_root_item(rootItem)

        categoriesItem = Container(rootItem, "All by Categories")
        rootItem.add_child(categoriesItem)
        languagesItem = Container(rootItem, "All by Languages")
        rootItem.add_child(languagesItem)

        self.appendLanguage("Recent Videos", self.language, rootItem, sort='-age', count=15)
        self.appendLanguage("Top Rated", self.language, rootItem, sort='rating', count=15)
        self.appendLanguage("Most Popular", self.language, rootItem, sort='-popular', count=15)

        def gotError(error):
            print "ERROR: %s" % error

        def gotCategories(result):
            if result is None:
                print "Unable to retrieve list of categories"
                return
            data, header = result
            categories = eval(data)  # FIXME add some checks to avoid code injection
            for category in categories:
                name = category['name'].encode('ascii', 'strict')
                category_url = category['url'].encode('ascii', 'strict')
                self.appendCategory(name, name, categoriesItem)

        categories_url = "https://www.miroguide.com/api/list_categories"
        d1 = utils.getPage(categories_url)
        d1.addCallbacks(gotCategories, gotError)

        def gotLanguages(result):
            if result is None:
                print "Unable to retrieve list of languages"
                return
            data, header = result
            languages = eval(data)  # FIXME add some checks to avoid code injection
            for language in languages:
                name = language['name'].encode('ascii', 'strict')
                language_url = language['url'].encode('ascii', 'strict')
                self.appendLanguage(name, name, languagesItem)

        languages_url = "https://www.miroguide.com/api/list_languages"
        d2 = utils.getPage(languages_url)
        d2.addCallbacks(gotLanguages, gotError)

        self.init_completed()
Beispiel #20
0
 def __init__(self, server, **kwargs):
     AbstractBackendStore.__init__(self, server, **kwargs)
     self.name = "Mbira"
     threads.deferToThread(self.init_data)
Beispiel #21
0
 def __init__(self, server, **kwargs):
     AbstractBackendStore.__init__(self, server, **kwargs)
     self.name = 'Mbira'
     threads.deferToThread(self.init_data)
Beispiel #22
0
    def __init__(self, server, **kwargs):
        AbstractBackendStore.__init__(self, server, **kwargs)

        self.init_completed()