Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pbs

Search and play video content from PBS.org

There's not much here in the way of features or pizzazz. This is a dumb CLI tool that makes basic API calls; it doesn't even format the output nicely!

Installation

Installation is managed via the Makefile. The makefile just installs some python packages. It's simple.

git clone https://github.com/jgrasser/pbs.git
cd pbs
make install

Usage

API Documentation

Get Member Stations

Parameters

ParameterDescription
statecode2 character code for a US State. Examples include IL, CA, NY, etc.

Request

GET - https://jaws.pbs.org/localization/member/state/:statecode/

Response

{
"stations_list": [
{
"address": "Urbana, IL",
"callsign": "WILL",
"common_name": "Illinois Public Media",
"common_name_short": "WILL-TV",
"flagship": "WILL",
"membership_url": "https://willpledge.org/",
"pbs_id": "11bd36cd-46d5-4c3a-bdc8-ae497a23c712",
"pdp": false
},
...

Query PBS Shows

Parameters

ParameterDescription
pbs-id36 character identifier obtained from member station api call above

Request

POST - https://www.pbs.org/graphql

BODY

{
"operationName": "Shows",
"variables": {
"page": 0,
"genre": "all-genres",
"sortBy": "popular",
"source": "all-sources",
"stationId": :pbs-id,"title": "",
"alphabetically": false
},
"query": "query Shows($page: Int, $genre: String, $source: String, $stationId: String, $sortBy: String, $title: String, $alphabetically: Boolean) {shows(page: $page, genre: $genre, source: $source, stationId: $stationId, sortBy: $sortBy, title: $title, alphabetically: $alphabetically) {content { title genre description image url website cid __typename } meta { pageNumber totalPages totalResults __typename} stationCommonName __typename}}"
}

Response

{
"shows": [
{
"__typename": "Show",
"cid": "033db3e2-3d1f-4c0f-8cd7-746578cb74d8",
"description": "Since its launch in 2012, the PBS Online Film Festival has featured diverse films from PBS member stations and ITVS and POV. This year's festival includes collaborations with a wide variety of public television producers. Starting July 13, viewers can once again watch, vote and share their favorites. Find out how to vote for your favorites at pbs.org/filmfestival",
"genre": [
"indie-films"
],
"image": "https://image.pbs.org/contentchannels/XLtKO9n-show-poster2x3-H4SwmKp.jpg",
"title": "PBS Short Film Festival",
"url": "/show/pbs-online-film-festival/",
"website": "https://www.pbs.org/filmfestival"
},
...

Get Show Seasons

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.

Request

GET - https://www.pbs.org/show/:show-name/seasons-list/

Response

{
"content": [
{
"ancestor_slug": null,
"ancestor_title": null,
"ancestor_type": null,
"cid": "c0537bb4-2bf2-4876-82cd-cc3ac922a037",
"flags": {
"has_assets": true,
"has_episodes": true
},
"image": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg"
},
"item_type": "season",
"legacy_tp_media_id": null,
"ordinal": 47,
"parent_type": null,
"summary": "",
"title": "",
"title_sortable": "",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/shows/nova/seasons/c0537bb4-2bf2-4876-82cd-cc3ac922a037/"
},
...

Get Episodes in a Season

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.
season-cidUnique identifier for a season of a show. Reference output of seasons-list above.

Request

GET - https://www.pbs.org/show/:show-name/seasons/:season-cid/episodes/

Reponse

{
"content": [
{
"ancestor_slug": "nova",
"ancestor_title": "NOVA",
"ancestor_type": "show",
"availability": "available",
"cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2",
"description_long": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.",
"description_short": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.",
"duration": 3218,
"encore_date": "2020-05-13T00:00:00-04:00",
"expire_date": "2023-05-13T03:59:59Z",
"flags": {
"has_captions": true,
"is_expiring_soon": false,
"is_fully_watched": null,
"is_mvod": false,
"is_new": false
},
"image": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg"
},
"item_type": "video",
"legacy_tp_media_id": 3042320248,
"parent_type": "episode",
"premiere_date": "2020-05-13T00:00:00-04:00",
"seconds_watched": null,
"show": {
"display_episode_number": true,
"episode": 9,
"season": 47,
"seasons_count": 22,
"slug": "nova",
"title": "NOVA"
},
"slug": "decoding-covid-19-hrfhb2",
"summary": "S47 Ep9 | 53m 38s",
"title": "Decoding COVID-19",
"title_sortable": "Decoding COVID-19",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/video-assets/decoding-covid-19-hrfhb2/",
"video_type": "episode"
},
...

Get Rich Episode Video Data

Parameters

ParameterDescription
legacy-tp-media-idA video's legacy identifier. Used to fetch video metadata sent to JWPlayer.

Reqeust

GET - https://player.pbs.org/portalplayer/:legacy-tp-media-id/

Response

<!doctype html>
...
<body>
...
<script>window.staticUrl="/static/";window.contextBridge={"player_type": "portal_player","callsign": null,"user_id": "","country_id": "US","viewing_history": {},"player_framework": "Video.js","features": {"nielsen": false,"videojs": false}};window.videoBridge={"availability": "available","encodings": ["https://urs.pbs.org/redirect/ceb9dea094b04baf9ebb22f726712d09/","https://urs.pbs.org/redirect/4b3af54f7cda4fefa8459a99cd177333/"],"has_hls_encodings": true,"has_mp4_encodings": true,"cc": {"WebVTT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/kUfgWv_caption.vtt","SRT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/Thxrj1_caption.srt","DFXP": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/OCh5Ix_caption.dfxp","Caption-SAMI": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/3nJKHG_caption.sami"},"can_play_preroll": true,"image_url": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg","chapters": [],"mvod_info": {"show_mvod_icon": false,"show_upsell_overlay": false},"program": {"title": "NOVA","slug": "nova","producer": "PBS"},"related_videos": [{"id": 3042550069,"title": "Trailer","images": {"mezzanine": "https://image.pbs.org/video-assets/8XmGmaI-asset-mezzanine-16x9-vm5hyEc.jpg"},"program": {"funder_message": "Funding for MASTERPIECE is provided by Viking and Raymond James with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","cid": "31598537-8a0a-4441-95b0-6155d52dee28","audience": [{"station": null,"scope": "national"}],"display_episode_number": true,"title": "Grantchester","tracking_ga_page": "UA-3988763-1","seasons_count": 5,"tracking_ga_event": "UA-3988763-2","slug": "grantchester","resource_type": "show","franchise": {"funder_message": "Funding for MASTERPIECE is provided by Viking with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","title": "Masterpiece","cid": "e08bf78d-e6a3-44b9-b356-8753d01c7327","resource_type": "franchise","slug": "masterpiece"}},"slug": "trailer-1owamh"},{"id": 3039879374,"title": "Extended Trailer | The Vote | American Experience","images": {"mezzanine": "https://image.pbs.org/video-assets/zU2qsCH-asset-mezzanine-16x9-yCQVFSq.jpg"},"program": {"title": "Part 1 | The Vote | American Experience","ordinal": 9,"season": {"title": "","cid": "acf1d226-027a-4032-8cb9-56618eab2467","resource_type": "season","ordinal": 32,"show": {"tracking_ga_page": "UA-3988626-1","title": "American Experience","resource_type": "show","audience": [{"station": null,"scope": "national"}],"funder_message": "Corporate sponsorship for American Experience is provided by Liberty Mutual Insurance and Consumer Cellular. Major funding by the Alfred P. Sloan Foundation.","seasons_count": 30,"cid": "1b91e824-10a2-4c3e-b054-74f78fcddcc7","tracking_ga_event": "UA-3988626-2","slug": "american-experience","display_episode_number": true,"franchise": null}},"cid": "2bad0e1b-ead2-4eb4-9a27-3478d6bee182","resource_type": "episode","slug": "vote-part-1"},"slug": "trailer-vote-american-experience"},{"id": 3042347034,"title": "Preview","images": {"mezzanine": "https://image.pbs.org/video-assets/wPSEK08-asset-mezzanine-16x9-z2Gtd5J.jpg"},"program": {"tracking_ga_page": "","title": "Prehistoric Road Trip","resource_type": "show","audience": [{"station": null,"scope": "national"}],"seasons_count": 1,"tracking_ga_event": "","cid": "a1ddde11-3f9f-4ddd-ab9f-7ae25fab5d1c","funder_message": "","slug": "prehistoric-road-trip","display_episode_number": true,"franchise": null},"slug": "preview-wwhtpl"}],"member_stations": [],"video_type": "full_length","id": "3042320248","cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2","slug": "decoding-covid-19-hrfhb2","title": "Decoding COVID-19","short_description": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.","long_description": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.","series_info": "Season 47 Episode 9","duration": 3218,"air_date": "2020-05-13T00:00:00-04:00","air_date_formatted": "May 13th, 2020","air_date_nielsen": "20200513 00:00:00","expire_date": "2023-05-13T03:59:59Z","rating": null,"is_mvod": false,"allow_embed": true,"short_common_name": "","full_common_name": null,"station_color_logo": null,"donation_url": null,"passport_url": null,"passport_learn_more_url": null,"dvd_link": null,"itunes_link": null,"GA_events_codes": ["UA-3988832-2"],"GA_national_codes": ["UA-1996666-7"]};</script>
...
</body>

About

Search and play video content from PBS.org

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - jgrasser/pbs: Search and play video content from PBS.org · GitHub
Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pbs

Search and play video content from PBS.org

There's not much here in the way of features or pizzazz. This is a dumb CLI tool that makes basic API calls; it doesn't even format the output nicely!

Installation

Installation is managed via the Makefile. The makefile just installs some python packages. It's simple.

git clone https://github.com/jgrasser/pbs.git
cd pbs
make install

Usage

API Documentation

Get Member Stations

Parameters

ParameterDescription
statecode2 character code for a US State. Examples include IL, CA, NY, etc.

Request

GET - https://jaws.pbs.org/localization/member/state/:statecode/

Response

{
"stations_list": [
{
"address": "Urbana, IL",
"callsign": "WILL",
"common_name": "Illinois Public Media",
"common_name_short": "WILL-TV",
"flagship": "WILL",
"membership_url": "https://willpledge.org/",
"pbs_id": "11bd36cd-46d5-4c3a-bdc8-ae497a23c712",
"pdp": false
},
...

Query PBS Shows

Parameters

ParameterDescription
pbs-id36 character identifier obtained from member station api call above

Request

POST - https://www.pbs.org/graphql

BODY

{
"operationName": "Shows",
"variables": {
"page": 0,
"genre": "all-genres",
"sortBy": "popular",
"source": "all-sources",
"stationId": :pbs-id,"title": "",
"alphabetically": false
},
"query": "query Shows($page: Int, $genre: String, $source: String, $stationId: String, $sortBy: String, $title: String, $alphabetically: Boolean) {shows(page: $page, genre: $genre, source: $source, stationId: $stationId, sortBy: $sortBy, title: $title, alphabetically: $alphabetically) {content { title genre description image url website cid __typename } meta { pageNumber totalPages totalResults __typename} stationCommonName __typename}}"
}

Response

{
"shows": [
{
"__typename": "Show",
"cid": "033db3e2-3d1f-4c0f-8cd7-746578cb74d8",
"description": "Since its launch in 2012, the PBS Online Film Festival has featured diverse films from PBS member stations and ITVS and POV. This year's festival includes collaborations with a wide variety of public television producers. Starting July 13, viewers can once again watch, vote and share their favorites. Find out how to vote for your favorites at pbs.org/filmfestival",
"genre": [
"indie-films"
],
"image": "https://image.pbs.org/contentchannels/XLtKO9n-show-poster2x3-H4SwmKp.jpg",
"title": "PBS Short Film Festival",
"url": "/show/pbs-online-film-festival/",
"website": "https://www.pbs.org/filmfestival"
},
...

Get Show Seasons

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.

Request

GET - https://www.pbs.org/show/:show-name/seasons-list/

Response

{
"content": [
{
"ancestor_slug": null,
"ancestor_title": null,
"ancestor_type": null,
"cid": "c0537bb4-2bf2-4876-82cd-cc3ac922a037",
"flags": {
"has_assets": true,
"has_episodes": true
},
"image": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg"
},
"item_type": "season",
"legacy_tp_media_id": null,
"ordinal": 47,
"parent_type": null,
"summary": "",
"title": "",
"title_sortable": "",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/shows/nova/seasons/c0537bb4-2bf2-4876-82cd-cc3ac922a037/"
},
...

Get Episodes in a Season

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.
season-cidUnique identifier for a season of a show. Reference output of seasons-list above.

Request

GET - https://www.pbs.org/show/:show-name/seasons/:season-cid/episodes/

Reponse

{
"content": [
{
"ancestor_slug": "nova",
"ancestor_title": "NOVA",
"ancestor_type": "show",
"availability": "available",
"cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2",
"description_long": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.",
"description_short": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.",
"duration": 3218,
"encore_date": "2020-05-13T00:00:00-04:00",
"expire_date": "2023-05-13T03:59:59Z",
"flags": {
"has_captions": true,
"is_expiring_soon": false,
"is_fully_watched": null,
"is_mvod": false,
"is_new": false
},
"image": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg"
},
"item_type": "video",
"legacy_tp_media_id": 3042320248,
"parent_type": "episode",
"premiere_date": "2020-05-13T00:00:00-04:00",
"seconds_watched": null,
"show": {
"display_episode_number": true,
"episode": 9,
"season": 47,
"seasons_count": 22,
"slug": "nova",
"title": "NOVA"
},
"slug": "decoding-covid-19-hrfhb2",
"summary": "S47 Ep9 | 53m 38s",
"title": "Decoding COVID-19",
"title_sortable": "Decoding COVID-19",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/video-assets/decoding-covid-19-hrfhb2/",
"video_type": "episode"
},
...

Get Rich Episode Video Data

Parameters

ParameterDescription
legacy-tp-media-idA video's legacy identifier. Used to fetch video metadata sent to JWPlayer.

Reqeust

GET - https://player.pbs.org/portalplayer/:legacy-tp-media-id/

Response

<!doctype html>
...
<body>
...
<script>window.staticUrl="/static/";window.contextBridge={"player_type": "portal_player","callsign": null,"user_id": "","country_id": "US","viewing_history": {},"player_framework": "Video.js","features": {"nielsen": false,"videojs": false}};window.videoBridge={"availability": "available","encodings": ["https://urs.pbs.org/redirect/ceb9dea094b04baf9ebb22f726712d09/","https://urs.pbs.org/redirect/4b3af54f7cda4fefa8459a99cd177333/"],"has_hls_encodings": true,"has_mp4_encodings": true,"cc": {"WebVTT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/kUfgWv_caption.vtt","SRT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/Thxrj1_caption.srt","DFXP": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/OCh5Ix_caption.dfxp","Caption-SAMI": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/3nJKHG_caption.sami"},"can_play_preroll": true,"image_url": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg","chapters": [],"mvod_info": {"show_mvod_icon": false,"show_upsell_overlay": false},"program": {"title": "NOVA","slug": "nova","producer": "PBS"},"related_videos": [{"id": 3042550069,"title": "Trailer","images": {"mezzanine": "https://image.pbs.org/video-assets/8XmGmaI-asset-mezzanine-16x9-vm5hyEc.jpg"},"program": {"funder_message": "Funding for MASTERPIECE is provided by Viking and Raymond James with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","cid": "31598537-8a0a-4441-95b0-6155d52dee28","audience": [{"station": null,"scope": "national"}],"display_episode_number": true,"title": "Grantchester","tracking_ga_page": "UA-3988763-1","seasons_count": 5,"tracking_ga_event": "UA-3988763-2","slug": "grantchester","resource_type": "show","franchise": {"funder_message": "Funding for MASTERPIECE is provided by Viking with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","title": "Masterpiece","cid": "e08bf78d-e6a3-44b9-b356-8753d01c7327","resource_type": "franchise","slug": "masterpiece"}},"slug": "trailer-1owamh"},{"id": 3039879374,"title": "Extended Trailer | The Vote | American Experience","images": {"mezzanine": "https://image.pbs.org/video-assets/zU2qsCH-asset-mezzanine-16x9-yCQVFSq.jpg"},"program": {"title": "Part 1 | The Vote | American Experience","ordinal": 9,"season": {"title": "","cid": "acf1d226-027a-4032-8cb9-56618eab2467","resource_type": "season","ordinal": 32,"show": {"tracking_ga_page": "UA-3988626-1","title": "American Experience","resource_type": "show","audience": [{"station": null,"scope": "national"}],"funder_message": "Corporate sponsorship for American Experience is provided by Liberty Mutual Insurance and Consumer Cellular. Major funding by the Alfred P. Sloan Foundation.","seasons_count": 30,"cid": "1b91e824-10a2-4c3e-b054-74f78fcddcc7","tracking_ga_event": "UA-3988626-2","slug": "american-experience","display_episode_number": true,"franchise": null}},"cid": "2bad0e1b-ead2-4eb4-9a27-3478d6bee182","resource_type": "episode","slug": "vote-part-1"},"slug": "trailer-vote-american-experience"},{"id": 3042347034,"title": "Preview","images": {"mezzanine": "https://image.pbs.org/video-assets/wPSEK08-asset-mezzanine-16x9-z2Gtd5J.jpg"},"program": {"tracking_ga_page": "","title": "Prehistoric Road Trip","resource_type": "show","audience": [{"station": null,"scope": "national"}],"seasons_count": 1,"tracking_ga_event": "","cid": "a1ddde11-3f9f-4ddd-ab9f-7ae25fab5d1c","funder_message": "","slug": "prehistoric-road-trip","display_episode_number": true,"franchise": null},"slug": "preview-wwhtpl"}],"member_stations": [],"video_type": "full_length","id": "3042320248","cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2","slug": "decoding-covid-19-hrfhb2","title": "Decoding COVID-19","short_description": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.","long_description": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.","series_info": "Season 47 Episode 9","duration": 3218,"air_date": "2020-05-13T00:00:00-04:00","air_date_formatted": "May 13th, 2020","air_date_nielsen": "20200513 00:00:00","expire_date": "2023-05-13T03:59:59Z","rating": null,"is_mvod": false,"allow_embed": true,"short_common_name": "","full_common_name": null,"station_color_logo": null,"donation_url": null,"passport_url": null,"passport_learn_more_url": null,"dvd_link": null,"itunes_link": null,"GA_events_codes": ["UA-3988832-2"],"GA_national_codes": ["UA-1996666-7"]};</script>
...
</body>

About

Search and play video content from PBS.org

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - jgrasser/pbs: Search and play video content from PBS.org · GitHub
Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pbs

Search and play video content from PBS.org

There's not much here in the way of features or pizzazz. This is a dumb CLI tool that makes basic API calls; it doesn't even format the output nicely!

Installation

Installation is managed via the Makefile. The makefile just installs some python packages. It's simple.

git clone https://github.com/jgrasser/pbs.git
cd pbs
make install

Usage

API Documentation

Get Member Stations

Parameters

ParameterDescription
statecode2 character code for a US State. Examples include IL, CA, NY, etc.

Request

GET - https://jaws.pbs.org/localization/member/state/:statecode/

Response

{
"stations_list": [
{
"address": "Urbana, IL",
"callsign": "WILL",
"common_name": "Illinois Public Media",
"common_name_short": "WILL-TV",
"flagship": "WILL",
"membership_url": "https://willpledge.org/",
"pbs_id": "11bd36cd-46d5-4c3a-bdc8-ae497a23c712",
"pdp": false
},
...

Query PBS Shows

Parameters

ParameterDescription
pbs-id36 character identifier obtained from member station api call above

Request

POST - https://www.pbs.org/graphql

BODY

{
"operationName": "Shows",
"variables": {
"page": 0,
"genre": "all-genres",
"sortBy": "popular",
"source": "all-sources",
"stationId": :pbs-id,"title": "",
"alphabetically": false
},
"query": "query Shows($page: Int, $genre: String, $source: String, $stationId: String, $sortBy: String, $title: String, $alphabetically: Boolean) {shows(page: $page, genre: $genre, source: $source, stationId: $stationId, sortBy: $sortBy, title: $title, alphabetically: $alphabetically) {content { title genre description image url website cid __typename } meta { pageNumber totalPages totalResults __typename} stationCommonName __typename}}"
}

Response

{
"shows": [
{
"__typename": "Show",
"cid": "033db3e2-3d1f-4c0f-8cd7-746578cb74d8",
"description": "Since its launch in 2012, the PBS Online Film Festival has featured diverse films from PBS member stations and ITVS and POV. This year's festival includes collaborations with a wide variety of public television producers. Starting July 13, viewers can once again watch, vote and share their favorites. Find out how to vote for your favorites at pbs.org/filmfestival",
"genre": [
"indie-films"
],
"image": "https://image.pbs.org/contentchannels/XLtKO9n-show-poster2x3-H4SwmKp.jpg",
"title": "PBS Short Film Festival",
"url": "/show/pbs-online-film-festival/",
"website": "https://www.pbs.org/filmfestival"
},
...

Get Show Seasons

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.

Request

GET - https://www.pbs.org/show/:show-name/seasons-list/

Response

{
"content": [
{
"ancestor_slug": null,
"ancestor_title": null,
"ancestor_type": null,
"cid": "c0537bb4-2bf2-4876-82cd-cc3ac922a037",
"flags": {
"has_assets": true,
"has_episodes": true
},
"image": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg"
},
"item_type": "season",
"legacy_tp_media_id": null,
"ordinal": 47,
"parent_type": null,
"summary": "",
"title": "",
"title_sortable": "",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/shows/nova/seasons/c0537bb4-2bf2-4876-82cd-cc3ac922a037/"
},
...

Get Episodes in a Season

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.
season-cidUnique identifier for a season of a show. Reference output of seasons-list above.

Request

GET - https://www.pbs.org/show/:show-name/seasons/:season-cid/episodes/

Reponse

{
"content": [
{
"ancestor_slug": "nova",
"ancestor_title": "NOVA",
"ancestor_type": "show",
"availability": "available",
"cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2",
"description_long": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.",
"description_short": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.",
"duration": 3218,
"encore_date": "2020-05-13T00:00:00-04:00",
"expire_date": "2023-05-13T03:59:59Z",
"flags": {
"has_captions": true,
"is_expiring_soon": false,
"is_fully_watched": null,
"is_mvod": false,
"is_new": false
},
"image": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg"
},
"item_type": "video",
"legacy_tp_media_id": 3042320248,
"parent_type": "episode",
"premiere_date": "2020-05-13T00:00:00-04:00",
"seconds_watched": null,
"show": {
"display_episode_number": true,
"episode": 9,
"season": 47,
"seasons_count": 22,
"slug": "nova",
"title": "NOVA"
},
"slug": "decoding-covid-19-hrfhb2",
"summary": "S47 Ep9 | 53m 38s",
"title": "Decoding COVID-19",
"title_sortable": "Decoding COVID-19",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/video-assets/decoding-covid-19-hrfhb2/",
"video_type": "episode"
},
...

Get Rich Episode Video Data

Parameters

ParameterDescription
legacy-tp-media-idA video's legacy identifier. Used to fetch video metadata sent to JWPlayer.

Reqeust

GET - https://player.pbs.org/portalplayer/:legacy-tp-media-id/

Response

<!doctype html>
...
<body>
...
<script>window.staticUrl="/static/";window.contextBridge={"player_type": "portal_player","callsign": null,"user_id": "","country_id": "US","viewing_history": {},"player_framework": "Video.js","features": {"nielsen": false,"videojs": false}};window.videoBridge={"availability": "available","encodings": ["https://urs.pbs.org/redirect/ceb9dea094b04baf9ebb22f726712d09/","https://urs.pbs.org/redirect/4b3af54f7cda4fefa8459a99cd177333/"],"has_hls_encodings": true,"has_mp4_encodings": true,"cc": {"WebVTT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/kUfgWv_caption.vtt","SRT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/Thxrj1_caption.srt","DFXP": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/OCh5Ix_caption.dfxp","Caption-SAMI": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/3nJKHG_caption.sami"},"can_play_preroll": true,"image_url": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg","chapters": [],"mvod_info": {"show_mvod_icon": false,"show_upsell_overlay": false},"program": {"title": "NOVA","slug": "nova","producer": "PBS"},"related_videos": [{"id": 3042550069,"title": "Trailer","images": {"mezzanine": "https://image.pbs.org/video-assets/8XmGmaI-asset-mezzanine-16x9-vm5hyEc.jpg"},"program": {"funder_message": "Funding for MASTERPIECE is provided by Viking and Raymond James with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","cid": "31598537-8a0a-4441-95b0-6155d52dee28","audience": [{"station": null,"scope": "national"}],"display_episode_number": true,"title": "Grantchester","tracking_ga_page": "UA-3988763-1","seasons_count": 5,"tracking_ga_event": "UA-3988763-2","slug": "grantchester","resource_type": "show","franchise": {"funder_message": "Funding for MASTERPIECE is provided by Viking with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","title": "Masterpiece","cid": "e08bf78d-e6a3-44b9-b356-8753d01c7327","resource_type": "franchise","slug": "masterpiece"}},"slug": "trailer-1owamh"},{"id": 3039879374,"title": "Extended Trailer | The Vote | American Experience","images": {"mezzanine": "https://image.pbs.org/video-assets/zU2qsCH-asset-mezzanine-16x9-yCQVFSq.jpg"},"program": {"title": "Part 1 | The Vote | American Experience","ordinal": 9,"season": {"title": "","cid": "acf1d226-027a-4032-8cb9-56618eab2467","resource_type": "season","ordinal": 32,"show": {"tracking_ga_page": "UA-3988626-1","title": "American Experience","resource_type": "show","audience": [{"station": null,"scope": "national"}],"funder_message": "Corporate sponsorship for American Experience is provided by Liberty Mutual Insurance and Consumer Cellular. Major funding by the Alfred P. Sloan Foundation.","seasons_count": 30,"cid": "1b91e824-10a2-4c3e-b054-74f78fcddcc7","tracking_ga_event": "UA-3988626-2","slug": "american-experience","display_episode_number": true,"franchise": null}},"cid": "2bad0e1b-ead2-4eb4-9a27-3478d6bee182","resource_type": "episode","slug": "vote-part-1"},"slug": "trailer-vote-american-experience"},{"id": 3042347034,"title": "Preview","images": {"mezzanine": "https://image.pbs.org/video-assets/wPSEK08-asset-mezzanine-16x9-z2Gtd5J.jpg"},"program": {"tracking_ga_page": "","title": "Prehistoric Road Trip","resource_type": "show","audience": [{"station": null,"scope": "national"}],"seasons_count": 1,"tracking_ga_event": "","cid": "a1ddde11-3f9f-4ddd-ab9f-7ae25fab5d1c","funder_message": "","slug": "prehistoric-road-trip","display_episode_number": true,"franchise": null},"slug": "preview-wwhtpl"}],"member_stations": [],"video_type": "full_length","id": "3042320248","cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2","slug": "decoding-covid-19-hrfhb2","title": "Decoding COVID-19","short_description": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.","long_description": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.","series_info": "Season 47 Episode 9","duration": 3218,"air_date": "2020-05-13T00:00:00-04:00","air_date_formatted": "May 13th, 2020","air_date_nielsen": "20200513 00:00:00","expire_date": "2023-05-13T03:59:59Z","rating": null,"is_mvod": false,"allow_embed": true,"short_common_name": "","full_common_name": null,"station_color_logo": null,"donation_url": null,"passport_url": null,"passport_learn_more_url": null,"dvd_link": null,"itunes_link": null,"GA_events_codes": ["UA-3988832-2"],"GA_national_codes": ["UA-1996666-7"]};</script>
...
</body>

About

Search and play video content from PBS.org

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - jgrasser/pbs: Search and play video content from PBS.org · GitHub
Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pbs

Search and play video content from PBS.org

There's not much here in the way of features or pizzazz. This is a dumb CLI tool that makes basic API calls; it doesn't even format the output nicely!

Installation

Installation is managed via the Makefile. The makefile just installs some python packages. It's simple.

git clone https://github.com/jgrasser/pbs.git
cd pbs
make install

Usage

API Documentation

Get Member Stations

Parameters

ParameterDescription
statecode2 character code for a US State. Examples include IL, CA, NY, etc.

Request

GET - https://jaws.pbs.org/localization/member/state/:statecode/

Response

{
"stations_list": [
{
"address": "Urbana, IL",
"callsign": "WILL",
"common_name": "Illinois Public Media",
"common_name_short": "WILL-TV",
"flagship": "WILL",
"membership_url": "https://willpledge.org/",
"pbs_id": "11bd36cd-46d5-4c3a-bdc8-ae497a23c712",
"pdp": false
},
...

Query PBS Shows

Parameters

ParameterDescription
pbs-id36 character identifier obtained from member station api call above

Request

POST - https://www.pbs.org/graphql

BODY

{
"operationName": "Shows",
"variables": {
"page": 0,
"genre": "all-genres",
"sortBy": "popular",
"source": "all-sources",
"stationId": :pbs-id,"title": "",
"alphabetically": false
},
"query": "query Shows($page: Int, $genre: String, $source: String, $stationId: String, $sortBy: String, $title: String, $alphabetically: Boolean) {shows(page: $page, genre: $genre, source: $source, stationId: $stationId, sortBy: $sortBy, title: $title, alphabetically: $alphabetically) {content { title genre description image url website cid __typename } meta { pageNumber totalPages totalResults __typename} stationCommonName __typename}}"
}

Response

{
"shows": [
{
"__typename": "Show",
"cid": "033db3e2-3d1f-4c0f-8cd7-746578cb74d8",
"description": "Since its launch in 2012, the PBS Online Film Festival has featured diverse films from PBS member stations and ITVS and POV. This year's festival includes collaborations with a wide variety of public television producers. Starting July 13, viewers can once again watch, vote and share their favorites. Find out how to vote for your favorites at pbs.org/filmfestival",
"genre": [
"indie-films"
],
"image": "https://image.pbs.org/contentchannels/XLtKO9n-show-poster2x3-H4SwmKp.jpg",
"title": "PBS Short Film Festival",
"url": "/show/pbs-online-film-festival/",
"website": "https://www.pbs.org/filmfestival"
},
...

Get Show Seasons

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.

Request

GET - https://www.pbs.org/show/:show-name/seasons-list/

Response

{
"content": [
{
"ancestor_slug": null,
"ancestor_title": null,
"ancestor_type": null,
"cid": "c0537bb4-2bf2-4876-82cd-cc3ac922a037",
"flags": {
"has_assets": true,
"has_episodes": true
},
"image": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg"
},
"item_type": "season",
"legacy_tp_media_id": null,
"ordinal": 47,
"parent_type": null,
"summary": "",
"title": "",
"title_sortable": "",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/shows/nova/seasons/c0537bb4-2bf2-4876-82cd-cc3ac922a037/"
},
...

Get Episodes in a Season

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.
season-cidUnique identifier for a season of a show. Reference output of seasons-list above.

Request

GET - https://www.pbs.org/show/:show-name/seasons/:season-cid/episodes/

Reponse

{
"content": [
{
"ancestor_slug": "nova",
"ancestor_title": "NOVA",
"ancestor_type": "show",
"availability": "available",
"cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2",
"description_long": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.",
"description_short": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.",
"duration": 3218,
"encore_date": "2020-05-13T00:00:00-04:00",
"expire_date": "2023-05-13T03:59:59Z",
"flags": {
"has_captions": true,
"is_expiring_soon": false,
"is_fully_watched": null,
"is_mvod": false,
"is_new": false
},
"image": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg"
},
"item_type": "video",
"legacy_tp_media_id": 3042320248,
"parent_type": "episode",
"premiere_date": "2020-05-13T00:00:00-04:00",
"seconds_watched": null,
"show": {
"display_episode_number": true,
"episode": 9,
"season": 47,
"seasons_count": 22,
"slug": "nova",
"title": "NOVA"
},
"slug": "decoding-covid-19-hrfhb2",
"summary": "S47 Ep9 | 53m 38s",
"title": "Decoding COVID-19",
"title_sortable": "Decoding COVID-19",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/video-assets/decoding-covid-19-hrfhb2/",
"video_type": "episode"
},
...

Get Rich Episode Video Data

Parameters

ParameterDescription
legacy-tp-media-idA video's legacy identifier. Used to fetch video metadata sent to JWPlayer.

Reqeust

GET - https://player.pbs.org/portalplayer/:legacy-tp-media-id/

Response

<!doctype html>
...
<body>
...
<script>window.staticUrl="/static/";window.contextBridge={"player_type": "portal_player","callsign": null,"user_id": "","country_id": "US","viewing_history": {},"player_framework": "Video.js","features": {"nielsen": false,"videojs": false}};window.videoBridge={"availability": "available","encodings": ["https://urs.pbs.org/redirect/ceb9dea094b04baf9ebb22f726712d09/","https://urs.pbs.org/redirect/4b3af54f7cda4fefa8459a99cd177333/"],"has_hls_encodings": true,"has_mp4_encodings": true,"cc": {"WebVTT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/kUfgWv_caption.vtt","SRT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/Thxrj1_caption.srt","DFXP": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/OCh5Ix_caption.dfxp","Caption-SAMI": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/3nJKHG_caption.sami"},"can_play_preroll": true,"image_url": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg","chapters": [],"mvod_info": {"show_mvod_icon": false,"show_upsell_overlay": false},"program": {"title": "NOVA","slug": "nova","producer": "PBS"},"related_videos": [{"id": 3042550069,"title": "Trailer","images": {"mezzanine": "https://image.pbs.org/video-assets/8XmGmaI-asset-mezzanine-16x9-vm5hyEc.jpg"},"program": {"funder_message": "Funding for MASTERPIECE is provided by Viking and Raymond James with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","cid": "31598537-8a0a-4441-95b0-6155d52dee28","audience": [{"station": null,"scope": "national"}],"display_episode_number": true,"title": "Grantchester","tracking_ga_page": "UA-3988763-1","seasons_count": 5,"tracking_ga_event": "UA-3988763-2","slug": "grantchester","resource_type": "show","franchise": {"funder_message": "Funding for MASTERPIECE is provided by Viking with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","title": "Masterpiece","cid": "e08bf78d-e6a3-44b9-b356-8753d01c7327","resource_type": "franchise","slug": "masterpiece"}},"slug": "trailer-1owamh"},{"id": 3039879374,"title": "Extended Trailer | The Vote | American Experience","images": {"mezzanine": "https://image.pbs.org/video-assets/zU2qsCH-asset-mezzanine-16x9-yCQVFSq.jpg"},"program": {"title": "Part 1 | The Vote | American Experience","ordinal": 9,"season": {"title": "","cid": "acf1d226-027a-4032-8cb9-56618eab2467","resource_type": "season","ordinal": 32,"show": {"tracking_ga_page": "UA-3988626-1","title": "American Experience","resource_type": "show","audience": [{"station": null,"scope": "national"}],"funder_message": "Corporate sponsorship for American Experience is provided by Liberty Mutual Insurance and Consumer Cellular. Major funding by the Alfred P. Sloan Foundation.","seasons_count": 30,"cid": "1b91e824-10a2-4c3e-b054-74f78fcddcc7","tracking_ga_event": "UA-3988626-2","slug": "american-experience","display_episode_number": true,"franchise": null}},"cid": "2bad0e1b-ead2-4eb4-9a27-3478d6bee182","resource_type": "episode","slug": "vote-part-1"},"slug": "trailer-vote-american-experience"},{"id": 3042347034,"title": "Preview","images": {"mezzanine": "https://image.pbs.org/video-assets/wPSEK08-asset-mezzanine-16x9-z2Gtd5J.jpg"},"program": {"tracking_ga_page": "","title": "Prehistoric Road Trip","resource_type": "show","audience": [{"station": null,"scope": "national"}],"seasons_count": 1,"tracking_ga_event": "","cid": "a1ddde11-3f9f-4ddd-ab9f-7ae25fab5d1c","funder_message": "","slug": "prehistoric-road-trip","display_episode_number": true,"franchise": null},"slug": "preview-wwhtpl"}],"member_stations": [],"video_type": "full_length","id": "3042320248","cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2","slug": "decoding-covid-19-hrfhb2","title": "Decoding COVID-19","short_description": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.","long_description": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.","series_info": "Season 47 Episode 9","duration": 3218,"air_date": "2020-05-13T00:00:00-04:00","air_date_formatted": "May 13th, 2020","air_date_nielsen": "20200513 00:00:00","expire_date": "2023-05-13T03:59:59Z","rating": null,"is_mvod": false,"allow_embed": true,"short_common_name": "","full_common_name": null,"station_color_logo": null,"donation_url": null,"passport_url": null,"passport_learn_more_url": null,"dvd_link": null,"itunes_link": null,"GA_events_codes": ["UA-3988832-2"],"GA_national_codes": ["UA-1996666-7"]};</script>
...
</body>

About

Search and play video content from PBS.org

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - jgrasser/pbs: Search and play video content from PBS.org · GitHub
Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pbs

Search and play video content from PBS.org

There's not much here in the way of features or pizzazz. This is a dumb CLI tool that makes basic API calls; it doesn't even format the output nicely!

Installation

Installation is managed via the Makefile. The makefile just installs some python packages. It's simple.

git clone https://github.com/jgrasser/pbs.git
cd pbs
make install

Usage

API Documentation

Get Member Stations

Parameters

ParameterDescription
statecode2 character code for a US State. Examples include IL, CA, NY, etc.

Request

GET - https://jaws.pbs.org/localization/member/state/:statecode/

Response

{
"stations_list": [
{
"address": "Urbana, IL",
"callsign": "WILL",
"common_name": "Illinois Public Media",
"common_name_short": "WILL-TV",
"flagship": "WILL",
"membership_url": "https://willpledge.org/",
"pbs_id": "11bd36cd-46d5-4c3a-bdc8-ae497a23c712",
"pdp": false
},
...

Query PBS Shows

Parameters

ParameterDescription
pbs-id36 character identifier obtained from member station api call above

Request

POST - https://www.pbs.org/graphql

BODY

{
"operationName": "Shows",
"variables": {
"page": 0,
"genre": "all-genres",
"sortBy": "popular",
"source": "all-sources",
"stationId": :pbs-id,"title": "",
"alphabetically": false
},
"query": "query Shows($page: Int, $genre: String, $source: String, $stationId: String, $sortBy: String, $title: String, $alphabetically: Boolean) {shows(page: $page, genre: $genre, source: $source, stationId: $stationId, sortBy: $sortBy, title: $title, alphabetically: $alphabetically) {content { title genre description image url website cid __typename } meta { pageNumber totalPages totalResults __typename} stationCommonName __typename}}"
}

Response

{
"shows": [
{
"__typename": "Show",
"cid": "033db3e2-3d1f-4c0f-8cd7-746578cb74d8",
"description": "Since its launch in 2012, the PBS Online Film Festival has featured diverse films from PBS member stations and ITVS and POV. This year's festival includes collaborations with a wide variety of public television producers. Starting July 13, viewers can once again watch, vote and share their favorites. Find out how to vote for your favorites at pbs.org/filmfestival",
"genre": [
"indie-films"
],
"image": "https://image.pbs.org/contentchannels/XLtKO9n-show-poster2x3-H4SwmKp.jpg",
"title": "PBS Short Film Festival",
"url": "/show/pbs-online-film-festival/",
"website": "https://www.pbs.org/filmfestival"
},
...

Get Show Seasons

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.

Request

GET - https://www.pbs.org/show/:show-name/seasons-list/

Response

{
"content": [
{
"ancestor_slug": null,
"ancestor_title": null,
"ancestor_type": null,
"cid": "c0537bb4-2bf2-4876-82cd-cc3ac922a037",
"flags": {
"has_assets": true,
"has_episodes": true
},
"image": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg"
},
"item_type": "season",
"legacy_tp_media_id": null,
"ordinal": 47,
"parent_type": null,
"summary": "",
"title": "",
"title_sortable": "",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/shows/nova/seasons/c0537bb4-2bf2-4876-82cd-cc3ac922a037/"
},
...

Get Episodes in a Season

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.
season-cidUnique identifier for a season of a show. Reference output of seasons-list above.

Request

GET - https://www.pbs.org/show/:show-name/seasons/:season-cid/episodes/

Reponse

{
"content": [
{
"ancestor_slug": "nova",
"ancestor_title": "NOVA",
"ancestor_type": "show",
"availability": "available",
"cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2",
"description_long": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.",
"description_short": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.",
"duration": 3218,
"encore_date": "2020-05-13T00:00:00-04:00",
"expire_date": "2023-05-13T03:59:59Z",
"flags": {
"has_captions": true,
"is_expiring_soon": false,
"is_fully_watched": null,
"is_mvod": false,
"is_new": false
},
"image": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg"
},
"item_type": "video",
"legacy_tp_media_id": 3042320248,
"parent_type": "episode",
"premiere_date": "2020-05-13T00:00:00-04:00",
"seconds_watched": null,
"show": {
"display_episode_number": true,
"episode": 9,
"season": 47,
"seasons_count": 22,
"slug": "nova",
"title": "NOVA"
},
"slug": "decoding-covid-19-hrfhb2",
"summary": "S47 Ep9 | 53m 38s",
"title": "Decoding COVID-19",
"title_sortable": "Decoding COVID-19",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/video-assets/decoding-covid-19-hrfhb2/",
"video_type": "episode"
},
...

Get Rich Episode Video Data

Parameters

ParameterDescription
legacy-tp-media-idA video's legacy identifier. Used to fetch video metadata sent to JWPlayer.

Reqeust

GET - https://player.pbs.org/portalplayer/:legacy-tp-media-id/

Response

<!doctype html>
...
<body>
...
<script>window.staticUrl="/static/";window.contextBridge={"player_type": "portal_player","callsign": null,"user_id": "","country_id": "US","viewing_history": {},"player_framework": "Video.js","features": {"nielsen": false,"videojs": false}};window.videoBridge={"availability": "available","encodings": ["https://urs.pbs.org/redirect/ceb9dea094b04baf9ebb22f726712d09/","https://urs.pbs.org/redirect/4b3af54f7cda4fefa8459a99cd177333/"],"has_hls_encodings": true,"has_mp4_encodings": true,"cc": {"WebVTT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/kUfgWv_caption.vtt","SRT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/Thxrj1_caption.srt","DFXP": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/OCh5Ix_caption.dfxp","Caption-SAMI": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/3nJKHG_caption.sami"},"can_play_preroll": true,"image_url": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg","chapters": [],"mvod_info": {"show_mvod_icon": false,"show_upsell_overlay": false},"program": {"title": "NOVA","slug": "nova","producer": "PBS"},"related_videos": [{"id": 3042550069,"title": "Trailer","images": {"mezzanine": "https://image.pbs.org/video-assets/8XmGmaI-asset-mezzanine-16x9-vm5hyEc.jpg"},"program": {"funder_message": "Funding for MASTERPIECE is provided by Viking and Raymond James with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","cid": "31598537-8a0a-4441-95b0-6155d52dee28","audience": [{"station": null,"scope": "national"}],"display_episode_number": true,"title": "Grantchester","tracking_ga_page": "UA-3988763-1","seasons_count": 5,"tracking_ga_event": "UA-3988763-2","slug": "grantchester","resource_type": "show","franchise": {"funder_message": "Funding for MASTERPIECE is provided by Viking with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","title": "Masterpiece","cid": "e08bf78d-e6a3-44b9-b356-8753d01c7327","resource_type": "franchise","slug": "masterpiece"}},"slug": "trailer-1owamh"},{"id": 3039879374,"title": "Extended Trailer | The Vote | American Experience","images": {"mezzanine": "https://image.pbs.org/video-assets/zU2qsCH-asset-mezzanine-16x9-yCQVFSq.jpg"},"program": {"title": "Part 1 | The Vote | American Experience","ordinal": 9,"season": {"title": "","cid": "acf1d226-027a-4032-8cb9-56618eab2467","resource_type": "season","ordinal": 32,"show": {"tracking_ga_page": "UA-3988626-1","title": "American Experience","resource_type": "show","audience": [{"station": null,"scope": "national"}],"funder_message": "Corporate sponsorship for American Experience is provided by Liberty Mutual Insurance and Consumer Cellular. Major funding by the Alfred P. Sloan Foundation.","seasons_count": 30,"cid": "1b91e824-10a2-4c3e-b054-74f78fcddcc7","tracking_ga_event": "UA-3988626-2","slug": "american-experience","display_episode_number": true,"franchise": null}},"cid": "2bad0e1b-ead2-4eb4-9a27-3478d6bee182","resource_type": "episode","slug": "vote-part-1"},"slug": "trailer-vote-american-experience"},{"id": 3042347034,"title": "Preview","images": {"mezzanine": "https://image.pbs.org/video-assets/wPSEK08-asset-mezzanine-16x9-z2Gtd5J.jpg"},"program": {"tracking_ga_page": "","title": "Prehistoric Road Trip","resource_type": "show","audience": [{"station": null,"scope": "national"}],"seasons_count": 1,"tracking_ga_event": "","cid": "a1ddde11-3f9f-4ddd-ab9f-7ae25fab5d1c","funder_message": "","slug": "prehistoric-road-trip","display_episode_number": true,"franchise": null},"slug": "preview-wwhtpl"}],"member_stations": [],"video_type": "full_length","id": "3042320248","cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2","slug": "decoding-covid-19-hrfhb2","title": "Decoding COVID-19","short_description": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.","long_description": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.","series_info": "Season 47 Episode 9","duration": 3218,"air_date": "2020-05-13T00:00:00-04:00","air_date_formatted": "May 13th, 2020","air_date_nielsen": "20200513 00:00:00","expire_date": "2023-05-13T03:59:59Z","rating": null,"is_mvod": false,"allow_embed": true,"short_common_name": "","full_common_name": null,"station_color_logo": null,"donation_url": null,"passport_url": null,"passport_learn_more_url": null,"dvd_link": null,"itunes_link": null,"GA_events_codes": ["UA-3988832-2"],"GA_national_codes": ["UA-1996666-7"]};</script>
...
</body>

About

Search and play video content from PBS.org

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - jgrasser/pbs: Search and play video content from PBS.org · GitHub
Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pbs

Search and play video content from PBS.org

There's not much here in the way of features or pizzazz. This is a dumb CLI tool that makes basic API calls; it doesn't even format the output nicely!

Installation

Installation is managed via the Makefile. The makefile just installs some python packages. It's simple.

git clone https://github.com/jgrasser/pbs.git
cd pbs
make install

Usage

API Documentation

Get Member Stations

Parameters

ParameterDescription
statecode2 character code for a US State. Examples include IL, CA, NY, etc.

Request

GET - https://jaws.pbs.org/localization/member/state/:statecode/

Response

{
"stations_list": [
{
"address": "Urbana, IL",
"callsign": "WILL",
"common_name": "Illinois Public Media",
"common_name_short": "WILL-TV",
"flagship": "WILL",
"membership_url": "https://willpledge.org/",
"pbs_id": "11bd36cd-46d5-4c3a-bdc8-ae497a23c712",
"pdp": false
},
...

Query PBS Shows

Parameters

ParameterDescription
pbs-id36 character identifier obtained from member station api call above

Request

POST - https://www.pbs.org/graphql

BODY

{
"operationName": "Shows",
"variables": {
"page": 0,
"genre": "all-genres",
"sortBy": "popular",
"source": "all-sources",
"stationId": :pbs-id,"title": "",
"alphabetically": false
},
"query": "query Shows($page: Int, $genre: String, $source: String, $stationId: String, $sortBy: String, $title: String, $alphabetically: Boolean) {shows(page: $page, genre: $genre, source: $source, stationId: $stationId, sortBy: $sortBy, title: $title, alphabetically: $alphabetically) {content { title genre description image url website cid __typename } meta { pageNumber totalPages totalResults __typename} stationCommonName __typename}}"
}

Response

{
"shows": [
{
"__typename": "Show",
"cid": "033db3e2-3d1f-4c0f-8cd7-746578cb74d8",
"description": "Since its launch in 2012, the PBS Online Film Festival has featured diverse films from PBS member stations and ITVS and POV. This year's festival includes collaborations with a wide variety of public television producers. Starting July 13, viewers can once again watch, vote and share their favorites. Find out how to vote for your favorites at pbs.org/filmfestival",
"genre": [
"indie-films"
],
"image": "https://image.pbs.org/contentchannels/XLtKO9n-show-poster2x3-H4SwmKp.jpg",
"title": "PBS Short Film Festival",
"url": "/show/pbs-online-film-festival/",
"website": "https://www.pbs.org/filmfestival"
},
...

Get Show Seasons

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.

Request

GET - https://www.pbs.org/show/:show-name/seasons-list/

Response

{
"content": [
{
"ancestor_slug": null,
"ancestor_title": null,
"ancestor_type": null,
"cid": "c0537bb4-2bf2-4876-82cd-cc3ac922a037",
"flags": {
"has_assets": true,
"has_episodes": true
},
"image": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg"
},
"item_type": "season",
"legacy_tp_media_id": null,
"ordinal": 47,
"parent_type": null,
"summary": "",
"title": "",
"title_sortable": "",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/shows/nova/seasons/c0537bb4-2bf2-4876-82cd-cc3ac922a037/"
},
...

Get Episodes in a Season

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.
season-cidUnique identifier for a season of a show. Reference output of seasons-list above.

Request

GET - https://www.pbs.org/show/:show-name/seasons/:season-cid/episodes/

Reponse

{
"content": [
{
"ancestor_slug": "nova",
"ancestor_title": "NOVA",
"ancestor_type": "show",
"availability": "available",
"cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2",
"description_long": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.",
"description_short": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.",
"duration": 3218,
"encore_date": "2020-05-13T00:00:00-04:00",
"expire_date": "2023-05-13T03:59:59Z",
"flags": {
"has_captions": true,
"is_expiring_soon": false,
"is_fully_watched": null,
"is_mvod": false,
"is_new": false
},
"image": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg"
},
"item_type": "video",
"legacy_tp_media_id": 3042320248,
"parent_type": "episode",
"premiere_date": "2020-05-13T00:00:00-04:00",
"seconds_watched": null,
"show": {
"display_episode_number": true,
"episode": 9,
"season": 47,
"seasons_count": 22,
"slug": "nova",
"title": "NOVA"
},
"slug": "decoding-covid-19-hrfhb2",
"summary": "S47 Ep9 | 53m 38s",
"title": "Decoding COVID-19",
"title_sortable": "Decoding COVID-19",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/video-assets/decoding-covid-19-hrfhb2/",
"video_type": "episode"
},
...

Get Rich Episode Video Data

Parameters

ParameterDescription
legacy-tp-media-idA video's legacy identifier. Used to fetch video metadata sent to JWPlayer.

Reqeust

GET - https://player.pbs.org/portalplayer/:legacy-tp-media-id/

Response

<!doctype html>
...
<body>
...
<script>window.staticUrl="/static/";window.contextBridge={"player_type": "portal_player","callsign": null,"user_id": "","country_id": "US","viewing_history": {},"player_framework": "Video.js","features": {"nielsen": false,"videojs": false}};window.videoBridge={"availability": "available","encodings": ["https://urs.pbs.org/redirect/ceb9dea094b04baf9ebb22f726712d09/","https://urs.pbs.org/redirect/4b3af54f7cda4fefa8459a99cd177333/"],"has_hls_encodings": true,"has_mp4_encodings": true,"cc": {"WebVTT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/kUfgWv_caption.vtt","SRT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/Thxrj1_caption.srt","DFXP": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/OCh5Ix_caption.dfxp","Caption-SAMI": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/3nJKHG_caption.sami"},"can_play_preroll": true,"image_url": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg","chapters": [],"mvod_info": {"show_mvod_icon": false,"show_upsell_overlay": false},"program": {"title": "NOVA","slug": "nova","producer": "PBS"},"related_videos": [{"id": 3042550069,"title": "Trailer","images": {"mezzanine": "https://image.pbs.org/video-assets/8XmGmaI-asset-mezzanine-16x9-vm5hyEc.jpg"},"program": {"funder_message": "Funding for MASTERPIECE is provided by Viking and Raymond James with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","cid": "31598537-8a0a-4441-95b0-6155d52dee28","audience": [{"station": null,"scope": "national"}],"display_episode_number": true,"title": "Grantchester","tracking_ga_page": "UA-3988763-1","seasons_count": 5,"tracking_ga_event": "UA-3988763-2","slug": "grantchester","resource_type": "show","franchise": {"funder_message": "Funding for MASTERPIECE is provided by Viking with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","title": "Masterpiece","cid": "e08bf78d-e6a3-44b9-b356-8753d01c7327","resource_type": "franchise","slug": "masterpiece"}},"slug": "trailer-1owamh"},{"id": 3039879374,"title": "Extended Trailer | The Vote | American Experience","images": {"mezzanine": "https://image.pbs.org/video-assets/zU2qsCH-asset-mezzanine-16x9-yCQVFSq.jpg"},"program": {"title": "Part 1 | The Vote | American Experience","ordinal": 9,"season": {"title": "","cid": "acf1d226-027a-4032-8cb9-56618eab2467","resource_type": "season","ordinal": 32,"show": {"tracking_ga_page": "UA-3988626-1","title": "American Experience","resource_type": "show","audience": [{"station": null,"scope": "national"}],"funder_message": "Corporate sponsorship for American Experience is provided by Liberty Mutual Insurance and Consumer Cellular. Major funding by the Alfred P. Sloan Foundation.","seasons_count": 30,"cid": "1b91e824-10a2-4c3e-b054-74f78fcddcc7","tracking_ga_event": "UA-3988626-2","slug": "american-experience","display_episode_number": true,"franchise": null}},"cid": "2bad0e1b-ead2-4eb4-9a27-3478d6bee182","resource_type": "episode","slug": "vote-part-1"},"slug": "trailer-vote-american-experience"},{"id": 3042347034,"title": "Preview","images": {"mezzanine": "https://image.pbs.org/video-assets/wPSEK08-asset-mezzanine-16x9-z2Gtd5J.jpg"},"program": {"tracking_ga_page": "","title": "Prehistoric Road Trip","resource_type": "show","audience": [{"station": null,"scope": "national"}],"seasons_count": 1,"tracking_ga_event": "","cid": "a1ddde11-3f9f-4ddd-ab9f-7ae25fab5d1c","funder_message": "","slug": "prehistoric-road-trip","display_episode_number": true,"franchise": null},"slug": "preview-wwhtpl"}],"member_stations": [],"video_type": "full_length","id": "3042320248","cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2","slug": "decoding-covid-19-hrfhb2","title": "Decoding COVID-19","short_description": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.","long_description": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.","series_info": "Season 47 Episode 9","duration": 3218,"air_date": "2020-05-13T00:00:00-04:00","air_date_formatted": "May 13th, 2020","air_date_nielsen": "20200513 00:00:00","expire_date": "2023-05-13T03:59:59Z","rating": null,"is_mvod": false,"allow_embed": true,"short_common_name": "","full_common_name": null,"station_color_logo": null,"donation_url": null,"passport_url": null,"passport_learn_more_url": null,"dvd_link": null,"itunes_link": null,"GA_events_codes": ["UA-3988832-2"],"GA_national_codes": ["UA-1996666-7"]};</script>
...
</body>

About

Search and play video content from PBS.org

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - jgrasser/pbs: Search and play video content from PBS.org · GitHub
Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pbs

Search and play video content from PBS.org

There's not much here in the way of features or pizzazz. This is a dumb CLI tool that makes basic API calls; it doesn't even format the output nicely!

Installation

Installation is managed via the Makefile. The makefile just installs some python packages. It's simple.

git clone https://github.com/jgrasser/pbs.git
cd pbs
make install

Usage

API Documentation

Get Member Stations

Parameters

ParameterDescription
statecode2 character code for a US State. Examples include IL, CA, NY, etc.

Request

GET - https://jaws.pbs.org/localization/member/state/:statecode/

Response

{
"stations_list": [
{
"address": "Urbana, IL",
"callsign": "WILL",
"common_name": "Illinois Public Media",
"common_name_short": "WILL-TV",
"flagship": "WILL",
"membership_url": "https://willpledge.org/",
"pbs_id": "11bd36cd-46d5-4c3a-bdc8-ae497a23c712",
"pdp": false
},
...

Query PBS Shows

Parameters

ParameterDescription
pbs-id36 character identifier obtained from member station api call above

Request

POST - https://www.pbs.org/graphql

BODY

{
"operationName": "Shows",
"variables": {
"page": 0,
"genre": "all-genres",
"sortBy": "popular",
"source": "all-sources",
"stationId": :pbs-id,"title": "",
"alphabetically": false
},
"query": "query Shows($page: Int, $genre: String, $source: String, $stationId: String, $sortBy: String, $title: String, $alphabetically: Boolean) {shows(page: $page, genre: $genre, source: $source, stationId: $stationId, sortBy: $sortBy, title: $title, alphabetically: $alphabetically) {content { title genre description image url website cid __typename } meta { pageNumber totalPages totalResults __typename} stationCommonName __typename}}"
}

Response

{
"shows": [
{
"__typename": "Show",
"cid": "033db3e2-3d1f-4c0f-8cd7-746578cb74d8",
"description": "Since its launch in 2012, the PBS Online Film Festival has featured diverse films from PBS member stations and ITVS and POV. This year's festival includes collaborations with a wide variety of public television producers. Starting July 13, viewers can once again watch, vote and share their favorites. Find out how to vote for your favorites at pbs.org/filmfestival",
"genre": [
"indie-films"
],
"image": "https://image.pbs.org/contentchannels/XLtKO9n-show-poster2x3-H4SwmKp.jpg",
"title": "PBS Short Film Festival",
"url": "/show/pbs-online-film-festival/",
"website": "https://www.pbs.org/filmfestival"
},
...

Get Show Seasons

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.

Request

GET - https://www.pbs.org/show/:show-name/seasons-list/

Response

{
"content": [
{
"ancestor_slug": null,
"ancestor_title": null,
"ancestor_type": null,
"cid": "c0537bb4-2bf2-4876-82cd-cc3ac922a037",
"flags": {
"has_assets": true,
"has_episodes": true
},
"image": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg"
},
"item_type": "season",
"legacy_tp_media_id": null,
"ordinal": 47,
"parent_type": null,
"summary": "",
"title": "",
"title_sortable": "",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/shows/nova/seasons/c0537bb4-2bf2-4876-82cd-cc3ac922a037/"
},
...

Get Episodes in a Season

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.
season-cidUnique identifier for a season of a show. Reference output of seasons-list above.

Request

GET - https://www.pbs.org/show/:show-name/seasons/:season-cid/episodes/

Reponse

{
"content": [
{
"ancestor_slug": "nova",
"ancestor_title": "NOVA",
"ancestor_type": "show",
"availability": "available",
"cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2",
"description_long": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.",
"description_short": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.",
"duration": 3218,
"encore_date": "2020-05-13T00:00:00-04:00",
"expire_date": "2023-05-13T03:59:59Z",
"flags": {
"has_captions": true,
"is_expiring_soon": false,
"is_fully_watched": null,
"is_mvod": false,
"is_new": false
},
"image": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg"
},
"item_type": "video",
"legacy_tp_media_id": 3042320248,
"parent_type": "episode",
"premiere_date": "2020-05-13T00:00:00-04:00",
"seconds_watched": null,
"show": {
"display_episode_number": true,
"episode": 9,
"season": 47,
"seasons_count": 22,
"slug": "nova",
"title": "NOVA"
},
"slug": "decoding-covid-19-hrfhb2",
"summary": "S47 Ep9 | 53m 38s",
"title": "Decoding COVID-19",
"title_sortable": "Decoding COVID-19",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/video-assets/decoding-covid-19-hrfhb2/",
"video_type": "episode"
},
...

Get Rich Episode Video Data

Parameters

ParameterDescription
legacy-tp-media-idA video's legacy identifier. Used to fetch video metadata sent to JWPlayer.

Reqeust

GET - https://player.pbs.org/portalplayer/:legacy-tp-media-id/

Response

<!doctype html>
...
<body>
...
<script>window.staticUrl="/static/";window.contextBridge={"player_type": "portal_player","callsign": null,"user_id": "","country_id": "US","viewing_history": {},"player_framework": "Video.js","features": {"nielsen": false,"videojs": false}};window.videoBridge={"availability": "available","encodings": ["https://urs.pbs.org/redirect/ceb9dea094b04baf9ebb22f726712d09/","https://urs.pbs.org/redirect/4b3af54f7cda4fefa8459a99cd177333/"],"has_hls_encodings": true,"has_mp4_encodings": true,"cc": {"WebVTT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/kUfgWv_caption.vtt","SRT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/Thxrj1_caption.srt","DFXP": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/OCh5Ix_caption.dfxp","Caption-SAMI": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/3nJKHG_caption.sami"},"can_play_preroll": true,"image_url": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg","chapters": [],"mvod_info": {"show_mvod_icon": false,"show_upsell_overlay": false},"program": {"title": "NOVA","slug": "nova","producer": "PBS"},"related_videos": [{"id": 3042550069,"title": "Trailer","images": {"mezzanine": "https://image.pbs.org/video-assets/8XmGmaI-asset-mezzanine-16x9-vm5hyEc.jpg"},"program": {"funder_message": "Funding for MASTERPIECE is provided by Viking and Raymond James with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","cid": "31598537-8a0a-4441-95b0-6155d52dee28","audience": [{"station": null,"scope": "national"}],"display_episode_number": true,"title": "Grantchester","tracking_ga_page": "UA-3988763-1","seasons_count": 5,"tracking_ga_event": "UA-3988763-2","slug": "grantchester","resource_type": "show","franchise": {"funder_message": "Funding for MASTERPIECE is provided by Viking with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","title": "Masterpiece","cid": "e08bf78d-e6a3-44b9-b356-8753d01c7327","resource_type": "franchise","slug": "masterpiece"}},"slug": "trailer-1owamh"},{"id": 3039879374,"title": "Extended Trailer | The Vote | American Experience","images": {"mezzanine": "https://image.pbs.org/video-assets/zU2qsCH-asset-mezzanine-16x9-yCQVFSq.jpg"},"program": {"title": "Part 1 | The Vote | American Experience","ordinal": 9,"season": {"title": "","cid": "acf1d226-027a-4032-8cb9-56618eab2467","resource_type": "season","ordinal": 32,"show": {"tracking_ga_page": "UA-3988626-1","title": "American Experience","resource_type": "show","audience": [{"station": null,"scope": "national"}],"funder_message": "Corporate sponsorship for American Experience is provided by Liberty Mutual Insurance and Consumer Cellular. Major funding by the Alfred P. Sloan Foundation.","seasons_count": 30,"cid": "1b91e824-10a2-4c3e-b054-74f78fcddcc7","tracking_ga_event": "UA-3988626-2","slug": "american-experience","display_episode_number": true,"franchise": null}},"cid": "2bad0e1b-ead2-4eb4-9a27-3478d6bee182","resource_type": "episode","slug": "vote-part-1"},"slug": "trailer-vote-american-experience"},{"id": 3042347034,"title": "Preview","images": {"mezzanine": "https://image.pbs.org/video-assets/wPSEK08-asset-mezzanine-16x9-z2Gtd5J.jpg"},"program": {"tracking_ga_page": "","title": "Prehistoric Road Trip","resource_type": "show","audience": [{"station": null,"scope": "national"}],"seasons_count": 1,"tracking_ga_event": "","cid": "a1ddde11-3f9f-4ddd-ab9f-7ae25fab5d1c","funder_message": "","slug": "prehistoric-road-trip","display_episode_number": true,"franchise": null},"slug": "preview-wwhtpl"}],"member_stations": [],"video_type": "full_length","id": "3042320248","cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2","slug": "decoding-covid-19-hrfhb2","title": "Decoding COVID-19","short_description": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.","long_description": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.","series_info": "Season 47 Episode 9","duration": 3218,"air_date": "2020-05-13T00:00:00-04:00","air_date_formatted": "May 13th, 2020","air_date_nielsen": "20200513 00:00:00","expire_date": "2023-05-13T03:59:59Z","rating": null,"is_mvod": false,"allow_embed": true,"short_common_name": "","full_common_name": null,"station_color_logo": null,"donation_url": null,"passport_url": null,"passport_learn_more_url": null,"dvd_link": null,"itunes_link": null,"GA_events_codes": ["UA-3988832-2"],"GA_national_codes": ["UA-1996666-7"]};</script>
...
</body>

About

Search and play video content from PBS.org

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); GitHub - jgrasser/pbs: Search and play video content from PBS.org · GitHub
Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

pbs

Search and play video content from PBS.org

There's not much here in the way of features or pizzazz. This is a dumb CLI tool that makes basic API calls; it doesn't even format the output nicely!

Installation

Installation is managed via the Makefile. The makefile just installs some python packages. It's simple.

git clone https://github.com/jgrasser/pbs.git
cd pbs
make install

Usage

API Documentation

Get Member Stations

Parameters

ParameterDescription
statecode2 character code for a US State. Examples include IL, CA, NY, etc.

Request

GET - https://jaws.pbs.org/localization/member/state/:statecode/

Response

{
"stations_list": [
{
"address": "Urbana, IL",
"callsign": "WILL",
"common_name": "Illinois Public Media",
"common_name_short": "WILL-TV",
"flagship": "WILL",
"membership_url": "https://willpledge.org/",
"pbs_id": "11bd36cd-46d5-4c3a-bdc8-ae497a23c712",
"pdp": false
},
...

Query PBS Shows

Parameters

ParameterDescription
pbs-id36 character identifier obtained from member station api call above

Request

POST - https://www.pbs.org/graphql

BODY

{
"operationName": "Shows",
"variables": {
"page": 0,
"genre": "all-genres",
"sortBy": "popular",
"source": "all-sources",
"stationId": :pbs-id,"title": "",
"alphabetically": false
},
"query": "query Shows($page: Int, $genre: String, $source: String, $stationId: String, $sortBy: String, $title: String, $alphabetically: Boolean) {shows(page: $page, genre: $genre, source: $source, stationId: $stationId, sortBy: $sortBy, title: $title, alphabetically: $alphabetically) {content { title genre description image url website cid __typename } meta { pageNumber totalPages totalResults __typename} stationCommonName __typename}}"
}

Response

{
"shows": [
{
"__typename": "Show",
"cid": "033db3e2-3d1f-4c0f-8cd7-746578cb74d8",
"description": "Since its launch in 2012, the PBS Online Film Festival has featured diverse films from PBS member stations and ITVS and POV. This year's festival includes collaborations with a wide variety of public television producers. Starting July 13, viewers can once again watch, vote and share their favorites. Find out how to vote for your favorites at pbs.org/filmfestival",
"genre": [
"indie-films"
],
"image": "https://image.pbs.org/contentchannels/XLtKO9n-show-poster2x3-H4SwmKp.jpg",
"title": "PBS Short Film Festival",
"url": "/show/pbs-online-film-festival/",
"website": "https://www.pbs.org/filmfestival"
},
...

Get Show Seasons

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.

Request

GET - https://www.pbs.org/show/:show-name/seasons-list/

Response

{
"content": [
{
"ancestor_slug": null,
"ancestor_title": null,
"ancestor_type": null,
"cid": "c0537bb4-2bf2-4876-82cd-cc3ac922a037",
"flags": {
"has_assets": true,
"has_episodes": true
},
"image": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/sm4FufA-asset-mezzanine-16x9-3vXOfLV.jpg"
},
"item_type": "season",
"legacy_tp_media_id": null,
"ordinal": 47,
"parent_type": null,
"summary": "",
"title": "",
"title_sortable": "",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/shows/nova/seasons/c0537bb4-2bf2-4876-82cd-cc3ac922a037/"
},
...

Get Episodes in a Season

Parameters

ParameterDescription
show-nameThe name of the show you want to watch. Example is nova.
season-cidUnique identifier for a season of a show. Reference output of seasons-list above.

Request

GET - https://www.pbs.org/show/:show-name/seasons/:season-cid/episodes/

Reponse

{
"content": [
{
"ancestor_slug": "nova",
"ancestor_title": "NOVA",
"ancestor_type": "show",
"availability": "available",
"cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2",
"description_long": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.",
"description_short": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.",
"duration": 3218,
"encore_date": "2020-05-13T00:00:00-04:00",
"expire_date": "2023-05-13T03:59:59Z",
"flags": {
"has_captions": true,
"is_expiring_soon": false,
"is_fully_watched": null,
"is_mvod": false,
"is_new": false
},
"image": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg",
"images": {
"asset-mezzanine-16x9": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg"
},
"item_type": "video",
"legacy_tp_media_id": 3042320248,
"parent_type": "episode",
"premiere_date": "2020-05-13T00:00:00-04:00",
"seconds_watched": null,
"show": {
"display_episode_number": true,
"episode": 9,
"season": 47,
"seasons_count": 22,
"slug": "nova",
"title": "NOVA"
},
"slug": "decoding-covid-19-hrfhb2",
"summary": "S47 Ep9 | 53m 38s",
"title": "Decoding COVID-19",
"title_sortable": "Decoding COVID-19",
"url": "https://content.services.pbs.org/v3/pbsorg/screens/video-assets/decoding-covid-19-hrfhb2/",
"video_type": "episode"
},
...

Get Rich Episode Video Data

Parameters

ParameterDescription
legacy-tp-media-idA video's legacy identifier. Used to fetch video metadata sent to JWPlayer.

Reqeust

GET - https://player.pbs.org/portalplayer/:legacy-tp-media-id/

Response

<!doctype html>
...
<body>
...
<script>window.staticUrl="/static/";window.contextBridge={"player_type": "portal_player","callsign": null,"user_id": "","country_id": "US","viewing_history": {},"player_framework": "Video.js","features": {"nielsen": false,"videojs": false}};window.videoBridge={"availability": "available","encodings": ["https://urs.pbs.org/redirect/ceb9dea094b04baf9ebb22f726712d09/","https://urs.pbs.org/redirect/4b3af54f7cda4fefa8459a99cd177333/"],"has_hls_encodings": true,"has_mp4_encodings": true,"cc": {"WebVTT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/kUfgWv_caption.vtt","SRT": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/Thxrj1_caption.srt","DFXP": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/OCh5Ix_caption.dfxp","Caption-SAMI": "https://ga.video.cdn.pbs.org/captions/nova/4255528e-0a63-4c52-b8fe-dc8c9353a3d2/captions/3nJKHG_caption.sami"},"can_play_preroll": true,"image_url": "https://image.pbs.org/video-assets/j2MoiWW-asset-mezzanine-16x9-nSazGBW.jpg","chapters": [],"mvod_info": {"show_mvod_icon": false,"show_upsell_overlay": false},"program": {"title": "NOVA","slug": "nova","producer": "PBS"},"related_videos": [{"id": 3042550069,"title": "Trailer","images": {"mezzanine": "https://image.pbs.org/video-assets/8XmGmaI-asset-mezzanine-16x9-vm5hyEc.jpg"},"program": {"funder_message": "Funding for MASTERPIECE is provided by Viking and Raymond James with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","cid": "31598537-8a0a-4441-95b0-6155d52dee28","audience": [{"station": null,"scope": "national"}],"display_episode_number": true,"title": "Grantchester","tracking_ga_page": "UA-3988763-1","seasons_count": 5,"tracking_ga_event": "UA-3988763-2","slug": "grantchester","resource_type": "show","franchise": {"funder_message": "Funding for MASTERPIECE is provided by Viking with additional support from public television viewers and contributors to The MASTERPIECE Trust, created to help ensure the series\u2019 future.","title": "Masterpiece","cid": "e08bf78d-e6a3-44b9-b356-8753d01c7327","resource_type": "franchise","slug": "masterpiece"}},"slug": "trailer-1owamh"},{"id": 3039879374,"title": "Extended Trailer | The Vote | American Experience","images": {"mezzanine": "https://image.pbs.org/video-assets/zU2qsCH-asset-mezzanine-16x9-yCQVFSq.jpg"},"program": {"title": "Part 1 | The Vote | American Experience","ordinal": 9,"season": {"title": "","cid": "acf1d226-027a-4032-8cb9-56618eab2467","resource_type": "season","ordinal": 32,"show": {"tracking_ga_page": "UA-3988626-1","title": "American Experience","resource_type": "show","audience": [{"station": null,"scope": "national"}],"funder_message": "Corporate sponsorship for American Experience is provided by Liberty Mutual Insurance and Consumer Cellular. Major funding by the Alfred P. Sloan Foundation.","seasons_count": 30,"cid": "1b91e824-10a2-4c3e-b054-74f78fcddcc7","tracking_ga_event": "UA-3988626-2","slug": "american-experience","display_episode_number": true,"franchise": null}},"cid": "2bad0e1b-ead2-4eb4-9a27-3478d6bee182","resource_type": "episode","slug": "vote-part-1"},"slug": "trailer-vote-american-experience"},{"id": 3042347034,"title": "Preview","images": {"mezzanine": "https://image.pbs.org/video-assets/wPSEK08-asset-mezzanine-16x9-z2Gtd5J.jpg"},"program": {"tracking_ga_page": "","title": "Prehistoric Road Trip","resource_type": "show","audience": [{"station": null,"scope": "national"}],"seasons_count": 1,"tracking_ga_event": "","cid": "a1ddde11-3f9f-4ddd-ab9f-7ae25fab5d1c","funder_message": "","slug": "prehistoric-road-trip","display_episode_number": true,"franchise": null},"slug": "preview-wwhtpl"}],"member_stations": [],"video_type": "full_length","id": "3042320248","cid": "4255528e-0a63-4c52-b8fe-dc8c9353a3d2","slug": "decoding-covid-19-hrfhb2","title": "Decoding COVID-19","short_description": "Scientists race to understand and defeat the coronavirus behind the COVID-19 pandemic.","long_description": "The coronavirus SARS-CoV-2 has upended life as we know it in a matter of months. But at the same time, an unprecedented global effort to understand and contain the virus\u2014and find a treatment for the disease it causes\u2014is underway. Join doctors on the front lines of the fight against COVID-19 as they strategize to stop the spread, and meet the researchers racing to develop treatments and vaccines.","series_info": "Season 47 Episode 9","duration": 3218,"air_date": "2020-05-13T00:00:00-04:00","air_date_formatted": "May 13th, 2020","air_date_nielsen": "20200513 00:00:00","expire_date": "2023-05-13T03:59:59Z","rating": null,"is_mvod": false,"allow_embed": true,"short_common_name": "","full_common_name": null,"station_color_logo": null,"donation_url": null,"passport_url": null,"passport_learn_more_url": null,"dvd_link": null,"itunes_link": null,"GA_events_codes": ["UA-3988832-2"],"GA_national_codes": ["UA-1996666-7"]};</script>
...
</body>

About

Search and play video content from PBS.org

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages