-
Notifications
You must be signed in to change notification settings - Fork 5
Retrieving Images
There is a number of metadata elements which are available to the client.
If the program contains a boolean called "hasImageArtwork" and it is TRUE, this means that this particular program has artwork available, such as DVD coverart, stills from the program, title cards, etc.
{
"programID": "EP003851900001",
"titles": [
{
"title120": "Gilmore Girls"
}
],
"eventDetails": {
"subType": "Series"
},
"descriptions": {
"description100": [
{
"descriptionLanguage": "en",
"description": "A woman (Lauren Graham) endeavors to raise a daughter (Alexis Bledel) on her own."
}
],
"description1000": [
{
"descriptionLanguage": "en",
"description": "Lorelai must ask her estranged parents for financial help when her daughter, Rory, is accepted into a prestigious prep school."
}
]
},
"originalAirDate": "2000-10-05",
"genres": [
"Drama",
"Comedy"
],
"episodeTitle150": "Pilot",
"metadata": [
{
"Tribune": {
"season": 1,
"episode": 1
}
}
],
"cast": [
{
"personId": "68293",
"nameId": "68293",
"name": "Lauren Graham",
"role": "Actor",
"billingOrder": "01"
},
<snip>
],
"crew": [
{
"personId": "189517",
"nameId": "191244",
"name": "Amy Sherman-Palladino",
"role": "Executive Producer",
"billingOrder": "01"
},
<snip>
],
"showType": "Series",
"hasImageArtwork": true,
"md5": "jrdBFyHSsdymy3NNBme2aQ"
}
The available image artwork would then be accessed by using the following URL:
https://data2.schedulesdirect.org/20140530/metadata/programs/{leftmost 10 characters}
https://data2.schedulesdirect.org/20140530/metadata/programs/EP00385190
Which returns:
[
{
"uri": "assets/p184655_b_h3_aa.jpg",
"height": "270",
"width": "360",
"primary": "true",
"category": "Banner-L1",
"tier": "Series"
},
<snip>
]
To retrieve a particular image, use the URI:
https://data2.schedulesdirect.org/20140530/image/{uri}
So:
GET https://data2.schedulesdirect.org/20140530/image/assets/p184655_b_h3_aa.jpg
This will send your client a 303 redirect which it must follow in order to retrieve the actual image:
https://s3.amazonaws.com/schedulesdirect-API20140530/assets/p184655_b_h3_aa.jpg
NOTE: If the URI is already "complete" and contains the S3 URL, then your client should access S3 directly.
The program object also contains nameId and personId elements. The actor Lauren Graham has a nameId of 68293, so
GET https://data2.schedulesdirect.org/20140530/metadata/celebrity/68293
Returns
[
{
"uri": "assets/35605_aq.jpg",
"height": "288",
"width": "432",
"category": "Scene Still",
"caption": {
"content": "Billy Bob Thornton and Lauren Graham in Terry Zwigoff's BAD SANTA.",
"lang": "en"
},
"rootId": "33125",
"title": "Bad Santa"
},
<snip>
}
Your grabber may use the same /image/ call with the URI to retrieve that image:
https://data2.schedulesdirect.org/20140530/image/{uri}
https://data2.schedulesdirect.org/20140530/image/assets/35605_aq.jpg
The returned JSON may contain a "rootId". If it does, you may obtain information using:
https://data2.schedulesdirect.org/20140530/metadata/programs/{rootId}
GET https://data2.schedulesdirect.org/20140530/metadata/programs/33125
Which returns:
[
{
"uri": "movies/AllPhotos/35605/35605_aa.jpg",
"height": "432",
"width": "288",
"primary": "true",
"category": "Poster Art",
"caption": {
"content": "Poster Art",
"lang": "en"
}
},
{
"uri": "movies/AllPhotos/35605/35605_aa_t.jpg",
"height": "108",
"width": "72",
"primary": "true",
"category": "Poster Art",
"caption": {
"content": "Poster Art",
"lang": "en"
}
},
{
"uri": "assets/35605_ab.jpg",
"height": "288",
"width": "432",
"category": "Scene Still",
"caption": {
"content": "Billy Bob Thornton and Tony Cox in Terry Zwigoff's BAD SANTA.",
"lang": "en"
}
},
<snip>
Your grabber may use the same /image/ call with the URI to retrieve that image:
https://data2.schedulesdirect.org/20140530/image/{uri}
So: https://data2.schedulesdirect.org/20140530/image/movies/AllPhotos/35605/35605_aa.jpg