Difference between revisions of "Video Service"

From MythTV Official Wiki
Jump to: navigation, search
(Intro)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
=What is this?=
 +
See [[Services API]]
 +
 +
 
=Video Service API List=
 
=Video Service API List=
  
Line 4: Line 8:
 
<center>
 
<center>
 
{| cellpadding="4" border="1"
 
{| cellpadding="4" border="1"
| align="center"  |<b>API Command</b>  
+
| align="center"  |<b>API Command</b>
 
| align="center"  |<b>POST Required?</b>  
 
| align="center"  |<b>POST Required?</b>  
 
| align="center"  |<b>Description</b>  
 
| align="center"  |<b>Description</b>  
Line 16: Line 20:
 
| Get a single video's metadata by database id.
 
| Get a single video's metadata by database id.
 
|-  
 
|-  
| style="background:silver" | [[Video_Service#GetVideoByFilename | GetVideoByFilename]]
+
| style="background:silver" | [[Video_Service#GetVideoByFileName | GetVideoByFileName]]
 
| style="background:silver" align="center" | No
 
| style="background:silver" align="center" | No
 
| style="background:silver" | Get a single video's metadata by filename.
 
| style="background:silver" | Get a single video's metadata by filename.
Line 83: Line 87:
 
         The American science fiction comedy about a conspiracy theory. Two secret agents are searching the streets for aliens in this blockbuster film that earned 590 million dollars at the box-office and birthed a sequel; Men in Black II.
 
         The American science fiction comedy about a conspiracy theory. Two secret agents are searching the streets for aliens in this blockbuster film that earned 590 million dollars at the box-office and birthed a sequel; Men in Black II.
 
         <Certification>PG-13</Certification>
 
         <Certification>PG-13</Certification>
         <InetRef>607</InetRef>
+
         <Inetref>607</Inetref>
 
         <HomePage>http://www.themoviedb.org/movie/607</HomePage>
 
         <HomePage>http://www.themoviedb.org/movie/607</HomePage>
 
         <ReleaseDate>1997-07-01T00:00:00</ReleaseDate>
 
         <ReleaseDate>1997-07-01T00:00:00</ReleaseDate>
Line 97: Line 101:
 
         <FileName>Men in Black.mkv</FileName>
 
         <FileName>Men in Black.mkv</FileName>
 
         <Hash>22be408157d11281</Hash>
 
         <Hash>22be408157d11281</Hash>
         <Host>holmes</Host>
+
         <HostName>holmes</HostName>
 
         <Coverart>607_coverart.jpg</Coverart>
 
         <Coverart>607_coverart.jpg</Coverart>
 
         <Fanart>607_fanart.jpg</Fanart>
 
         <Fanart>607_fanart.jpg</Fanart>
Line 132: Line 136:
 
     The American science fiction comedy about a conspiracy theory. Two secret agents are searching the streets for aliens in this blockbuster film that earned 590 million dollars at the box-office and birthed a sequel; Men in Black II.
 
     The American science fiction comedy about a conspiracy theory. Two secret agents are searching the streets for aliens in this blockbuster film that earned 590 million dollars at the box-office and birthed a sequel; Men in Black II.
 
     <Certification>PG-13</Certification>
 
     <Certification>PG-13</Certification>
     <InetRef>607</InetRef>
+
     <Inetref>607</Inetref>
 
     <HomePage>http://www.themoviedb.org/movie/607</HomePage>
 
     <HomePage>http://www.themoviedb.org/movie/607</HomePage>
 
     <ReleaseDate>1997-07-01T00:00:00</ReleaseDate>
 
     <ReleaseDate>1997-07-01T00:00:00</ReleaseDate>
Line 146: Line 150:
 
     <FileName>Men in Black.mkv</FileName>
 
     <FileName>Men in Black.mkv</FileName>
 
     <Hash>22be408157d11281</Hash>
 
     <Hash>22be408157d11281</Hash>
     <Host>holmes</Host>
+
     <HostName>holmes</HostName>
 
     <Coverart>607_coverart.jpg</Coverart>
 
     <Coverart>607_coverart.jpg</Coverart>
 
     <Fanart>607_fanart.jpg</Fanart>
 
     <Fanart>607_fanart.jpg</Fanart>
Line 155: Line 159:
 
</pre>
 
</pre>
  
==GetVideoByFilename==
+
==GetVideoByFileName==
  
The <span style="color:LimeGreen">GetVideoByFilename</span> API takes the following arguments:
+
The <span style="color:LimeGreen">GetVideoByFileName</span> API takes the following arguments:
  
:<span style="color:SteelBlue">Filename</Span> ('''Required''')
+
:<span style="color:SteelBlue">FileName</Span> ('''Required''')
 
:: '''Parameter Type:''' String
 
:: '''Parameter Type:''' String
 
:: The filename of the requested metadata record.
 
:: The filename of the requested metadata record.
Line 165: Line 169:
 
Example Query:
 
Example Query:
  
<code>http://BackendServerIP:6544/Video/GetVideoByFilename?Filename=Men%20in%20Black.mkv</code>
+
<code>http://BackendServerIP:6544/Video/GetVideoByFileName?FileName=Men%20in%20Black.mkv</code>
  
 
Example Return:
 
Example Return:
Line 179: Line 183:
 
     The American science fiction comedy about a conspiracy theory. Two secret agents are searching the streets for aliens in this blockbuster film that earned 590 million dollars at the box-office and birthed a sequel; Men in Black II.
 
     The American science fiction comedy about a conspiracy theory. Two secret agents are searching the streets for aliens in this blockbuster film that earned 590 million dollars at the box-office and birthed a sequel; Men in Black II.
 
     <Certification>PG-13</Certification>
 
     <Certification>PG-13</Certification>
     <InetRef>607</InetRef>
+
     <Inetref>607</Inetref>
 
     <HomePage>http://www.themoviedb.org/movie/607</HomePage>
 
     <HomePage>http://www.themoviedb.org/movie/607</HomePage>
 
     <ReleaseDate>1997-07-01T00:00:00</ReleaseDate>
 
     <ReleaseDate>1997-07-01T00:00:00</ReleaseDate>
Line 193: Line 197:
 
     <FileName>Men in Black.mkv</FileName>
 
     <FileName>Men in Black.mkv</FileName>
 
     <Hash>22be408157d11281</Hash>
 
     <Hash>22be408157d11281</Hash>
     <Host>holmes</Host>
+
     <HostName>holmes</HostName>
 
     <Coverart>607_coverart.jpg</Coverart>
 
     <Coverart>607_coverart.jpg</Coverart>
 
     <Fanart>607_fanart.jpg</Fanart>
 
     <Fanart>607_fanart.jpg</Fanart>
Line 206: Line 210:
 
The <span style="color:LimeGreen">AddVideo</span> API takes the following arguments:
 
The <span style="color:LimeGreen">AddVideo</span> API takes the following arguments:
  
:<span style="color:SteelBlue">Filename</Span> ('''Required''')
+
:<span style="color:SteelBlue">FileName</Span> ('''Required''')
 
:: '''Parameter Type:''' String
 
:: '''Parameter Type:''' String
 
:: The filename (including relative path from the root of the video storage group) to be added to the database.
 
:: The filename (including relative path from the root of the video storage group) to be added to the database.
  
:<span style="color:SteelBlue">Host</Span> ('''Required''')
+
:<span style="color:SteelBlue">HostName</Span> ('''Required''')
 
:: '''Parameter Type:''' String
 
:: '''Parameter Type:''' String
 
:: The backend hostname where the file can be found.
 
:: The backend hostname where the file can be found.
Line 216: Line 220:
 
Example Query:
 
Example Query:
  
<code>http://BackendServerIP:6544/Video/AddVideo?Filename=300.mkv&Hostname=localhost</code>
+
<code>http://BackendServerIP:6544/Video/AddVideo?FileName=300.mkv&HostName=localhost</code>
  
 
Example Return:
 
Example Return:
Line 293: Line 297:
 
         Sick, twisted, politically incorrect and Freakin' Sweet animated series featuring the adventures of the dysfunctional Griffin family. Bumbling Peter and long-suffering Lois have three kids. Stewie (a brilliant but sadistic baby bent on killing his mother and taking over the world), Meg (the oldest, and is the most unpopular girl in town) and Chris (the middle kid, he's not very bright but has a passion for movies). The final member of the family is Brian - a talking dog and much more than a pet, he keeps Stewie in check whilst sipping Martinis and sorting through his own life issues.
 
         Sick, twisted, politically incorrect and Freakin' Sweet animated series featuring the adventures of the dysfunctional Griffin family. Bumbling Peter and long-suffering Lois have three kids. Stewie (a brilliant but sadistic baby bent on killing his mother and taking over the world), Meg (the oldest, and is the most unpopular girl in town) and Chris (the middle kid, he's not very bright but has a passion for movies). The final member of the family is Brian - a talking dog and much more than a pet, he keeps Stewie in check whilst sipping Martinis and sorting through his own life issues.
 
         <Certification></Certification>
 
         <Certification></Certification>
         <InetRef>75978</InetRef>
+
         <Inetref>75978</Inetref>
 
         <HomePage></HomePage>
 
         <HomePage></HomePage>
 
         <ReleaseDate>1999-01-31T00:00:00</ReleaseDate>
 
         <ReleaseDate>1999-01-31T00:00:00</ReleaseDate>
Line 358: Line 362:
 
</BlurayInfo>  
 
</BlurayInfo>  
 
</pre>
 
</pre>
 +
 +
[[Category:Services_API]]

Latest revision as of 11:48, 19 July 2013

What is this?

See Services API


Video Service API List

API Command POST Required? Description
GetVideoList No Get a list of videos and their metadata.
GetVideo No Get a single video's metadata by database id.
GetVideoByFileName No Get a single video's metadata by filename.
AddVideo Yes Add a new filename to the video database.
RemoveVideoFromDB Yes Remove a single video from the database by database id.
LookupVideo No Perform an online metadata lookup for a given title, subtitle, inetref, season, or episode number.
GetBluray No Query technical data for a Blu-ray disc or folder.

Video APIs

GetVideoList

The GetVideoList API takes the following arguments:

Descending (Optional)
Parameter Type: Boolean
Whether to return results in ascending or descending order.
StartIndex (Optional)
Parameter Type: Integer
The first index number to return.
Count (Optional)
Parameter Type: Integer
The number of records to return.

Example Query:

http://BackendServerIP:6544/Video/GetVideoList?StartIndex=100&Count=1

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<VideoMetadataInfoList version="1.01" serializerVersion="1.1">
<StartIndex>100</StartIndex>
<Count>1</Count>
<CurrentPage>101</CurrentPage>
<TotalPages>1656</TotalPages>
<TotalAvailable>1656</TotalAvailable>
<AsOf>2011-10-02T21:03:35</AsOf>
<Version>0.25.20110928-1</Version>
<ProtoVer>69</ProtoVer>
<VideoMetadataInfos>
    <VideoMetadataInfo>
        <Id>106</Id>
        <Title>Men In Black</Title>
        <SubTitle></SubTitle>
        <Tagline>Protecting the Earth from the scum of the universe.</Tagline>
        <Director>Barry Sonnenfeld</Director>
        <Studio>Amblin Entertainment</Studio>
        The American science fiction comedy about a conspiracy theory. Two secret agents are searching the streets for aliens in this blockbuster film that earned 590 million dollars at the box-office and birthed a sequel; Men in Black II.
        <Certification>PG-13</Certification>
        <Inetref>607</Inetref>
        <HomePage>http://www.themoviedb.org/movie/607</HomePage>
        <ReleaseDate>1997-07-01T00:00:00</ReleaseDate>
        <AddDate>2010-06-03T00:00:00</AddDate>
        <UserRating>7</UserRating>
        <Length>98</Length>
        <Season>0</Season>
        <Episode>0</Episode>
        <ParentalLevel>3</ParentalLevel>
        <Visible>true</Visible>
        <Watched>false</Watched>
        <Processed>true</Processed>
        <FileName>Men in Black.mkv</FileName>
        <Hash>22be408157d11281</Hash>
        <HostName>holmes</HostName>
        <Coverart>607_coverart.jpg</Coverart>
        <Fanart>607_fanart.jpg</Fanart>
        <Banner></Banner>
        <Screenshot></Screenshot>
        <Trailer></Trailer>
    </VideoMetadataInfo>
</VideoMetadataInfos>
</VideoMetadataInfoList>

GetVideo

The GetVideo API takes the following arguments:

Id (Required)
Parameter Type: Integer
The database id of the requested metadata record.

Example Query:

http://BackendServerIP:6544/Video/GetVideo?Id=106

Example Return:

<VideoMetadataInfo>
    <Id>106</Id>
    <Title>Men In Black</Title>
    <SubTitle></SubTitle>
    <Tagline>Protecting the Earth from the scum of the universe.</Tagline>
    <Director>Barry Sonnenfeld</Director>
    <Studio>Amblin Entertainment</Studio>
    The American science fiction comedy about a conspiracy theory. Two secret agents are searching the streets for aliens in this blockbuster film that earned 590 million dollars at the box-office and birthed a sequel; Men in Black II.
    <Certification>PG-13</Certification>
    <Inetref>607</Inetref>
    <HomePage>http://www.themoviedb.org/movie/607</HomePage>
    <ReleaseDate>1997-07-01T00:00:00</ReleaseDate>
    <AddDate>2010-06-03T00:00:00</AddDate>
    <UserRating>7</UserRating>
    <Length>98</Length>
    <Season>0</Season>
    <Episode>0</Episode>
    <ParentalLevel>3</ParentalLevel>
    <Visible>true</Visible>
    <Watched>false</Watched>
    <Processed>true</Processed>
    <FileName>Men in Black.mkv</FileName>
    <Hash>22be408157d11281</Hash>
    <HostName>holmes</HostName>
    <Coverart>607_coverart.jpg</Coverart>
    <Fanart>607_fanart.jpg</Fanart>
    <Banner></Banner>
    <Screenshot></Screenshot>
    <Trailer></Trailer>
</VideoMetadataInfo>

GetVideoByFileName

The GetVideoByFileName API takes the following arguments:

FileName (Required)
Parameter Type: String
The filename of the requested metadata record.

Example Query:

http://BackendServerIP:6544/Video/GetVideoByFileName?FileName=Men%20in%20Black.mkv

Example Return:

<VideoMetadataInfo>
    <Id>106</Id>
    <Title>Men In Black</Title>
    <SubTitle></SubTitle>
    <Tagline>Protecting the Earth from the scum of the universe.</Tagline>
    <Director>Barry Sonnenfeld</Director>
    <Studio>Amblin Entertainment</Studio>
    The American science fiction comedy about a conspiracy theory. Two secret agents are searching the streets for aliens in this blockbuster film that earned 590 million dollars at the box-office and birthed a sequel; Men in Black II.
    <Certification>PG-13</Certification>
    <Inetref>607</Inetref>
    <HomePage>http://www.themoviedb.org/movie/607</HomePage>
    <ReleaseDate>1997-07-01T00:00:00</ReleaseDate>
    <AddDate>2010-06-03T00:00:00</AddDate>
    <UserRating>7</UserRating>
    <Length>98</Length>
    <Season>0</Season>
    <Episode>0</Episode>
    <ParentalLevel>3</ParentalLevel>
    <Visible>true</Visible>
    <Watched>false</Watched>
    <Processed>true</Processed>
    <FileName>Men in Black.mkv</FileName>
    <Hash>22be408157d11281</Hash>
    <HostName>holmes</HostName>
    <Coverart>607_coverart.jpg</Coverart>
    <Fanart>607_fanart.jpg</Fanart>
    <Banner></Banner>
    <Screenshot></Screenshot>
    <Trailer></Trailer>
</VideoMetadataInfo>

AddVideo

The AddVideo API takes the following arguments:

FileName (Required)
Parameter Type: String
The filename (including relative path from the root of the video storage group) to be added to the database.
HostName (Required)
Parameter Type: String
The backend hostname where the file can be found.

Example Query:

http://BackendServerIP:6544/Video/AddVideo?FileName=300.mkv&HostName=localhost

Example Return:

Returns a boolean value. True if the file was successfully added, false if the insert failed for any reason.

<bool>true</bool>

RemoveVideoFromDB

The RemoveVideoFromDB API takes the following arguments:

Id (Required)
Parameter Type: Integer
The database id of the metadata record to be removed.

Example Query:

http://BackendServerIP:6544/Video/RemoveVideoFromDB?Id=106

Example Return:

Returns a boolean value. True if the file was successfully removed, false if the removal failed for any reason.

<bool>true</bool>

LookupVideo

The LookupVideo API takes the following arguments:

Title (Required)
Parameter Type: String
The title to be looked up.
Subtitle (Optional)
Parameter Type: String
The subtitle to be looked up.
Inetref (Optional)
Parameter Type: String
The internet reference number to be looked up.
Season (Optional)
Parameter Type: Integer
The season to be looked up.
Episode (Optional)
Parameter Type: Integer
The episode number to be looked up.

Example Query:

http://BackendServerIP:6544/Video/LookupVideo?Title=Family%20Guy&Subtitle=Pilot

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<VideoLookupList version="1.0" serializerVersion="1.1">
<Count>1</Count>
<AsOf>2011-10-02T21:28:33</AsOf>
<Version>0.25.20110928-1</Version>
<ProtoVer>69</ProtoVer>
<VideoLookups>
    <VideoLookup>
        <Title>Family Guy</Title>
        <SubTitle></SubTitle>
        <Season>1</Season>
        <Episode>1</Episode>
        <Year>1999</Year>
        <Tagline></Tagline>
        Sick, twisted, politically incorrect and Freakin' Sweet animated series featuring the adventures of the dysfunctional Griffin family. Bumbling Peter and long-suffering Lois have three kids. Stewie (a brilliant but sadistic baby bent on killing his mother and taking over the world), Meg (the oldest, and is the most unpopular girl in town) and Chris (the middle kid, he's not very bright but has a passion for movies). The final member of the family is Brian - a talking dog and much more than a pet, he keeps Stewie in check whilst sipping Martinis and sorting through his own life issues.
        <Certification></Certification>
        <Inetref>75978</Inetref>
        <HomePage></HomePage>
        <ReleaseDate>1999-01-31T00:00:00</ReleaseDate>
        <UserRating>0</UserRating>
        <Length>0</Length>
        <Language>en</Language>
        <Countries/>
        <Popularity>0</Popularity>
        <Budget>0</Budget>
        <Revenue>0</Revenue>
        <IMDB>0182576</IMDB>
        <TMSRef>SH296001</TMSRef>
        <Artwork>
            <ArtworkItem>
                <Type>banner</Type>
                <Url>http://www.thetvdb.com/banners/graphical/75978-g.jpg</Url>
                <Thumbnail>http://www.thetvdb.com/banners/_cache/graphical/75978-g.jpg</Thumbnail>
                <Width>0</Width>
                <Height>0</Height>
            </ArtworkItem>
        </Artwork>
    </VideoLookup>
</VideoLookups>
</VideoLookupList>

GetBluray

The GetBluray API takes the following arguments:

Path (Required)
Parameter Type: String
The path to a Blu-ray drive or folder structure.

Example Query:

http://BackendServerIP:6544/Video/GetBluray?Path=/MythMedia/movies/Ratatouille

Example Return:

<?xml version="1.0" encoding="UTF-8"?>
<BlurayInfo version="1.0" serializerVersion="1.1">
    <Path>/MythMedia/movies/Ratatouille</Path>
    <Title>Ratatouille</Title>
    <AltTitle></AltTitle>
    <DiscLang>en</DiscLang>
    <DiscNum>0</DiscNum>
    <TotalDiscNum>0</TotalDiscNum>
    <TitleCount>0</TitleCount>
    <ThumbCount>0</ThumbCount>
    <ThumbPath></ThumbPath>
    <TopMenuSupported>true</TopMenuSupported>
    <FirstPlaySupported>true</FirstPlaySupported>
    <NumHDMVTitles>14</NumHDMVTitles>
    <NumBDJTitles>4</NumBDJTitles>
    <NumUnsupportedTitles>4</NumUnsupportedTitles>
    <AACSDetected>false</AACSDetected>
    <LibAACSDetected>false</LibAACSDetected>
    <AACSHandled>false</AACSHandled>
    <BDPlusDetected>false</BDPlusDetected>
    <LibBDPlusDetected>false</LibBDPlusDetected>
    <BDPlusHandled>false</BDPlusHandled>
</BlurayInfo>