Skip to content

Commit

Permalink
justWatch test positive
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamlinerm committed Sep 15, 2023
1 parent fb1de37 commit 1e8580d
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 3 deletions.
10 changes: 7 additions & 3 deletions justWatchTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ async function getMovieInfo(movieTitle) {
const url = `https://apis.justwatch.com/content/titles/${locale}/popular?language=en&body={"page_size":1,"page":1,"query":"${movieTitle}","content_types":["show","movie"]}`;
const response = await fetch(encodeURI(url));
const data = await response.json();
console.log(data);
// console.log(data);
const loc = data.items[0].full_path;
const opts = { url: `https://www.justwatch.com${loc}` };
console.log(opts);
// console.log(opts);
// console.log(data.items[0].offers.filter((x) => x.monetization_type != "flatrate" && x.monetization_type != "rent" && x.monetization_type != "buy"));
console.log(data.items[0].offers.filter((x) => x.monetization_type == "flatrate" && (x.package_short_name == "amp" || x.package_short_name == "nfx" || x.package_short_name == "dnp")));
}

let movieTitle = "Three Thousand Years of Longing";
// let movieTitle = "The Thousand Years of Longing";
// let movieTitle = "Breaking Bad";
let movieTitle = "Elemental";
getMovieInfo(movieTitle);
68 changes: 68 additions & 0 deletions test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[
{
jw_entity_id: 'tm912189',
monetization_type: 'flatrate',
provider_id: 337,
package_short_name: 'dnp',
currency: 'USD',
urls: {
standard_web: 'https://disneyplus.bn5x.net/c/1206980/705874/9358?u=https%3A%2F%2Fwww.disneyplus.com%2Fmovies%2Felemental%2F1B2ZQ9GF35W5&subId3=justappsvod',
deeplink_web: 'https://www.disneyplus.com/video/e3895d1d-a979-4c1a-ba66-1bf706e145ab',
deeplink_android_tv: 'intent://www.disneyplus.com/movies/elemental/1B2ZQ9GF35W5#Intent;launchFlags=0x00800000;scheme=https;end',
deeplink_fire_tv: 'intent://www.disneyplus.com/movies/elemental/1B2ZQ9GF35W5#Intent;launchFlags=0x00800000;scheme=https;end',
deeplink_tvos: 'disneyplus://www.disneyplus.com/movies/elemental/1B2ZQ9GF35W5',
deeplink_tizenos: '{"id":"MCmYXNxgcu.DisneyPlus","action_data":"{\\"page\\": \\"movie_details\\", \\"type\\": \\"movies\\", \\"id\\": \\"1B2ZQ9GF35W5\\", \\"pid\\": \\"SmartHubPub\\"}"}',
deeplink_webos: '{ "id": "com.disney.disneyplus-prod", "params": { "contentTarget": "" }}',
deeplink_xbox: 'disneyplus://video/e3895d1d-a979-4c1a-ba66-1bf706e145ab',
deeplink_rokuos: 'launch/291097?contentID=e3895d1d-a979-4c1a-ba66-1bf706e145ab&MediaType=movie'
},
available_from: '0001-01-01T00:00:00Z',
available_to: '0001-01-01T00:00:00Z',
presentation_type: '4k',
country: 'US'
},
{
jw_entity_id: 'tm912189',
monetization_type: 'flatrate',
provider_id: 337,
package_short_name: 'dnp',
currency: 'USD',
urls: {
standard_web: 'https://disneyplus.bn5x.net/c/1206980/705874/9358?u=https%3A%2F%2Fwww.disneyplus.com%2Fmovies%2Felemental%2F1B2ZQ9GF35W5&subId3=justappsvod',
deeplink_web: 'https://www.disneyplus.com/video/e3895d1d-a979-4c1a-ba66-1bf706e145ab',
deeplink_android_tv: 'intent://www.disneyplus.com/movies/elemental/1B2ZQ9GF35W5#Intent;launchFlags=0x00800000;scheme=https;end',
deeplink_fire_tv: 'intent://www.disneyplus.com/movies/elemental/1B2ZQ9GF35W5#Intent;launchFlags=0x00800000;scheme=https;end',
deeplink_tvos: 'disneyplus://www.disneyplus.com/movies/elemental/1B2ZQ9GF35W5',
deeplink_tizenos: '{"id":"MCmYXNxgcu.DisneyPlus","action_data":"{\\"page\\": \\"movie_details\\", \\"type\\": \\"movies\\", \\"id\\": \\"1B2ZQ9GF35W5\\", \\"pid\\": \\"SmartHubPub\\"}"}',
deeplink_webos: '{ "id": "com.disney.disneyplus-prod", "params": { "contentTarget": "" }}',
deeplink_xbox: 'disneyplus://video/e3895d1d-a979-4c1a-ba66-1bf706e145ab',
deeplink_rokuos: 'launch/291097?contentID=e3895d1d-a979-4c1a-ba66-1bf706e145ab&MediaType=movie'
},
available_from: '0001-01-01T00:00:00Z',
available_to: '0001-01-01T00:00:00Z',
presentation_type: 'hd',
country: 'US'
},
{
jw_entity_id: 'tm912189',
monetization_type: 'flatrate',
provider_id: 337,
package_short_name: 'dnp',
currency: 'USD',
urls: {
standard_web: 'https://disneyplus.bn5x.net/c/1206980/705874/9358?u=https%3A%2F%2Fwww.disneyplus.com%2Fmovies%2Felemental%2F1B2ZQ9GF35W5&subId3=justappsvod',
deeplink_web: 'https://www.disneyplus.com/video/e3895d1d-a979-4c1a-ba66-1bf706e145ab',
deeplink_android_tv: 'intent://www.disneyplus.com/movies/elemental/1B2ZQ9GF35W5#Intent;launchFlags=0x00800000;scheme=https;end',
deeplink_fire_tv: 'intent://www.disneyplus.com/movies/elemental/1B2ZQ9GF35W5#Intent;launchFlags=0x00800000;scheme=https;end',
deeplink_tvos: 'disneyplus://www.disneyplus.com/movies/elemental/1B2ZQ9GF35W5',
deeplink_tizenos: '{"id":"MCmYXNxgcu.DisneyPlus","action_data":"{\\"page\\": \\"movie_details\\", \\"type\\": \\"movies\\", \\"id\\": \\"1B2ZQ9GF35W5\\", \\"pid\\": \\"SmartHubPub\\"}"}',
deeplink_webos: '{ "id": "com.disney.disneyplus-prod", "params": { "contentTarget": "" }}',
deeplink_xbox: 'disneyplus://video/e3895d1d-a979-4c1a-ba66-1bf706e145ab',
deeplink_rokuos: 'launch/291097?contentID=e3895d1d-a979-4c1a-ba66-1bf706e145ab&MediaType=movie'
},
available_from: '0001-01-01T00:00:00Z',
available_to: '0001-01-01T00:00:00Z',
presentation_type: 'sd',
country: 'US'
}
]

0 comments on commit 1e8580d

Please sign in to comment.