26__mashup_title__ =
"thewb"
27__author__=
"R.D. Vaughan"
34__usage_examples__ =
'''
37Usage: ./thewb.py -hduvlST [parameters] <search text>
38Version: v0.11 Author: R.D.Vaughan
40For details on the MythTV Netvision plugin see the wiki page at:
41http://www.mythtv.org/wiki/MythNetvision
44 -h, --help show this help message and exit
45 -d, --debug Show debugging info (URLs, raw XML ... etc, info
47 -u, --usage Display examples
for executing the script
48 -v, --version Display grabber name
and supported options
49 -l LANGUAGE, --language=LANGUAGE
50 Select data that matches the specified language fall
51 back to English
if nothing found (e.g.
'es' EspaƱol,
52 'de' Deutsch ... etc). Not all sites
or grabbers
54 -p PAGE NUMBER, --pagenumber=PAGE NUMBER
55 Display specific page of the search results. Default
56 is page 1. Page number
is ignored
with the Tree View
58 -S, --search Search
for videos
59 -T, --treeview Display a Tree View of a sites videos
64 <author>R.D.Vaughan</author>
65 <thumbnail>thewb.png</thumbnail>
67 <description>Watch full episodes of your favorite shows on The WB.com, like Friends, The O.C., Veronica Mars, Pushing Daisies, Smallville, Buffy The Vampire Slayer, One Tree Hill
and Gilmore Girls.</description>
68 <version>v0.11</version>
73> ./thewb.py -S
"Firefly"
77__search_max_page_items__ = 20
78__tree_max_page_items__ = 20
83class OutStreamEncoder(object):
84 """Wraps a stream with an encoder"""
93 """Wraps the output stream, encoding Unicode strings with the specified encoding"""
94 if isinstance(obj, str):
96 self.
out.buffer.write(obj)
99 """Delegate everything but write to the stream"""
100 return getattr(self.
out, attr)
102if isinstance(sys.stdout, io.TextIOWrapper):
110 '''Import the common python class
113except Exception
as e:
115The subdirectory "nv_python_libs/common" containing the modules common_api.py and
116common_exceptions.py (v0.1.3 or greater),
117They should have been included with the distribution of MythNetvision
121if common_api.__version__ <
'0.1.3':
122 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__)
128 '''Import the python thewb support classes
131except Exception
as e:
133The subdirectory "nv_python_libs/thewb" containing the modules thewb_api and
134thewb_exceptions.py (v0.1.0 or greater),
135They should have been included with the distribution of thewb.py.
139if target.__version__ <
'0.1.0':
140 sys.stderr.write(
"\n! Error: Your current installed thewb_api.py version is (%s)\nYou must at least have version (0.1.0) or higher.\n" % target.__version__)
146except Exception
as e:
148The python script "nv_python_libs/mainProcess.py" must be present.
153if process.__version__ <
'0.2.0':
154 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__)
157if __name__ ==
'__main__':
161 target.baseProcessingDir = os.path.dirname( os.path.realpath( __file__ ))
163 target.common = common_api.Common()
164 main = process.mainProcess(target, apikey, )
165 main.grabberInfo = {}
166 main.grabberInfo[
'enabled'] =
True
167 main.grabberInfo[
'title'] = __title__
168 main.grabberInfo[
'command'] =
'thewb.py'
169 main.grabberInfo[
'mashup_title'] = __mashup_title__
170 main.grabberInfo[
'author'] = __author__
171 main.grabberInfo[
'thumbnail'] =
'thewb.png'
172 main.grabberInfo[
'type'] = [
'video', ]
173 main.grabberInfo[
'desc'] =
"Watch full episodes of your favorite shows on The WB.com, like Friends, The O.C., Veronica Mars, Pushing Daisies, Smallville, Buffy The Vampire Slayer, One Tree Hill and Gilmore Girls."
174 main.grabberInfo[
'version'] = __version__
175 main.grabberInfo[
'search'] =
True
176 main.grabberInfo[
'tree'] =
True
177 main.grabberInfo[
'html'] =
False
178 main.grabberInfo[
'usage'] = __usage_examples__
179 main.grabberInfo[
'SmaxPage'] = __search_max_page_items__
180 main.grabberInfo[
'TmaxPage'] = __tree_max_page_items__
def __init__(self, outstream, encoding=None)
def __getattr__(self, attr)