23 __title__ =
"Comedy Central";
24 __mashup_title__ =
"comedycentralMashup"
25 __author__=
"R.D. Vaughan"
29 __usage_examples__ =
'''
31 > ./comedycentral.py -h
32 Usage: ./comedycentral.py -hduvlST [parameters] <search text>
33 Version: v0.1.0 Author: R.D.Vaughan
35 For details on the MythTV Netvision plugin see the wiki page at:
36 http://www.mythtv.org/wiki/MythNetvision
39 -h, --help show this help message and exit
40 -d, --debug Show debugging info (URLs, raw XML ... etc, info
42 -u, --usage Display examples for executing the script
43 -v, --version Display grabber name and supported options
44 -l LANGUAGE, --language=LANGUAGE
45 Select data that matches the specified language fall
46 back to English if nothing found (e.g. 'es' EspaƱol,
47 'de' Deutsch ... etc). Not all sites or grabbers
49 -p PAGE NUMBER, --pagenumber=PAGE NUMBER
50 Display specific page of the search results. Default
51 is page 1. Page number is ignored with the Tree View
53 -T, --treeview Display a Tree View of a sites videos
55 > ./comedycentral.py -v
57 > ./comedycentral.py -T
59 __search_max_page_items__ = 20
60 __tree_max_page_items__ = 20
66 """Wraps a stream with an encoder"""
75 """Wraps the output stream, encoding Unicode strings with the specified encoding"""
76 if isinstance(obj, str):
78 self.
out.buffer.write(obj)
81 """Delegate everything but write to the stream"""
82 return getattr(self.
out, attr)
84 if isinstance(sys.stdout, io.TextIOWrapper):
93 '''Import the common python class
96 except Exception
as e:
98 The subdirectory "nv_python_libs/common" containing the modules mashups_api.py and
99 mashups_exceptions.py (v0.1.3 or greater),
100 They should have been included with the distribution of MythNetvision
105 if common_api.__version__ <
'0.1.3':
106 sys.stderr.write(
"\n! Error: Your current installed common_api.py version is (%s)\nYou must at least have version (0.1.3) or higher.\n" % target.__version__)
112 '''Import the python mashups support classes
115 except Exception
as e:
117 The subdirectory "nv_python_libs/mashups" containing the modules mashups_api and
118 mashups_exceptions.py (v0.1.0 or greater),
119 They should have been included with the distribution of comedycentral.py.
123 if target.__version__ <
'0.1.0':
124 sys.stderr.write(
"\n! Error: Your current installed mashups_api.py version is (%s)\nYou must at least have version (0.1.0) or higher.\n" % target.__version__)
130 except Exception
as e:
132 The python script "nv_python_libs/mainProcess.py" must be present.
137 if process.__version__ <
'0.2.0':
138 sys.stderr.write(
"\n! Error: Your current installed mainProcess.py version is (%s)\nYou must at least have version (0.2.0) or higher.\n" % process.__version__)
141 if __name__ ==
'__main__':
145 target.baseProcessingDir = os.path.dirname( os.path.realpath( __file__ ))
147 target.common = common_api.Common()
148 main = process.mainProcess(target, apikey, )
149 main.grabberInfo = {}
150 main.grabberInfo[
'enabled'] =
True
151 main.grabberInfo[
'title'] = __title__
152 main.grabberInfo[
'command'] =
'comedycentral.py'
153 main.grabberInfo[
'mashup_title'] = __mashup_title__
154 main.grabberInfo[
'author'] = __author__
155 main.grabberInfo[
'thumbnail'] =
'comedycentral.png'
156 main.grabberInfo[
'type'] = [
'video', ]
157 main.grabberInfo[
'desc'] =
"Videos of your favorite shows, whenever you want them!"
158 main.grabberInfo[
'version'] = __version__
159 main.grabberInfo[
'search'] =
False
160 main.grabberInfo[
'tree'] =
True
161 main.grabberInfo[
'html'] =
False
162 main.grabberInfo[
'usage'] = __usage_examples__
163 main.grabberInfo[
'SmaxPage'] = __search_max_page_items__
164 main.grabberInfo[
'TmaxPage'] = __tree_max_page_items__