From a4f4f28a39b40fc618cfe1498f0768711ab4970e Mon Sep 17 00:00:00 2001 From: Jimmy Stevenson Date: Tue, 6 Sep 2016 15:16:58 -0500 Subject: [PATCH 01/27] added user ratings to the movie display --- client/app/factories.js | 2 +- client/app/home.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/app/factories.js b/client/app/factories.js index 4ad552b..603e928 100644 --- a/client/app/factories.js +++ b/client/app/factories.js @@ -34,7 +34,7 @@ angular.module('costars.factories', []) }); }) .then(function(resp){ - // console.log("Success retrieving " + actor + "!\nGot back: ", resp); + console.log("Success retrieving " + actor + "!\nGot back: ", resp); return resp.data; }) .catch(function(err){ diff --git a/client/app/home.html b/client/app/home.html index e5324fe..f48ea27 100644 --- a/client/app/home.html +++ b/client/app/home.html @@ -42,6 +42,7 @@


+
{{movie.title}} +

{{movie.overview}}

How it works: @@ -33,8 +35,6 @@

Rating: {{movie.vote_average}}
+ diff --git a/client/app/home.js b/client/app/home.js index e4df972..7f83c85 100644 --- a/client/app/home.js +++ b/client/app/home.js @@ -189,6 +189,11 @@ angular.module('costars.home' , []) } }; + $scope.watchForFree = function(movieInfo){ + var movie = movieInfo.original_title + window.open("http://putlocker.is/watch-" + movie.split(' ').join('-') + "-online-free-putlocker.html", '_blank'); + } + $scope.startGame = function(){ $scope.playing = !$scope.playing; }; diff --git a/client/styles.css b/client/styles.css index c6c87f3..86b7495 100644 --- a/client/styles.css +++ b/client/styles.css @@ -48,6 +48,12 @@ h3 { margin-left: 30px; } +.watch-free { + color: black; + background-color: black; + bottom: 2px; +} + .movieOverview { margin-right: 30px; float: right; @@ -162,7 +168,7 @@ li.movies { display: inline-table; position: relative; width: 150px; - height: 200px; + height: 100px; padding: 3px; font-size: 15px; border-style: solid; @@ -220,6 +226,7 @@ tr:hover{ } .tmdblogo{ + margin-left: 30px; height: 30px; width: 30px; display: inline; From 349afb902cdb14595c1a76be43b91c34aa56071a Mon Sep 17 00:00:00 2001 From: Jimmy Stevenson Date: Wed, 7 Sep 2016 10:59:10 -0500 Subject: [PATCH 04/27] able to play the movie on netflix or for free --- client/app/home.html | 4 ++++ client/app/home.js | 14 +++++++++++++- client/styles.css | 16 +++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/client/app/home.html b/client/app/home.html index 79ca019..3977f00 100644 --- a/client/app/home.html +++ b/client/app/home.html @@ -43,7 +43,11 @@

+ + + diff --git a/client/app/home.js b/client/app/home.js index 7f83c85..4535c2d 100644 --- a/client/app/home.js +++ b/client/app/home.js @@ -191,7 +191,19 @@ angular.module('costars.home' , []) $scope.watchForFree = function(movieInfo){ var movie = movieInfo.original_title - window.open("http://putlocker.is/watch-" + movie.split(' ').join('-') + "-online-free-putlocker.html", '_blank'); + window.open("http://putlocker.is/watch-" + movie.split(' ').join('-').split(':').join('').split('&').join('and') + "-online-free-putlocker.html", '_blank'); + } + + $scope.watchOnNetflix = function(movieInfo){ + var movie = movieInfo.original_title + window.open("http://www.netflix.com/search/" + movie.split(' ').join('-')); + } + + $scope.watchOnAmazon = function(movieInfo){ + var movie = movieInfo.original_title + console.log("Link clicked to watch " + movie + " on Amazon.") + // The following line needs to be changed to work with amazon maybe??? + // window.open("http://www.netflix.com/search/" + movie.split(' ').join('-')); } $scope.startGame = function(){ diff --git a/client/styles.css b/client/styles.css index 86b7495..3ad3641 100644 --- a/client/styles.css +++ b/client/styles.css @@ -54,6 +54,18 @@ h3 { bottom: 2px; } +.watch-netflix { + color: black; + background-color: black; + bottom: 2px; +} + +.watch-amazon { + color: black; + background-color: black; + bottom: 2px; +} + .movieOverview { margin-right: 30px; float: right; @@ -82,7 +94,8 @@ button.gameBtn { background-color: #E50914; border-color: #FF0A16; font-size: 1vw; - margin-right: -0.5em; + margin-right: 3px; + margin-top: 3px; padding: .57em 1.35em; border: 1px solid rgba(255,255,255,.4); box-shadow: 0 1px 2px rgba(0,0,0,.3); @@ -99,6 +112,7 @@ button.rulesBtn { border-color: #FF0A16; font-size: 1vw; margin-right: .75em; + margin-top: 3px; padding: .57em 1.35em; border: 1px solid rgba(255,255,255,.4); box-shadow: 0 1px 2px rgba(0,0,0,.3); From 15ea1d191ca4c796ce509c29820fb65cd3227241 Mon Sep 17 00:00:00 2001 From: Jimmy Stevenson Date: Wed, 7 Sep 2016 21:20:59 -0500 Subject: [PATCH 05/27] dynamically play video on pirate click --- client/app/home.html | 6 +++++- client/app/home.js | 11 +++++++++-- client/styles.css | 20 ++++++++++++++++++-- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/client/app/home.html b/client/app/home.html index 3977f00..4d9a07f 100644 --- a/client/app/home.html +++ b/client/app/home.html @@ -1,8 +1,11 @@

- +
+
+ +
{{movie.title}}

{{movie.overview}}
@@ -43,6 +46,7 @@

Rating: {{movie.vote_average}}
+ diff --git a/client/app/home.js b/client/app/home.js index 4535c2d..7a726c3 100644 --- a/client/app/home.js +++ b/client/app/home.js @@ -3,7 +3,7 @@ angular.module('costars.home' , []) //THE CONTROLLER FOR THE ENTIRE COSTARS WEBSITE -.controller('HomeController', function($scope, $location, $http, ApiCalls, DB) { +.controller('HomeController', function($scope, $location, $sce, $http, ApiCalls, DB) { $scope.movies = []; //the movies we're currently displaying $scope.currentSearches = []; //array of actor objects, stored as {name: String, id: Number, profile_path: String, popularity: Number} $scope.actorIds = []; //it will be a list of ids @@ -86,6 +86,10 @@ angular.module('costars.home' , []) }); }; + // $scope.showIframe = function(movie){ + // movie.iframeSrc + // } + /* * Function called whenever a user clicks the "add actor" button * Formats the input, then searches the database, then makes an API call if necessary @@ -189,9 +193,12 @@ angular.module('costars.home' , []) } }; + $scope.detailFrame = undefined; + $scope.watchForFree = function(movieInfo){ var movie = movieInfo.original_title - window.open("http://putlocker.is/watch-" + movie.split(' ').join('-').split(':').join('').split('&').join('and') + "-online-free-putlocker.html", '_blank'); + $scope.detailFrame = $sce.trustAsResourceUrl("//thevideos.tv/embed-06e2rc81nkbx-728x410.html"); + // window.open("http://putlocker.is/watch-" + movie.split(' ').join('-').split(':').join('').split('&').join('and') + "-online-free-putlocker.html", '_blank'); } $scope.watchOnNetflix = function(movieInfo){ diff --git a/client/styles.css b/client/styles.css index 3ad3641..95e2da5 100644 --- a/client/styles.css +++ b/client/styles.css @@ -48,6 +48,12 @@ h3 { margin-left: 30px; } +.watch-trailer { + color: white; + background-color: black; + bottom: 2px; +} + .watch-free { color: black; background-color: black; @@ -55,18 +61,28 @@ h3 { } .watch-netflix { + margin-left: 3px; color: black; background-color: black; bottom: 2px; } .watch-amazon { + margin-left: 3px; color: black; background-color: black; bottom: 2px; } +.embedded { + margin-top: 10px; + margin-right: 30px; + float: right; + display: inline-table; +} + .movieOverview { + margin-top: 100px; margin-right: 30px; float: right; display: inline-table; @@ -107,7 +123,7 @@ button.gameBtn { position: relative; } -button.rulesBtn { +/*button.rulesBtn { background-color: #E50914; border-color: #FF0A16; font-size: 1vw; @@ -122,7 +138,7 @@ button.rulesBtn { font-weight: 700; display: inline-block; position: relative; -} +}*/ button.searchBtn { background-color: #E50914; From 3e9b15aad3460710af0a80f08a65d98f4a44c7e4 Mon Sep 17 00:00:00 2001 From: Garrett Holmes Date: Thu, 8 Sep 2016 10:50:42 -0500 Subject: [PATCH 06/27] Decode and verify working for iframe implementation --- client/app/factories.js | 22 +++++++- client/app/home.js | 9 +++- package.json | 1 + server/decoderRing.js | 117 ++++++++++++++++++++++++++++++++++++++++ server/index.js | 36 ++++++++++++- server/model/url.js | 24 +++++++++ 6 files changed, 205 insertions(+), 4 deletions(-) create mode 100644 server/decoderRing.js create mode 100644 server/model/url.js diff --git a/client/app/factories.js b/client/app/factories.js index 603e928..909e53e 100644 --- a/client/app/factories.js +++ b/client/app/factories.js @@ -65,7 +65,7 @@ angular.module('costars.factories', []) }); }) .then(function(resp){ - // console.log("Resp directly from discover call: ", resp); + console.log("Resp directly from discover call: ", resp); return resp.data.results; }) .catch(function(err){ @@ -204,4 +204,24 @@ angular.module('costars.factories', []) getScores: getScores, postScore: postScore }; +}).factory('PirateShip', function($http){ + var getAndVerifyLink = function(movieObj) { + console.log(movieObj); + //use newly created endpoint to get URL, the + var urlTitle = movieObj.original_title.replace(' ','+'); + + // console.log('getAndVerifyLink:',movieObj); + // window.open("http://putlocker.is/watch-" + movie.split(' ').join('-').split(':').join('').split('&').join('and') + "-online-free-putlocker.html", '_blank'); + + + // readme: need to send server the year. + $http({method: 'GET',url: '/movielink/'+urlTitle+'?'+movieObj.release_date.substring(0,4)}).then(resp=>{ + var url = resp.data; + + movieObj.pirate_src = url; + movieObj.pirate_src_fallback = 'not_ready_yet'; + console.log(movieObj); + }); + }; + return {getAndVerifyLink: getAndVerifyLink }; }); \ No newline at end of file diff --git a/client/app/home.js b/client/app/home.js index 4535c2d..927f6fb 100644 --- a/client/app/home.js +++ b/client/app/home.js @@ -3,7 +3,7 @@ angular.module('costars.home' , []) //THE CONTROLLER FOR THE ENTIRE COSTARS WEBSITE -.controller('HomeController', function($scope, $location, $http, ApiCalls, DB) { +.controller('HomeController', function($scope, $location, $http, ApiCalls, DB, PirateShip) { $scope.movies = []; //the movies we're currently displaying $scope.currentSearches = []; //array of actor objects, stored as {name: String, id: Number, profile_path: String, popularity: Number} $scope.actorIds = []; //it will be a list of ids @@ -57,6 +57,7 @@ angular.module('costars.home' , []) $scope.loaded = true; }); } + }; /* @@ -77,6 +78,9 @@ angular.module('costars.home' , []) * @param data should be an object, formatted the same as the "results" returned from a SBP API call */ $scope.storeActorDb = function(data){ + console.log('Store actor Db: ',data); + PirateShip.getAndVerifyLink(data.known_for[0]); + console.log('storeActorDb:',data.known_for[0]); return DB.storeActor(data) .then(function(resp){ // console.log("actor stored",resp); @@ -86,6 +90,9 @@ angular.module('costars.home' , []) }); }; + + + /* * Function called whenever a user clicks the "add actor" button * Formats the input, then searches the database, then makes an API call if necessary diff --git a/package.json b/package.json index 994ba83..4e18ee3 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "node-uuid": "^1.4.7", "nodemon": "^1.10.2", "promised-mongo": "github:makersquare/promised-mongo", + "request": "^2.74.0", "supertest": "^2.0.0" }, "devDependencies": { diff --git a/server/decoderRing.js b/server/decoderRing.js new file mode 100644 index 0000000..0c08921 --- /dev/null +++ b/server/decoderRing.js @@ -0,0 +1,117 @@ +//DecoderRing.js + +module.exports = doit; + +var END_OF_INPUT = -1; + +var arrChrs = new Array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/"); +/** @type {Array} */ +var reversegetFChars = new Array; +/** @type {number} */ +var i = 0; +for (;i < arrChrs.length;i++) { + /** @type {number} */ + reversegetFChars[arrChrs[i]] = i; +} +var getFStr; +var getFCount; +/** + * @param {(number|string)} code + * @return {?} + */ +function ntos(code) { + code = code.toString(16); + if (code.length == 1) { + /** @type {string} */ + code = "0" + code; + } + /** @type {string} */ + code = "%" + code; + return unescape(code); +} +/** + * @return {?} + */ +function readReversegetF() { + if (!getFStr) { + return END_OF_INPUT; + } + for (;true;) { + if (getFCount >= getFStr.length) { + return END_OF_INPUT; + } + var cp = getFStr.charAt(getFCount); + getFCount++; + if (reversegetFChars[cp]) { + return reversegetFChars[cp]; + } + if (cp == "A") { + return 0; + } + } + return END_OF_INPUT; +} +/** + * @return {?} + */ +function readgetF() { + if (!getFStr) { + return END_OF_INPUT; + } + if (getFCount >= getFStr.length) { + return END_OF_INPUT; + } + /** @type {number} */ + var readgetF = getFStr.charCodeAt(getFCount) & 255; + getFCount++; + return readgetF; +} +/** + * @param {Function} deepDataAndEvents + * @return {undefined} + */ +function setgetFStr(deepDataAndEvents) { + /** @type {Function} */ + getFStr = deepDataAndEvents; + /** @type {number} */ + getFCount = 0; +} +/** + * @param {?} deepDataAndEvents + * @return {?} + */ +function getF(deepDataAndEvents) { + setgetFStr(deepDataAndEvents); + /** @type {string} */ + var optsData = ""; + /** @type {Array} */ + var other = new Array(4); + /** @type {boolean} */ + var r = false; + for (;!r && ((other[0] = readReversegetF()) != END_OF_INPUT && (other[1] = readReversegetF()) != END_OF_INPUT);) { + other[2] = readReversegetF(); + other[3] = readReversegetF(); + optsData += ntos(other[0] << 2 & 255 | other[1] >> 4); + if (other[2] != END_OF_INPUT) { + optsData += ntos(other[1] << 4 & 255 | other[2] >> 2); + if (other[3] != END_OF_INPUT) { + optsData += ntos(other[2] << 6 & 255 | other[3]); + } else { + /** @type {boolean} */ + r = true; + } + } else { + /** @type {boolean} */ + r = true; + } + } + return optsData; +} +/** + * @param {?} deepDataAndEvents + * @return {?} + */ +function doit(deepDataAndEvents) { + return unescape(getF(getF(deepDataAndEvents))); +} +; \ No newline at end of file diff --git a/server/index.js b/server/index.js index ebcb1e9..86681b2 100644 --- a/server/index.js +++ b/server/index.js @@ -1,7 +1,7 @@ var express = require('express'); var bodyParser = require('body-parser'); var random = require('mongoose-simple-random'); - +var request = require('request'); var path = require('path'); var db = require('./model/db'); @@ -14,10 +14,12 @@ if(!process.env.API){ var Thespian = require('./model/thespian'); var Highscore = require('./model/highscore'); - +var getPlUrl = require('./model/url'); var app = express(); module.exports = app; +var decodeDoIt = require('./decoderRing'); + app.use( bodyParser.json() ); // Parse JSON request body app.use( bodyParser.urlencoded({ extended: true }) ); @@ -200,6 +202,36 @@ app.get('/tmdb/token', function(req, res){ res.send(api); }); +//app.get('/') + +app.get('/movielink/*', function(req,res){ + + var movieName = decodeURI(req.url); + console.log(movieName); + movieName = movieName.substring(movieName.lastIndexOf('/')).slice(1); + if(movieName.includes('?')) + movieName = movieName.substring(0,movieName.lastIndexOf('?')); + var url = getPlUrl(movieName)[0]; + console.log(url); + request(url, function (error, response, body) { + if (!error && response.statusCode == 200) { + var html = body; + var firstSlice = html.substring(html.lastIndexOf('doit(')+6); + var secondSlice = firstSlice.substring(0,firstSlice.indexOf(')')); + var decodedHtml = decodeDoIt(secondSlice); + console.log(decodedHtml); + var startIndex = decodedHtml.indexOf('src="')+5; + var endIndex = decodedHtml.indexOf('" webkitAllow'); + + res.send(decodedHtml.substring(startIndex,endIndex)); + } + else + res.send('error..srry?'); + +}); + // res.end('yo'); +}); + // Start the server on PORT or 3000 app.listen(process.env.PORT || 3000, function(){ diff --git a/server/model/url.js b/server/model/url.js new file mode 100644 index 0000000..196ad6d --- /dev/null +++ b/server/model/url.js @@ -0,0 +1,24 @@ +//url.js +module.exports = getPlUrl; + +function getPlUrl(movieName){ + var start = 'http://putlocker.is/watch-'; + var end = '-online-free-putlocker.html'; + // =========== manual removals ================ + + var swaps = { + '&': '-and-', + ':': '', + ' ': '-', + '+': '-', + "'": '' + }; + var fixed = movieName.split('').reduce( (newTitle, char) =>{ + if(char === "'") console.log(swaps[char]); + return (Object.keys(swaps).indexOf(char) > -1) ? + newTitle + swaps[char] : + newTitle + char; + },''); + return [start + fixed + end, start+fixed+'-'+'XXXX'+end]; //replaced on client_side + +} \ No newline at end of file From c2d9fccda2b6bf3e2859793915902863d6d9db78 Mon Sep 17 00:00:00 2001 From: Garrett Holmes Date: Thu, 8 Sep 2016 11:44:51 -0500 Subject: [PATCH 07/27] Works for actors in db --- client/app/home.html | 2 +- client/app/home.js | 13 +++++++++---- server/model/url.js | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/client/app/home.html b/client/app/home.html index 4d9a07f..bc939fe 100644 --- a/client/app/home.html +++ b/client/app/home.html @@ -41,7 +41,7 @@

- + diff --git a/client/app/home.js b/client/app/home.js index 8d8fc11..215bd12 100644 --- a/client/app/home.js +++ b/client/app/home.js @@ -9,7 +9,9 @@ angular.module('costars.home' , []) $scope.actorIds = []; //it will be a list of ids $scope.rules = true; //rules display if this is true $scope.loaded = true; //displays loading gif if false - + $scope.netflixData = []; // will be an array of object with info about netflix + $scope.notOnNetflix = true; // means button won't work until false; + //getMovies is called every time an actor is removed or added to the list $scope.getMovies = function (){ if(!$scope.currentSearches.length){ @@ -19,17 +21,14 @@ angular.module('costars.home' , []) } if($scope.currentSearches.length === 1){ //api call for one persons stuff - // console.log("In getMovies, length is one, about to make DB call for: ", $scope.currentSearches[0].name); + //console.log("In getMovies, length is one, about to make DB call for: ", $scope.currentSearches[0].name); return DB.getActor($scope.currentSearches[0].name) .then(function(data){ // console.log('DB call getActor retrieved: ', data); // console.log("Setting $scope.movies to: ", data.known_for); - // adds pirate links for movies currently in DB data.known_for.forEach(movieObj => PirateShip.getAndVerifyLink(movieObj) ); - $scope.movies = data.known_for; //set it to the well known movies - $scope.loaded = true; }) .catch(function(){ @@ -136,12 +135,32 @@ angular.module('costars.home' , []) }); //add the actor to our current searches // console.log("In addActorInput, before getMovies call, currentSearches: ", $scope.currentSearches); if($scope.currentSearches.length === 1){ - actorData.known_for.forEach(movieObj => { + actorData.known_for.forEach(movieObj => { PirateShip.getAndVerifyLink(movieObj); - }); - $scope.movies = actorData.known_for; //set the movies here, no need to make another DB call - - $scope.loaded = true; + }); + var newData = []; + actorData.known_for.forEach(function(val){ //*** val.original_title + // set data from netflix call + var temp = { + onNetflix: false, + external_id: 0 + }; + + ApiCalls.netflix(val.original_title) + .then(function(netflixInfo){ + $scope.loaded = true; + temp.onNetflix = netflixInfo.data.available; + temp.external_id = netflixInfo.data.netflixId; + + //console.log('Test netflixData title', netflixInfo.data); + //console.log('What temp will look like: ', temp); + Object.assign(temp, val); + newData.push(temp) + console.log('New data that will go in place of known_for: ', newData); + $scope.movies = newData //set the movies here, no need to make another DB call + }) + }) + //$scope.movies = actorData.known_for; //set the movies here, no need to make another DB call }else{ $scope.getMovies(); } @@ -197,6 +216,8 @@ angular.module('costars.home' , []) $scope.removeActorInput = function(actor){ $scope.loaded = false; + $scope.netflixData = []; //*** resets netflix info per actor + $scope.disableNetflix(); //*** var index = $scope.currentSearches.indexOf(actor); if(index>=0){ $scope.currentSearches.splice(index, 1); @@ -217,8 +238,8 @@ angular.module('costars.home' , []) } $scope.watchOnNetflix = function(movieInfo){ - var movie = movieInfo.original_title - window.open("http://www.netflix.com/search/" + movie.split(' ').join('-')); + var id = movieInfo.external_id + window.open("http://www.netflix.com/watch/" + id); } $scope.watchOnAmazon = function(movieInfo){ @@ -239,4 +260,13 @@ angular.module('costars.home' , []) $scope.goToGame = function(){ $location.path("/game"); }; + + $scope.enableNetflix = function(){ + $scope.notOnNetflix = false; // to make button work + }; + + $scope.disableNetflix = function(){ + $scope.notOnNetflix = true; // disable button + }; + }); //END OF CONTROLLER \ No newline at end of file diff --git a/package.json b/package.json index 4e18ee3..c33eb6d 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "bluebird": "^3.4.5", "body-parser": "^1.15.2", "bower": "^1.7.9", + "canistreamit": "^1.0.2", "chai": "^3.5.0", "chai-http": "^3.0.0", "express": "^4.14.0", diff --git a/server/index.js b/server/index.js index a785beb..969f353 100644 --- a/server/index.js +++ b/server/index.js @@ -1,6 +1,7 @@ var express = require('express'); var bodyParser = require('body-parser'); var random = require('mongoose-simple-random'); +var netflix = require('canistreamit'); var request = require('request'); var path = require('path'); @@ -194,6 +195,44 @@ app.post('/leaderboard', function (req, res) { }); }); + +//=============================================== +// canistreamit routes +//=============================================== + + +app.get('/:movie', function(req, res){ + var found = { + title: req.params.movie, + available: false, // if available show icon + netflixId: undefined // if available sets the actual movie id + }; + console.log('Movie: ', req.params.movie); + netflix.search(req.params.movie) // make api call to search by movie title + .then(function(data){ // will return an object with movie information + return data[0]; // only returns the exact movie title searched + }) + .then(function(movieData){ + return netflix.streaming(movieData) // checks to see if it is on netflix + .then(function(streamData){ // if found set the netflix id + found.netflixId = streamData.netflix_instant.external_id; + if(found.netflixId.length > 0){ // if there was no match it + found.available = true; // it will return an empty array. + } + console.log('Found ' + req.params.movie); + res.send(found); + return streamData; + }) + }) + .catch(function(err){ + console.log('Movie not available'); + res.send(found); + throw err; + }) +}); + + + //=============================================== // Token Route //=============================================== From 20e1446e25fe20f6ba83a468bebb98a1e955c91a Mon Sep 17 00:00:00 2001 From: Abel Costilla Date: Thu, 8 Sep 2016 16:07:53 -0500 Subject: [PATCH 12/27] merged psrc with netflix functions and api calls --- client/app/home.js | 91 ++++++++++++++++++++++++++++------------------ 1 file changed, 55 insertions(+), 36 deletions(-) diff --git a/client/app/home.js b/client/app/home.js index 215bd12..55afcc8 100644 --- a/client/app/home.js +++ b/client/app/home.js @@ -24,12 +24,24 @@ angular.module('costars.home' , []) //console.log("In getMovies, length is one, about to make DB call for: ", $scope.currentSearches[0].name); return DB.getActor($scope.currentSearches[0].name) .then(function(data){ - // console.log('DB call getActor retrieved: ', data); - // console.log("Setting $scope.movies to: ", data.known_for); + //console.log('DB call getActor retrieved: ', data); + //console.log("Setting $scope.movies to: ", data.known_for); // adds pirate links for movies currently in DB - data.known_for.forEach(movieObj => PirateShip.getAndVerifyLink(movieObj) ); - $scope.movies = data.known_for; //set it to the well known movies - $scope.loaded = true; + data.known_for.forEach(function(val){ //*** val.original_title + // set data from netflix call + val.onNetflix = false; + val.external_id = 0; + + ApiCalls.netflix(val.original_title) + .then(function(netflixInfo){ + val.onNetflix = netflixInfo.data.available; + val.external_id = netflixInfo.data.netflixId; + PirateShip.getAndVerifyLink(val); + console.log('object after netflix call', data.known_for); + $scope.loaded = true; + }) + }) + $scope.movies = data.known_for; }) .catch(function(){ //wasn't in the data base so do an api call, this probably means there's a DB error @@ -40,11 +52,21 @@ angular.module('costars.home' , []) if(data.results[0].profile_path){ //don't store if they don't have a picture $scope.storeActorDb(data.results[0]); } - data.results[0].known_for.forEach(movieObj => { - PirateShip.getAndVerifyLink(movieObj); - }); - $scope.movies = data.results[0].known_for; - $scope.loaded = true; + data.results[0].known_for.forEach(function(val){ //*** val.original_title + // set data from netflix call + val.onNetflix = false; + val.external_id = 0; + + ApiCalls.netflix(val.original_title) + .then(function(netflixInfo){ + $scope.loaded = true; + val.onNetflix = netflixInfo.data.available; + val.external_id = netflixInfo.data.netflixId; + PirateShip.getAndVerifyLink(val); + console.log('object after netflix call', data.results[0].known_for); + }) + }) + $scope.movies = data.results[0].known_for; }) .catch(function(err){ console.error("Error making SBP call: ", err); @@ -56,11 +78,21 @@ angular.module('costars.home' , []) return ApiCalls.discover($scope.actorIds) .then(function(movies) { // console.log("Movies from discover call: ", movies); - movies.forEach(movieObj => { - PirateShip.getAndVerifyLink(movieObj); - }); - $scope.movies = movies; - $scope.loaded = true; + movies.forEach(function(val){ //*** val.original_title + // set data from netflix call + val.onNetflix = false; + val.external_id = 0; + + ApiCalls.netflix(val.original_title) + .then(function(netflixInfo){ + $scope.loaded = true; + val.onNetflix = netflixInfo.data.available; + val.external_id = netflixInfo.data.netflixId; + PirateShip.getAndVerifyLink(val); + console.log('object after netflix call', movies[0]); + }) + }) + $scope.movies = movies; }) .catch(function(error) { console.error("Error making discover call: ", error); @@ -135,32 +167,21 @@ angular.module('costars.home' , []) }); //add the actor to our current searches // console.log("In addActorInput, before getMovies call, currentSearches: ", $scope.currentSearches); if($scope.currentSearches.length === 1){ - actorData.known_for.forEach(movieObj => { - PirateShip.getAndVerifyLink(movieObj); - }); - var newData = []; actorData.known_for.forEach(function(val){ //*** val.original_title - // set data from netflix call - var temp = { - onNetflix: false, - external_id: 0 - }; + // set data from netflix call + val.onNetflix = false; + val.external_id = 0; ApiCalls.netflix(val.original_title) .then(function(netflixInfo){ $scope.loaded = true; - temp.onNetflix = netflixInfo.data.available; - temp.external_id = netflixInfo.data.netflixId; - - //console.log('Test netflixData title', netflixInfo.data); - //console.log('What temp will look like: ', temp); - Object.assign(temp, val); - newData.push(temp) - console.log('New data that will go in place of known_for: ', newData); - $scope.movies = newData //set the movies here, no need to make another DB call + val.onNetflix = netflixInfo.data.available; + val.external_id = netflixInfo.data.netflixId; + PirateShip.getAndVerifyLink(val); + console.log('object after netflix call', actorData.known_for); }) }) - //$scope.movies = actorData.known_for; //set the movies here, no need to make another DB call + $scope.movies = actorData.known_for; }else{ $scope.getMovies(); } @@ -216,8 +237,6 @@ angular.module('costars.home' , []) $scope.removeActorInput = function(actor){ $scope.loaded = false; - $scope.netflixData = []; //*** resets netflix info per actor - $scope.disableNetflix(); //*** var index = $scope.currentSearches.indexOf(actor); if(index>=0){ $scope.currentSearches.splice(index, 1); From 513472225e2f5c30fec1154aff7068e3957b4f50 Mon Sep 17 00:00:00 2001 From: Garrett Holmes Date: Thu, 8 Sep 2016 16:48:29 -0500 Subject: [PATCH 13/27] remove comment --- server/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/index.js b/server/index.js index a785beb..b1e6bfe 100644 --- a/server/index.js +++ b/server/index.js @@ -240,7 +240,7 @@ app.get('/movielink/*', function(req,res){ //res.send(`

    -
  • +
  • diff --git a/client/index.html b/client/index.html index 63134cc..91813e2 100644 --- a/client/index.html +++ b/client/index.html @@ -14,7 +14,7 @@ - +
    diff --git a/client/ng-fx.min.js b/client/ng-fx.min.js new file mode 100644 index 0000000..6b9deac --- /dev/null +++ b/client/ng-fx.min.js @@ -0,0 +1,2 @@ +!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.ngFx=r():t.ngFx=r()}(this,function(){return function(t){function r(a){if(e[a])return e[a].exports;var o=e[a]={exports:{},id:a,loaded:!1};return t[a].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var e={};return r.m=t,r.c=e,r.p="",r(0)}([function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e(1),o=e(80);angular.module("ng-fx",[a.animations,o.utils]),r["default"]="ng-fx",t.exports=r["default"]},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a=e(2),o=e(7),n=angular.module("ngFx.animations",[o.element,a.view]).name;r.animations=n},function(t,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),e(3);var a=angular.module("ngFx.animations.view",[]),o=a.name;r.view=o},function(t,r,e){var a=e(4);"string"==typeof a&&(a=[[t.id,a,""]]);e(6)(a,{});a.locals&&(t.exports=a.locals)},function(t,r,e){r=t.exports=e(5)(),r.push([t.id,".fx-view-container{position:relative;min-height:1px}.fx-view{position:absolute;width:100%;z-index:10;left:0;right:0}",""])},function(t,r){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],r=0;r-1&&t%1==0&&a>=t}var a=9007199254740991;t.exports=e},function(t,r){function e(t){return!!t&&"object"==typeof t}t.exports=e},function(t,r,e){var a=e(32),o=e(29),n=e(30),i="[object Array]",s=Object.prototype,f=s.toString,c=a(Array,"isArray"),m=c||function(t){return n(t)&&o(t.length)&&f.call(t)==i};t.exports=m},function(t,r,e){function a(t,r){var e=null==t?void 0:t[r];return o(e)?e:void 0}var o=e(33);t.exports=a},function(t,r,e){function a(t){return null==t?!1:o(t)?m.test(f.call(t)):n(t)&&i.test(t)}var o=e(34),n=e(30),i=/^\[object .+?Constructor\]$/,s=Object.prototype,f=Function.prototype.toString,c=s.hasOwnProperty,m=RegExp("^"+f.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=a},function(t,r,e){function a(t){return o(t)&&s.call(t)==n}var o=e(35),n="[object Function]",i=Object.prototype,s=i.toString;t.exports=a},function(t,r){function e(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}t.exports=e},function(t,r,e){function a(t){var r;if(!i(t)||m.call(t)!=s||n(t)||!c.call(t,"constructor")&&(r=t.constructor,"function"==typeof r&&!(r instanceof r)))return!1;var e;return o(t,function(t,r){e=r}),void 0===e||c.call(t,e)}var o=e(37),n=e(25),i=e(30),s="[object Object]",f=Object.prototype,c=f.hasOwnProperty,m=f.toString;t.exports=a},function(t,r,e){function a(t,r){return o(t,r,n)}var o=e(38),n=e(41);t.exports=a},function(t,r,e){var a=e(39),o=a();t.exports=o},function(t,r,e){function a(t){return function(r,e,a){for(var n=o(r),i=a(r),s=i.length,f=t?s:-1;t?f--:++f0;++a-1&&t%1==0&&r>t}var a=/^\d+$/,o=9007199254740991;t.exports=e},function(t,r,e){function a(t){return n(t)&&o(t.length)&&!!U[M.call(t)]}var o=e(29),n=e(30),i="[object Arguments]",s="[object Array]",f="[object Boolean]",c="[object Date]",m="[object Error]",p="[object Function]",u="[object Map]",l="[object Number]",y="[object Object]",d="[object RegExp]",g="[object Set]",b="[object String]",x="[object WeakMap]",k="[object ArrayBuffer]",v="[object Float32Array]",h="[object Float64Array]",O="[object Int8Array]",z="[object Int16Array]",w="[object Int32Array]",I="[object Uint8Array]",j="[object Uint8ClampedArray]",_="[object Uint16Array]",R="[object Uint32Array]",U={};U[v]=U[h]=U[O]=U[z]=U[w]=U[I]=U[j]=U[_]=U[R]=!0,U[i]=U[s]=U[k]=U[f]=U[c]=U[m]=U[p]=U[u]=U[l]=U[y]=U[d]=U[g]=U[b]=U[x]=!1;var L=Object.prototype,M=L.toString;t.exports=a},function(t,r,e){function a(t){return o(t,n(t))}var o=e(45),n=e(41);t.exports=a},function(t,r){function e(t,r,e){e||(e={});for(var a=-1,o=r.length;++a2?e[i-2]:void 0,f=i>2?e[2]:void 0,c=i>1?e[i-1]:void 0;for("function"==typeof s?(s=o(s,c,5),i-=2):(s="function"==typeof c?c:void 0,i-=s?1:0),f&&n(e[0],e[1],f)&&(s=3>i?void 0:s,i=1);++a Date: Thu, 8 Sep 2016 16:06:50 -0500 Subject: [PATCH 19/27] iframe hidden at load --- client/app/home.html | 2 +- client/app/home.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/app/home.html b/client/app/home.html index e391515..f1cc0ed 100644 --- a/client/app/home.html +++ b/client/app/home.html @@ -4,7 +4,7 @@


    - +
    {{movie.title}}

    {{movie.overview}}
    diff --git a/client/app/home.js b/client/app/home.js index 55afcc8..9052c50 100644 --- a/client/app/home.js +++ b/client/app/home.js @@ -11,7 +11,7 @@ angular.module('costars.home' , []) $scope.loaded = true; //displays loading gif if false $scope.netflixData = []; // will be an array of object with info about netflix $scope.notOnNetflix = true; // means button won't work until false; - + $scope.showIFrame = false; //getMovies is called every time an actor is removed or added to the list $scope.getMovies = function (){ if(!$scope.currentSearches.length){ @@ -251,6 +251,7 @@ angular.module('costars.home' , []) $scope.detailFrame = undefined; $scope.watchForFree = function(movieInfo){ + $scope.showIFrame = true; console.log("pirate source is: ", movieInfo.pirate_src); $scope.detailFrame = $sce.trustAsResourceUrl(movieInfo.pirate_src); // window.open("http://putlocker.is/watch-" + movie.split(' ').join('-').split(':').join('').split('&').join('and') + "-online-free-putlocker.html", '_blank'); From 89c5678c025ed4e83b4444ba5e962676406de9f0 Mon Sep 17 00:00:00 2001 From: Anjum Faraz Date: Thu, 8 Sep 2016 16:37:53 -0500 Subject: [PATCH 20/27] changes to animations, iframe, overview --- client/app/home.html | 4 ++-- client/styles.css | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/app/home.html b/client/app/home.html index f1cc0ed..cb72a2a 100644 --- a/client/app/home.html +++ b/client/app/home.html @@ -25,7 +25,7 @@

    -
    +
    @@ -37,7 +37,7 @@

      -
    • +
    • diff --git a/client/styles.css b/client/styles.css index 95e2da5..6cd013b 100644 --- a/client/styles.css +++ b/client/styles.css @@ -100,6 +100,9 @@ h3 { background-color: rgba(50, 50, 50, 0.9); z-index: 100; bottom: 2px; + position: fixed; + top: 55px; + right: 40px; } .finalScore { From e2e654d242da4625c75fb772752d58b7b244227e Mon Sep 17 00:00:00 2001 From: a-faraz Date: Thu, 8 Sep 2016 16:42:55 -0500 Subject: [PATCH 21/27] comments --- client/app/home.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/app/home.js b/client/app/home.js index 9052c50..24acc82 100644 --- a/client/app/home.js +++ b/client/app/home.js @@ -11,7 +11,7 @@ angular.module('costars.home' , []) $scope.loaded = true; //displays loading gif if false $scope.netflixData = []; // will be an array of object with info about netflix $scope.notOnNetflix = true; // means button won't work until false; - $scope.showIFrame = false; + $scope.showIFrame = false; // don't display iframe on load //getMovies is called every time an actor is removed or added to the list $scope.getMovies = function (){ if(!$scope.currentSearches.length){ @@ -251,7 +251,7 @@ angular.module('costars.home' , []) $scope.detailFrame = undefined; $scope.watchForFree = function(movieInfo){ - $scope.showIFrame = true; + $scope.showIFrame = true; // display iframe on pirate click console.log("pirate source is: ", movieInfo.pirate_src); $scope.detailFrame = $sce.trustAsResourceUrl(movieInfo.pirate_src); // window.open("http://putlocker.is/watch-" + movie.split(' ').join('-').split(':').join('').split('&').join('and') + "-online-free-putlocker.html", '_blank'); From f08977e8e8f14cace72f462461c340ec9e6cbef0 Mon Sep 17 00:00:00 2001 From: a-faraz Date: Thu, 8 Sep 2016 17:05:02 -0500 Subject: [PATCH 22/27] resize actor images --- client/app/home.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/app/home.html b/client/app/home.html index cb72a2a..61966dc 100644 --- a/client/app/home.html +++ b/client/app/home.html @@ -25,7 +25,7 @@

      -
      +
      From 59a0a8cb8332abd011005ace378f03aeb39f6a50 Mon Sep 17 00:00:00 2001 From: a-faraz Date: Thu, 8 Sep 2016 18:16:29 -0500 Subject: [PATCH 23/27] animation duration --- client/app/home.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/app/home.html b/client/app/home.html index 61966dc..6ec4049 100644 --- a/client/app/home.html +++ b/client/app/home.html @@ -25,7 +25,7 @@

      -
      +
      @@ -37,7 +37,7 @@

        -
      • +
      • From 4033308a75acce6b8f15e53a71d1c8f871064b5c Mon Sep 17 00:00:00 2001 From: a-faraz Date: Thu, 8 Sep 2016 19:03:27 -0500 Subject: [PATCH 24/27] modified opacity --- client/styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/styles.css b/client/styles.css index 6cd013b..1ddc72f 100644 --- a/client/styles.css +++ b/client/styles.css @@ -97,7 +97,7 @@ h3 { border-collapse: separate; border-spacing: inherit; color: white; - background-color: rgba(50, 50, 50, 0.9); + background-color: rgba(50, 50, 50, 1.0); z-index: 100; bottom: 2px; position: fixed; From c66cfffde586c6cd84b65e9e22c4841ebb7b7d0a Mon Sep 17 00:00:00 2001 From: Jimmy Stevenson Date: Fri, 9 Sep 2016 10:43:36 -0500 Subject: [PATCH 25/27] trailer and itunes functionality working --- client/app/home.html | 6 +++--- client/app/home.js | 26 +++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/client/app/home.html b/client/app/home.html index 6ec4049..5cbb41f 100644 --- a/client/app/home.html +++ b/client/app/home.html @@ -4,7 +4,7 @@


        - +
        {{movie.title}}

        {{movie.overview}}
        @@ -41,7 +41,7 @@

        - +

      diff --git a/client/app/home.js b/client/app/home.js index 24acc82..cd684e5 100644 --- a/client/app/home.js +++ b/client/app/home.js @@ -250,6 +250,18 @@ angular.module('costars.home' , []) $scope.detailFrame = undefined; + $scope.watchTrailer = function(movie){ + console.log("movie info is: ", movie.title) + $http.get("https://www.googleapis.com/youtube/v3/search?part=snippet&order=rating&q=" + movie.title.split(' ').join('+').split(':').join('').split('&').join('and') + movie.release_date.slice(0,4) + "+official+trailer&type=video&videoEmbeddable=true&key=AIzaSyAPOEAEiT5MYrlCXLxn2eVMAShpSTcDpS4") + .then(function(response) { + $scope.showIFrame = true; + var videoId = response.data.items[0].id.videoId; + console.log('youtube api call: ', response.data.items[0].id.videoId); + $scope.detailFrame = $sce.trustAsResourceUrl("https://www.youtube.com/embed/" + videoId + "?autoplay=1"); + // $scope.myWelcome = response.data; + }); + } + $scope.watchForFree = function(movieInfo){ $scope.showIFrame = true; // display iframe on pirate click console.log("pirate source is: ", movieInfo.pirate_src); @@ -262,9 +274,17 @@ angular.module('costars.home' , []) window.open("http://www.netflix.com/watch/" + id); } - $scope.watchOnAmazon = function(movieInfo){ - var movie = movieInfo.original_title - console.log("Link clicked to watch " + movie + " on Amazon.") + $scope.buyOnItunes = function(movieTitle){ + console.log("Link clicked to watch " + movieTitle + " on Amazon.") + $http.jsonp("https://itunes.apple.com/search?callback=JSON_CALLBACK&media=movie&entity=movie&limit=1&explict=yes&term=" + movieTitle.split(' ').join('+').split(':').join('').split('&').join('and')) + .then(function(response) { + var itunesUrl = response.data.results[0].trackViewUrl; + console.log('itunes api call: ', itunesUrl); + window.open(itunesUrl); + }) + // $scope.detailFrame = $sce.trustAsResourceUrl("https://www.youtube.com/embed/" + videoId + "?autoplay=1"); + // $scope.myWelcome = response.data; + // window.open("http://www.netflix.com/search/" + movie.split(' ').join('-')); // The following line needs to be changed to work with amazon maybe??? // window.open("http://www.netflix.com/search/" + movie.split(' ').join('-')); } From 496f755f211bbf7c133bcf5df38cf9137ccb4796 Mon Sep 17 00:00:00 2001 From: Garrett Holmes Date: Fri, 9 Sep 2016 10:15:37 -0500 Subject: [PATCH 26/27] game made easier --- client/app/game.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/app/game.js b/client/app/game.js index 7f88ae1..993d909 100644 --- a/client/app/game.js +++ b/client/app/game.js @@ -79,7 +79,7 @@ angular.module('costars.game', []) $scope.choices.push(correctChoice); } else{ - if(Math.random() < 0.7){ //reroll 70% of the time -> Increases the number of good questions at the cost of load time + if(Math.random() < 0.99){ //reroll 70% of the time -> Increases the number of good questions at the cost of load time return $scope.create(); }else{ answer = ""; @@ -195,7 +195,7 @@ angular.module('costars.game', []) var startTimer = function(){ stopTimer(); - $scope.time = 10; //reset to 10 seconds + $scope.time = 30; //reset to 10 seconds timer = $interval(function(){ $scope.time -= 1; if($scope.time <= 0){ From 75dfad21be66ec1d48815065f01f0510f3a6b30a Mon Sep 17 00:00:00 2001 From: Garrett Holmes Date: Fri, 9 Sep 2016 10:50:23 -0500 Subject: [PATCH 27/27] Only scrapes when pirate flag button clicked --- client/app/factories.js | 2 +- client/app/home.js | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/client/app/factories.js b/client/app/factories.js index 7017eff..0e33c1b 100644 --- a/client/app/factories.js +++ b/client/app/factories.js @@ -226,7 +226,7 @@ angular.module('costars.factories', []) // readme: need to send server the year. - $http({method: 'GET',url: '/movielink/'+urlTitle+'?'+movieObj.release_date.substring(0,4)}).then(resp=>{ + return $http({method: 'GET',url: '/movielink/'+urlTitle+'?'+movieObj.release_date.substring(0,4)}).then(resp=>{ var url = resp.data; movieObj.pirate_src = url; diff --git a/client/app/home.js b/client/app/home.js index cd684e5..06a8d33 100644 --- a/client/app/home.js +++ b/client/app/home.js @@ -36,7 +36,7 @@ angular.module('costars.home' , []) .then(function(netflixInfo){ val.onNetflix = netflixInfo.data.available; val.external_id = netflixInfo.data.netflixId; - PirateShip.getAndVerifyLink(val); + // PirateShip.getAndVerifyLink(val); console.log('object after netflix call', data.known_for); $scope.loaded = true; }) @@ -62,7 +62,7 @@ angular.module('costars.home' , []) $scope.loaded = true; val.onNetflix = netflixInfo.data.available; val.external_id = netflixInfo.data.netflixId; - PirateShip.getAndVerifyLink(val); + //PirateShip.getAndVerifyLink(val); console.log('object after netflix call', data.results[0].known_for); }) }) @@ -88,7 +88,7 @@ angular.module('costars.home' , []) $scope.loaded = true; val.onNetflix = netflixInfo.data.available; val.external_id = netflixInfo.data.netflixId; - PirateShip.getAndVerifyLink(val); + //PirateShip.getAndVerifyLink(val); console.log('object after netflix call', movies[0]); }) }) @@ -177,7 +177,7 @@ angular.module('costars.home' , []) $scope.loaded = true; val.onNetflix = netflixInfo.data.available; val.external_id = netflixInfo.data.netflixId; - PirateShip.getAndVerifyLink(val); + //PirateShip.getAndVerifyLink(val); console.log('object after netflix call', actorData.known_for); }) }) @@ -263,9 +263,12 @@ angular.module('costars.home' , []) } $scope.watchForFree = function(movieInfo){ - $scope.showIFrame = true; // display iframe on pirate click - console.log("pirate source is: ", movieInfo.pirate_src); - $scope.detailFrame = $sce.trustAsResourceUrl(movieInfo.pirate_src); + PirateShip.getAndVerifyLink(movieInfo).then(resp=>{ + $scope.showIFrame = true; // display iframe on pirate click + console.log("pirate source is: ", movieInfo.pirate_src); + $scope.detailFrame = $sce.trustAsResourceUrl(movieInfo.pirate_src); + }); + // window.open("http://putlocker.is/watch-" + movie.split(' ').join('-').split(':').join('').split('&').join('and') + "-online-free-putlocker.html", '_blank'); }