Web Service

meta<browser/> comes with and integrated web service using Windows Communiation Foundation. The service is RESTful, returns data in XML format and is self-hosting, which means that metabrowser will have to be kept running for the web service to remain active.

* Note: You will have to run meta<browser/> as an Administrator to use this feature.

Setup

There are 2 parts to this setup, the meta<browser/> Web Service, which will be the central hub where applications will be able to access metadata and control Media Center, and the Media Center AddIn, which is a small Media Center background plugin that acts as a server and executes commands it receives from the Web Service.

Having this 2 part setup will allow you to have meta<browser/> installed on a central location (ie Windows Home Server) and install the AddIn in all your Media Center computers.

Web Service

The Web Service is a self-hosting service built into meta<browser/> and can be set to start automatically when meta<browser/> launches. The default port is 7000 but can be configured to start on any port by going to Settings->Misc and entering a valid port number.

Media Center AddIn

The Media Center AddIn will run automatically every time you start Windows Media Center. It is set to listen on port 7861 and a Windows Firewall rule will automatically be added for that port on installation.

* Note: You may have to configure your router and or other virus/firewall software to allow communication on port 7861 and the port configured for the Web Service.

Endpoints (MetaData)

The base address to access MetaData specific endpoints is:

/get.Groups

Returns a list of groups setup in meta<browser/>.

1<results count="5">
2  <group>English</group>
3  <group>Hindi</group>
4  <group>Music Videos</group>
5  <group>Trailers</group>
6  <group>TV</group>
7</results>

/get.Group?group={group}

Returns a list of root media items for the specified group. Media types can be of type movie, series, folder, or set.

  • {group} must be a UrlEncoded string
  • <children> tag will contain the number of children under the specific media item
 1<results count="100">
 2  <media type="movie">
 3    <children>0</children>
 4    <path>\\tower\disk8\English Movies\17 Again (2009) [Blu-ray]\</path>
 5    <filename>movie.mkv</filename>
 6    <id>e6582b4b-66cd-442d-bf18-19936ab797c2</id>
 7    <parentid />
 8    <groupvalue>English</groupvalue>
 9    <name>17 Again</name>
10    <locked>False</locked>
11    <hasmetadata>True</hasmetadata>
12    <posters>1</posters>
13    <backdrops>2</backdrops>
14    <banners>0</banners>
15    <dateadded>12/31/2009</dateadded>
16    <mpaarating>PG-13</mpaarating>
17    <productionyear>2009</productionyear>
18    <metadatacomplete>True</metadatacomplete>
19    <trailers>0</trailers>
20    <episodenumber />
21    <seasonnumber />
22    <rating>6.5</rating>
23    <comment />
24    <watched>True</watched>
25  </media>
26  <media type="folder">
27    <children>3</children>
28    <path>\\tower\disk8\English Movies\Matrix Trilogy\</path>
29    <filename />
30    <id>e173d5a5-ab20-4756-a01a-046eefb0d451</id>
31    <parentid />
32    <groupvalue>English</groupvalue>
33    <name>Matrix Trilogy</name>
34    <locked>False</locked>
35    <hasmetadata>True</hasmetadata>
36    <posters>0</posters>
37    <backdrops>0</backdrops>
38    <banners>0</banners>
39    <dateadded>9/18/2010</dateadded>
40    <mpaarating />
41    <productionyear />
42    <metadatacomplete>False</metadatacomplete>
43    <trailers>0</trailers>
44    <episodenumber />
45    <seasonnumber />
46    <rating>0</rating>
47    <comment />
48    <watched>False</watched>
49  </media>
50  ...
51  ...
52  ...
53</results>

/get.Movies

Retuns a list of media items with a media type of movies.

 1<results count="469">
 2  <media type="movie">
 3    <children>0</children>
 4    <path>\\tower\disk3\Hindi Movies\13B (2009) [DVD]\</path>
 5    <filename>VIDEO_TS</filename>
 6    <id>c5fe6cd0-b138-4b60-bdf8-446abc89080d</id>
 7    <parentid />
 8    <groupvalue>Hindi</groupvalue>
 9    <name>13B</name>
10    <locked>False</locked>
11    <hasmetadata>True</hasmetadata>
12    <posters>1</posters>
13    <backdrops>1</backdrops>
14    <banners>0</banners>
15    <dateadded>5/29/2009</dateadded>
16    <mpaarating />
17    <productionyear>2009</productionyear>
18    <metadatacomplete>False</metadatacomplete>
19    <trailers>0</trailers>
20    <episodenumber />
21    <seasonnumber />
22    <rating>6.7</rating>
23    <comment />
24    <watched>False</watched>
25  </media>
26  ...
27  ...
28  ...
29</results>

/get.Series

Returns a list of media items with a media type of Series.

 1<results count="3">
 2  <media type="series">
 3    <children>1</children>
 4    <path>\\tower\disk8\TV\24\</path>
 5    <filename />
 6    <id>82a29ec1-33a5-4d6a-9700-7617e22c2e71</id>
 7    <parentid />
 8    <groupvalue>TV</groupvalue>
 9    <name>24</name>
10    <locked>False</locked>
11    <hasmetadata>True</hasmetadata>
12    <posters>1</posters>
13    <backdrops>2</backdrops>
14    <banners>1</banners>
15    <dateadded>9/10/2010</dateadded>
16    <mpaarating>TV-MA</mpaarating>
17    <productionyear>2001</productionyear>
18    <metadatacomplete>True</metadatacomplete>
19    <trailers>0</trailers>
20    <episodenumber />
21    <seasonnumber />
22    <rating>8.9</rating>
23    <comment />
24    <watched>False</watched>
25  </media>
26  ...
27  ...
28  ...
29</results>

/get.Children/{id}

Returns a list of media items which are children of the specified {id}.

For example, passing it an {id} for a media type of Season will return all chidren items (ie Episodes) for that item.

 1<results count="3">
 2  <media type="episode">
 3    <children>0</children>
 4    <path>\\tower\disk8\TV\24\Season 1\</path>
 5    <filename>S01E01 - Day 1 - 1200 A.M.-100 A.M..mkv</filename>
 6    <id>04f97f08-a2d6-4e4a-9327-852f86385c47</id>
 7    <parentid>670ec1b2-e28e-4cb4-9860-2ae2a9ced907</parentid>
 8    <groupvalue>TV</groupvalue>
 9    <name>Day 1 - 12:00 A.M.-1:00 A.M.</name>
10    <locked>False</locked>
11    <hasmetadata>True</hasmetadata>
12    <posters>1</posters>
13    <backdrops>0</backdrops>
14    <banners>0</banners>
15    <dateadded>9/10/2010</dateadded>
16    <mpaarating>TV-MA</mpaarating>
17    <productionyear />
18    <metadatacomplete>True</metadatacomplete>
19    <trailers>0</trailers>
20    <episodenumber>1</episodenumber>
21    <seasonnumber>1</seasonnumber>
22    <rating>7.2</rating>
23    <comment />
24    <watched>False</watched>
25  </media>
26  ...
27  ...
28  ...
29</results>

/get.Item/{id}

Returns media information for the specified {id}. The result will always be 1.

 1<results count="1">
 2  <media type="season">
 3    <children>3</children>
 4    <path>\\tower\disk8\TV\24\Season 1\</path>
 5    <filename />
 6    <id>670ec1b2-e28e-4cb4-9860-2ae2a9ced907</id>
 7    <parentid>82a29ec1-33a5-4d6a-9700-7617e22c2e71</parentid>
 8    <groupvalue>TV</groupvalue>
 9    <name>Season</name>
10    <locked>False</locked>
11    <hasmetadata>True</hasmetadata>
12    <posters>1</posters>
13    <backdrops>1</backdrops>
14    <banners>0</banners>
15    <dateadded>9/10/2010</dateadded>
16    <mpaarating>TV-MA</mpaarating>
17    <productionyear />
18    <metadatacomplete>False</metadatacomplete>
19    <trailers>0</trailers>
20    <episodenumber />
21    <seasonnumber>1</seasonnumber>
22    <rating>0</rating>
23    <comment />
24    <watched>False</watched>
25  </media>
26</results>

/get.MetaData/{id}

Returns metadata for the specified {id}.

  • Movie Metadata
     1<metadata type="movie">
     2  <path>\\tower\disk8\English Movies\17 Again (2009) [Blu-ray]\</path>
     3  <filename>movie.mkv</filename>
     4  <id>5e1a7816-008a-453e-af46-186f8e1f9103</id>
     5  <parentid />
     6  <groupvalue>English</groupvalue>
     7  <hasmetadata>True</hasmetadata>
     8  <hassubtitle>False</hassubtitle>
     9  <locked>False</locked>
    10  <dateadded>12/31/2009 9:53:45 AM</dateadded>
    11  <watched>True</watched>
    12  <comment />
    13  <collectionnumber />
    14  <type>Blu-ray</type>
    15  <runtime>102</runtime>
    16  <rating>6.5</rating>
    17  <mpaarating>PG-13</mpaarating>
    18  <plot />
    19  <description>On the brink of a midlife crisis, 30-something Mike O'Donnell (Matthew Perry) ...</description>
    20  <aspectratio>2.35:1</aspectratio>
    21  <localtitle>17 Again</localtitle>
    22  <originaltitle>17 Again</originaltitle>
    23  <sorttitle>17 Again</sorttitle>
    24  <productionyear>2009</productionyear>
    25  <imdbid>tt0974661</imdbid>
    26  <tmdbid>16996</tmdbid>
    27  <mymoviesid />
    28  <netflixid>http://api.netflix.com/catalog/titles/movies/70107406</netflixid>
    29  <moviemeterid />
    30  <yahooindiaid />
    31  <adultdvdempireid />
    32  <allocineid />
    33  <filmaffinityid />
    34  <amazonid />
    35  <persons>
    36    <person>
    37      <name>Zac Efron</name>
    38      <role>Mike O'Donnell (Teen)</role>
    39      <type>Actor</type>
    40      <thumb>\\tower\disk1\MediaBrowser\ImagesByName\People\Zac Efron\folder.jpg</thumb>
    41    </person>
    42  </persons>
    43  <genres>
    44    <genre>Comedy</genre>
    45    <genre>Drama</genre>
    46    <genre>Romance</genre>
    47  </genres>
    48  <studios>
    49    <studio>Offspring Entertainment</studio>
    50  </studios>
    51  <countries>
    52    <country>USA</country>
    53  </countries>
    54  <taglines>
    55    <tagline>Who says you're only young once?</tagline>
    56    <tagline>Back to High School</tagline>
    57  </taglines>
    58  <trailers>
    59    <trailer>\\tower\disk8\English Movies\17 Again (2009) [Blu-ray]\Trailers\trailer.mov</trailer>
    60  </trailers>
    61  <mediainfo>
    62    <video>
    63      <codec>VC-1</codec>
    64      <width>1920</width>
    65      <height>1080</height>
    66      <aspectratio>2.35:1</aspectratio>
    67      <duration>102</duration>
    68      <bitrate>0</bitrate>
    69      <framerate>23.976</framerate>
    70      <scantype>Progressive</scantype>
    71      <language />
    72    </video>
    73    <audio>
    74      <codec>FLAC</codec>
    75      <channels>6</channels>
    76      <bitrate>0</bitrate>
    77      <language>English</language>
    78    </audio>
    79    <subtitle>
    80      <language>English</language>
    81    </subtitle>
    82  </mediainfo>
    83  <posters>
    84    <poster width="1000" height="1500">\\tower\disk8\English Movies\17 Again (2009) [Blu-ray]\folder.jpg</poster>
    85  </posters>
    86  <backdrops>
    87    <backdrop width="1920" height="1080">\\tower\disk8\English Movies\17 Again (2009) [Blu-ray]\backdrop.jpg</backdrop>
    88    <backdrop width="1920" height="1080">\\tower\disk8\English Movies\17 Again (2009) [Blu-ray]\backdrop1.jpg</backdrop>
    89  </backdrops>
    90</metadata>
    
  • Series Metadata
     1<metadata type="series">
     2  <path>\\tower\disk8\TV\24\</path>
     3  <filename />
     4  <id>82a29ec1-33a5-4d6a-9700-7617e22c2e71</id>
     5  <parentid />
     6  <groupvalue>TV</groupvalue>
     7  <hasmetadata>True</hasmetadata>
     8  <locked>False</locked>
     9  <comment />
    10  <airday>Monday</airday>
    11  <firstairdate>2001-11-06</firstairdate>
    12  <airtime>9:00 PM</airtime>
    13  <runtime>60</runtime>
    14  <rating>8.9</rating>
    15  <mpaarating>TV-MA</mpaarating>
    16  <description>"24" is a TV thriller presented in "real time" with each minute of airtime ...</description>
    17  <network>FOX</network>
    18  <status>Ended</status>
    19  <seriesname>24</seriesname>
    20  <displayorder>airdate</displayorder>
    21  <language>en</language>
    22  <imdbid>tt0285331</imdbid>
    23  <tvdbid>76290</tvdbid>
    24  <tvrageid />
    25  <persons>
    26    <person>
    27      <name>Kiefer Sutherland</name>
    28      <role />
    29      <type>Actor</type>
    30      <thumb>\\tower\disk1\MediaBrowser\ImagesByName\People\Kiefer Sutherland\folder.jpg</thumb>
    31    </person>
    32  </persons>
    33  <genres>
    34    <genre>Action and Adventure</genre>
    35    <genre>Drama</genre>
    36  </genres>
    37  <posters>
    38    <poster width="680" height="1000">\\tower\disk8\TV\24\folder.jpg</poster>
    39  </posters>
    40  <backdrops>
    41    <backdrop width="1920" height="1080">\\tower\disk8\TV\24\backdrop.jpg</backdrop>
    42    <backdrop width="1920" height="1080">\\tower\disk8\TV\24\backdrop1.jpg</backdrop>
    43  </backdrops>
    44  <banners>
    45    <banner width="758" height="140">\\tower\disk8\TV\24\banner.jpg</banner>
    46  </banners>
    47</metadata>
    
  • Season Metadata
     1<metadata type="season">
     2  <path>\\tower\disk8\TV\24\Season 1\</path>
     3  <filename />
     4  <id>670ec1b2-e28e-4cb4-9860-2ae2a9ced907</id>
     5  <parentid>82a29ec1-33a5-4d6a-9700-7617e22c2e71</parentid>
     6  <groupvalue>TV</groupvalue>
     7  <description />
     8  <comment />
     9  <locked>False</locked>
    10  <posters>
    11    <poster width="400" height="578">\\tower\disk8\TV\24\Season 1\folder.jpg</poster>
    12  </posters>
    13  <backdrops>
    14    <backdrop width="1920" height="1080">\\tower\disk8\TV\24\Season 1\backdrop.jpg</backdrop>
    15  </backdrops>
    16  <banners>
    17    <banner width="758" height="140">\\tower\disk8\TV\24\Season 1\banner.jpg</banner>
    18  </banners>
    19</metadata>
    
  • Episode Metadata
     1<metadata type="episode">
     2  <path>\\tower\disk8\TV\24\Season 1\</path>
     3  <filename>S01E01 - Day 1 - 1200 A.M.-100 A.M..mkv</filename>
     4  <id>04f97f08-a2d6-4e4a-9327-852f86385c47</id>
     5  <parentid>670ec1b2-e28e-4cb4-9860-2ae2a9ced907</parentid>
     6  <groupvalue>TV</groupvalue>
     7  <hasmetadata>True</hasmetadata>
     8  <type />
     9  <locked>False</locked>
    10  <dateadded>9/10/2010 5:26:58 PM</dateadded>
    11  <watched>False</watched>
    12  <comment />
    13  <episodename>Day 1 - 12:00 A.M.-1:00 A.M.</episodename>
    14  <firstairdate>2001-11-06</firstairdate>
    15  <gueststars>|Michael O'Neill| Devika Parikh| Gary Murphy| Jeff Ricketts| Karen Kim| Petra Wright|</gueststars>
    16  <description>It is California Presidential Primary Day in Los Angeles and the longest day of Federal Agent Jack Bauer's life ...</description>
    17  <writer>Robert Cochran, Joel Surnow</writer>
    18  <director>Stephen Hopkins</director>
    19  <rating>7.2</rating>
    20  <seasonnumber>1</seasonnumber>
    21  <episodenumber>1</episodenumber>
    22  <dvdseasonnumber>1</dvdseasonnumber>
    23  <dvdepisodenumber>1.0</dvdepisodenumber>
    24  <absoluteepisodenumber />
    25  <mediainfo>
    26    <video>
    27      <codec>VC-1</codec>
    28      <width>1920</width>
    29      <height>1080</height>
    30      <aspectratio>2.35:1</aspectratio>
    31      <duration>102</duration>
    32      <bitrate>0</bitrate>
    33      <framerate>23.976</framerate>
    34      <scantype>Progressive</scantype>
    35      <language />
    36    </video>
    37    <audio>
    38      <codec>FLAC</codec>
    39      <channels>6</channels>
    40      <bitrate>0</bitrate>
    41      <language />
    42    </audio>
    43    <subtitle>
    44      <language>English</language>
    45    </subtitle>
    46  </mediainfo>
    47  <posters>
    48    <poster width="400" height="218">\\tower\disk8\TV\24\Season 1\metadata\49a689bd-ec5c-40b1-ada9-01b2cc571db0.jpg</poster>
    49  </posters>
    50</metadata>
    

/get.Image?path={path}&width={width}&height={height}

Returns an image at the specified {path}.

  • {path} must be a UrlEncoded string (can be relative or absolute)
    • relative path will be relative to the web folder in C:\ProgramData\MetaBrowser 2.0\web
  • {width} to sepcify maximum width of the returned image (optional)
  • {height} to sepcify maximum height of the returned image (optional)

If resized, the images will maintain their original aspect ratio.

/refresh.IsBusy

Returns the status of the refresh thread as True or False.

/refresh.List

Refreshes the media collection list in meta<browser/>. This process is asynchronous.

/refresh.Group?group={group}

  • {group} must be a UrlEncoded string

Refreshes all items under the specified group. This process is asynchronous.

/refresh.Item/{id}

Refresh the item and any children of that item.

/process.Item/{id}

Processes the item (performs the same function as Right Click->Process Item) but uses the plugin defined as the realtime default fetcher in settings. If {id} is a type of Series or Season, it will process all children for that {id} as well. This process is asynchronous.

Endpoints (MediaCenter)

The base address to access Media Center specific endpoints is:

You must have the Media Center AddIn installed on your Media Center PCs in order to be able to use these endpoints.

/Clients

Scans your network for computers and returns a list of clients that are listening on port 7861.

1<mce>
2  <client>
3    <name>Theater-PC</name>
4    <ip>192.168.1.100</ip>
5    <mac>01-23-45-67-89-ab</mac>
6  </client>
7</mce>

/WOL/{mac}

Wake On Lan, sends magic packets to the specified mac address. The computer must be setup to accept WOL commands.

* Note: It is up to the app developer to store client information (including mac adress) to be able to use this feature.

/{ip}/{command}?value={value}

Sends command to client ip running the Media Center AddIn with an optional value.

  • {ip} must be an ip of a client running the Media Center AddIn
  • {command} must be a command specified in the list below
  • {value} must be assigned to commands that require a value

For example, lets say the meta<browser/> web service is running on my office computer (192.168.1.10:7000) and I have 2 HTPCs with the Media Center AddIn Installed (192.168.1.100 and 192.168.1.101):

Commands

All commands will return with an OK <value> (unless specified below the command):

1<mce>
2  <value>OK</value>
3</mce>

If a command was not successfuly executed, it will return with an <error> node along with the error message:

1<mce>
2  <error>Error Message</error>
3</mce>

Commands List

  • a to z
  • num0 to num9
  • ping
  • up
  • down
  • left
  • right
  • ok
  • back
  • info
  • channelup
  • channeldown
  • record
  • dvdmenu
  • dvdaudio
  • dvdsubtitle
  • cc
  • zoom
  • star
  • clear
  • stop
  • pause
  • play
  • skipforward
  • skipback
  • ff
  • ff1
  • ff2
  • ff3
  • rewind
  • rewind1
  • rewind2
  • rewind3
  • slowmotion1
  • slowmotion2
  • slowmotion3
  • mute
  • unmute
  • fullscreen
  • music
  • pictures
  • tvlive
  • tvrecorded
  • greenbutton
  • volume (returns with value of current volumne)
  • volumeup (returns with value of current volumne)
  • volumedown (returns with value of current volumne)
  • seek?value={value}
  • position (returns with current position of the media playing)
  • playitem?value={value}
    • {value} can be {id} of media type movie or episode
    • {value} can be an UrlEncoded path to the media item
  • queueitem?value=value
    • {value} can be {id} of media type movie or episode
    • {value} can be an UrlEncoded path to the media item
  • playstate (returns with the current playstate)

* Note: More commands will be added as needed or requested.

Endpoints (Web)

The base address to access meta<browser/> web interface is:

The web endpoint's root directory location is C:\ProgramData\MetaBrowser 2.0\Web.

The default page displayed will be an internal page displaying the media colleciton summary and links to any installed web apps. If you wish to override the default web page, place an index.html file in the root directory (C:\ProgramData\MetaBrowser 2.0\Web)

/{file}

  • {file} must be path to a file located under the root web directory

For example:

If no file is specified and the path is to an existing directory which contains an index.html, it will display the contents of the index.html.

For example:

Would look for and return /web/myfolder/index.html if it exists.

Web Apps

Web apps must be put in subfolders under the root directory and must contain an index.html file for it to be displayed on meta<browser/>'s default web page, which contains a list of the installed apps.

For example, C:\ProgramData\MetaBrowser 2.0\Web\MyWebApp\index.html

The app subfolder also supports a cofiguration file and must be named index.xml, which is required if you wish to use auto-update.

1<index>
2    <title>Web App Title</title>
3    <summary>This is a web app.</summary>
4    <version>1.0.0</version>
5    <author>fatal</author>
6    <website>http://themetabrowser.com</website>
7</index>

Auto Update

To have your web app available through auto-update you need to zip your web app folder. The zip filename should be the exact same as the web app folder name and the zip should contain the web app folder itself (along with the contents) not just the files/folder inside the web app folder, for example:

MyWebApp\
         images\
         js\
         index.html
         index.xml

You would then zip your MyWebApp folder and name it MyWebApp.zip. If you have Win-Zip installed, it's as easy as Right Clicking on the MyWebApp folder and clicking on Add to MyWebApp.zip.

Your web app folder name must be unique, as two web apps with the same folder name would overwrite each other.

* Note: Please contact me to have your web app avaialble through auto-update, you will get access to upload and update your versions yourself.