coherence.backends.ted_storage (module) — Cohen3 0.8.0 documentation

# coherence.backends.ted_storage (module)

## TEDStore

Another simple rss based Media Server, this time for TED.com content.

Example to run from python script:

    from coherence.base import Coherence
    from twisted.internet import reactor

    coherence = Coherence(
        {'logmode': 'info',
         'plugin': {'backend': 'TEDStore',
                    'name': 'Cohen3 TEDStore'
                    },
         }
    )
    reactor.run()

Example to run from console:

    cohen3 --plugin=backend:TEDStore

Note

you need the cohen 3 package installed to run the plugin from a console.

Changed in version 0.8.3.

class `TedTalk`(parent_id, item_id, urlbase, **kwargs)

  Bases: `coherence.backends.models.items.BackendVideoItem`

  The Backend Item.

  Changed in version 0.8.3: Refactored using the class `BackendVideoItem`

  `mimetype` = 'video/mp4'

class `TEDStore`(server, *args, **kwargs)

  Bases: `coherence.backends.models.stores.BackendVideoStore`

  The Backend Store.

  Changed in version 0.8.3: Refactored using the class `BackendVideoStore`

  `logCategory` = 'ted_store'
  `implements` = ['MediaServer']
  `name` = 'TEDTalks'
  `upnp_protocols` = ['http-get:*:video/quicktime:*', 'http-get:*:video/mp4:*']
  `root_url` = b'http://feeds.feedburner.com/tedtalks_video?format=xml'
  `root_find_items` = './channel/item'
  `root_id` = 0
  `item_cls`

    alias of `TedTalk`

  `item_type` = 'http-get:*:video/mp4:*'
  `last_updated` = None
  `parse_data`(root)

    Iterate over all items found inside the provided tree and parse each one of them.

  `parse_item`(item)

    Convenient method to extract data from an item.

    Warning

    this method must be sub classed and must return a dictionary which should hold the data that you want to be set for your items.