29 __author__=
"R.D. Vaughan"
39 __usage_examples__ =
'''
41 Usage: ./bliptv.py -hduvlST [parameters] <search text>
43 For details on the MythTV Netvision plugin see the wiki page at:
44 http://www.mythtv.org/wiki/MythNetvision
45 Version: v0.22 Author: R.D.Vaughan
48 -h, --help show this help message and exit
49 -d, --debug Show debugging info (URLs, raw XML ... etc, info
51 -u, --usage Display examples for executing the script
52 -v, --version Display grabber name and supported options
53 -l LANGUAGE, --language=LANGUAGE
54 Select data that matches the specified language fall
55 back to English if nothing found (e.g. 'es' Español,
56 'de' Deutsch ... etc). Not all sites or grabbers
58 -p PAGE NUMBER, --pagenumber=PAGE NUMBER
59 Display specific page of the search results. Default
60 is page 1. Page number is ignored with the Tree
62 -S, --search Search for videos
63 -T, --treeview Display a Tree View of a sites videos
66 (Search for all videos identified with the word "flute")
67 >./bliptv.py -p 1 -S "flute"
68 <?xml version="1.0" encoding="UTF-8"?>
70 xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
71 xmlns:content="http://purl.org/rss/1.0/modules/content/"
72 xmlns:cnettv="http://cnettv.com/mrss/"
73 xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
74 xmlns:media="http://search.yahoo.com/mrss/"
75 xmlns:atom="http://www.w3.org/2005/Atom"
76 xmlns:amp="http://www.adobe.com/amp/1.0"
77 xmlns:dc="http://purl.org/dc/elements/1.1/">
79 <title>blip.tv</title>
80 <link>http://blip.tv</link>
81 <description>We're the next generation television network</description>
82 <numresults>21</numresults>
83 <returned>20</returned>
84 <startindex>20</startindex>
87 <author>flute</author>
88 <pubDate>Sun, 25 May 2008 02:39:49 +0000</pubDate>
89 <description>test</description>
90 <link>http://blip.tv/file/933615</link>
92 <media:thumbnail url='http://a.images.blip.tv/Flute-416-140-781.jpg'/>
93 <media:content url='http://blip.tv/file/get/Flute-416.avi' duration='30' width='' height='' lang='en'/>
99 <title>Bright Sunny Place (music video excerpt)</title>
100 <author>tokyosax</author>
101 <pubDate>Mon, 24 Sep 2007 11:05:46 +0000</pubDate>
102 <description>A brief snippet of my flute work from a larger video composition viewable at http://www.youtube.com/profile?user=japanjazzman. Original tune, original forehead.</description>
103 <link>http://blip.tv/file/394159</link>
105 <media:thumbnail url='http://a.images.blip.tv/Arnoldbaruch-BrightSunnyPlace503-931.jpg'/>
106 <media:content url='http://blip.tv/file/get/Arnoldbaruch-BrightSunnyPlace310.mov' duration='45' width='' height='' lang='en'/>
113 (Create a Blip.tv Tree view)
115 <?xml version="1.0" encoding="UTF-8"?>
117 xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
118 xmlns:content="http://purl.org/rss/1.0/modules/content/"
119 xmlns:cnettv="http://cnettv.com/mrss/"
120 xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
121 xmlns:media="http://search.yahoo.com/mrss/"
122 xmlns:atom="http://www.w3.org/2005/Atom"
123 xmlns:amp="http://www.adobe.com/amp/1.0"
124 xmlns:dc="http://purl.org/dc/elements/1.1/">
126 <title>blip.tv</title>
127 <link>http://blip.tv</link>
128 <description>We're the next generation television network</description>
129 <numresults>0</numresults>
130 <returned>1</returned>
131 <startindex>0</startindex>
132 <directory name="Popular/Recent/Features/Random ..." thumbnail="/usr/local/share/mythtv//mythnetvision/icons/bliptv.png">
133 <directory name="Most Comments" thumbnail="/usr/local/share/mythtv//mythnetvision/icons/directories/topics/most_comments.png">
135 <title>VIDEO: Eritrea Movie Timali (Part 24)</title>
136 <author>asmarino5</author>
137 <pubDate>Mon, 04 Jan 2010 05:30:21 +0000</pubDate>
138 <description>VIDEO: Eritrea Movie Timali (Part 24)</description>
139 <link>http://blip.tv/file/3043223</link>
141 <media:thumbnail url='http://a.images.blip.tv/Asmarino5-VIDEOEritreaMovieTimaliPart24121-227.jpg'/>
142 <media:content url='http://blip.tv/file/get/Asmarino5-VIDEOEritreaMovieTimaliPart24121.wmv' duration='2216' width='320' height='240' lang='en'/>
148 <title>informest</title>
149 <author>fluido</author>
150 <pubDate>Sun, 03 Jan 2010 22:23:56 +0000</pubDate>
151 <description>informest</description>
152 <link>http://blip.tv/file/3042202</link>
154 <media:thumbnail url='http://a.images.blip.tv/Fluido-informest458-244.jpg'/>
155 <media:content url='http://blip.tv/file/get/Fluido-informest458.mp4' duration='310' width='720' height='576' lang='en'/>
165 __max_page_items__ = 20
171 """Wraps a stream with an encoder"""
180 """Wraps the output stream, encoding Unicode strings with the specified encoding"""
181 if isinstance(obj, str):
183 self.
out.buffer.write(obj)
186 """Delegate everything but write to the stream"""
187 return getattr(self.
out, attr)
198 except Exception
as e:
200 The subdirectory "nv_python_libs/bliptv" containing the modules bliptv_api.py (v0.2.0 or greater),
201 They should have been included with the distribution of bliptv.py.
206 if target.__version__ <
'0.2.0':
207 sys.stderr.write(
"\n! Error: Your current installed bliptv_api.py version is (%s)\nYou must at least have version (0.2.0) or higher.\n" % target.__version__)
214 except Exception
as e:
216 The python script "nv_python_libs/mainProcess.py" must be present.
221 if process.__version__ <
'0.2.0':
222 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__)
225 if __name__ ==
'__main__':
228 main = process.mainProcess(target, apikey, )
229 main.grabberInfo = {}
230 main.grabberInfo[
'enabled'] =
True
231 main.grabberInfo[
'title'] = __title__
232 main.grabberInfo[
'command'] =
'bliptv.py'
233 main.grabberInfo[
'author'] = __author__
234 main.grabberInfo[
'thumbnail'] =
'bliptv.png'
235 main.grabberInfo[
'type'] = [
'video']
236 main.grabberInfo[
'desc'] =
"We're the next generation television network."
237 main.grabberInfo[
'version'] = __version__
238 main.grabberInfo[
'search'] =
True
239 main.grabberInfo[
'tree'] =
True
240 main.grabberInfo[
'html'] =
False
241 main.grabberInfo[
'usage'] = __usage_examples__
242 main.grabberInfo[
'SmaxPage'] = __max_page_items__
243 main.grabberInfo[
'TmaxPage'] = __max_page_items__