nv_python_libs::youtube::youtube_api Namespace Reference

Classes

class  OutStreamEncoder
class  XmlHandler
class  Videos

Functions

def detectUserLocationByIP
def massageDescription
def _initLogger
def textUtf8
def ampReplace
def setTreeViewIcon
def searchTitle
def searchForVideos
def getCategories
def displayTreeView
def processVideoUrl
def makeURL
def getVideos
def getVideosForURL

Variables

string __title__ = "youtube_api - Simple-to-use Python interface to the youtube API (http://developer.youtubenservices.com/docs)"
string __author__ = "R.D. Vaughan"
string __purpose__
string __version__ = "v0.2.5"
 tree_dir_icon
 channel
 tree_key

Function Documentation

def nv_python_libs::youtube::youtube_api::detectUserLocationByIP (   self  ) 
Get longitude and latitiude to find videos relative to your location. Up to three different
servers will be tried before giving up.
return a dictionary e.g.
{'Latitude': '43.6667', 'Country': 'Canada', 'Longitude': '-79.4167', 'City': 'Toronto'}
return an empty dictionary if there were any errors
Code found at: http://blog.suinova.com/2009/04/from-ip-to-geolocation-country-city.html

Definition at line 292 of file youtube_api.py.

def nv_python_libs::youtube::youtube_api::massageDescription (   self,
  text 
)
Removes HTML markup from a text string.
@param text The HTML source.
@return The plain text.  If the HTML source contains non-ASCII
entities or character references, this is a Unicode string.

Definition at line 352 of file youtube_api.py.

def nv_python_libs::youtube::youtube_api::_initLogger (   self  )  [private]
Setups a logger using the logging module, returns a log object

Definition at line 386 of file youtube_api.py.

def nv_python_libs::youtube::youtube_api::textUtf8 (   self,
  text 
)

Definition at line 405 of file youtube_api.py.

def nv_python_libs::youtube::youtube_api::ampReplace (   self,
  text 
)
Replace all "&" characters with "&"

Definition at line 417 of file youtube_api.py.

def nv_python_libs::youtube::youtube_api::setTreeViewIcon (   self,
  dir_icon = None 
)
Check if there is a specific generic tree view icon. If not default to the channel icon.
return self.tree_dir_icon

Definition at line 424 of file youtube_api.py.

def nv_python_libs::youtube::youtube_api::searchTitle (   self,
  title,
  pagenumber,
  pagelen 
)
Key word video search of the YouTube web site
return an array of matching item dictionaries
return

Definition at line 448 of file youtube_api.py.

def nv_python_libs::youtube::youtube_api::searchForVideos (   self,
  title,
  pagenumber 
)
Common name for a video search. Used to interface with MythTV plugin NetVision

Definition at line 573 of file youtube_api.py.

def nv_python_libs::youtube::youtube_api::getCategories (   self,
  dir_dict,
  categories 
)
Parse a dictionary made of subdictionaries and category list and extract all of the categories
return a list of categories

Definition at line 626 of file youtube_api.py.

def nv_python_libs::youtube::youtube_api::displayTreeView (   self  ) 
Gather the Youtube categories/feeds/...etc then get a max page of videos meta data in each of them
return array of directories and their video metadata

Definition at line 638 of file youtube_api.py.

def nv_python_libs::youtube::youtube_api::processVideoUrl (   self,
  item,
  elem 
)
Processes elem.get('url') to either use a custom HTML page served by
the backend, or include '&autoplay=1'

Definition at line 720 of file youtube_api.py.

def nv_python_libs::youtube::youtube_api::makeURL (   self,
  URL 
)
Form a URL to search for videos
return a URL

Definition at line 732 of file youtube_api.py.

def nv_python_libs::youtube::youtube_api::getVideos (   self,
  dir_dict,
  dictionaries 
)
Parse a list made of category lists and retrieve video meta data
return a dictionary of directory names and categories video metadata

Definition at line 758 of file youtube_api.py.

def nv_python_libs::youtube::youtube_api::getVideosForURL (   self,
  url,
  dictionaries 
)
Get the video metadata for url search
return the video dictionary of directories and their video mata data

Definition at line 792 of file youtube_api.py.


Variable Documentation

string nv_python_libs::youtube::youtube_api::__title__ = "youtube_api - Simple-to-use Python interface to the youtube API (http://developer.youtubenservices.com/docs)"

Definition at line 14 of file youtube_api.py.

Definition at line 15 of file youtube_api.py.

Initial value:
'''
This python script is intended to perform a variety of utility functions to search and access text
meta data, video and image URLs from youtube. These routines are based on the api. Specifications
for this api are published at http://developer.youtubenservices.com/docs
'''

Definition at line 16 of file youtube_api.py.

Definition at line 22 of file youtube_api.py.

Definition at line 428 of file youtube_api.py.

Definition at line 577 of file youtube_api.py.

Definition at line 714 of file youtube_api.py.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Sun May 27 06:42:34 2012 for MythTV by  doxygen 1.6.3