add netflix title
This commit is contained in:
@@ -66,6 +66,7 @@ class FlixInfo {
|
|||||||
const netflixOverview = ($($('[name="description"]')).attr('content'));
|
const netflixOverview = ($($('[name="description"]')).attr('content'));
|
||||||
const netflixPoster = ($($('[class="img lazyload poster"]')).attr('data-src'));
|
const netflixPoster = ($($('[class="img lazyload poster"]')).attr('data-src'));
|
||||||
let tmdbURL
|
let tmdbURL
|
||||||
|
let title
|
||||||
|
|
||||||
if (theMovieDbLanguage) {
|
if (theMovieDbLanguage) {
|
||||||
|
|
||||||
@@ -78,7 +79,7 @@ class FlixInfo {
|
|||||||
else {
|
else {
|
||||||
const findTitle = ($($('[property="og:title"]')).attr('content'));
|
const findTitle = ($($('[property="og:title"]')).attr('content'));
|
||||||
const splitString = findTitle.split("- Netflix");
|
const splitString = findTitle.split("- Netflix");
|
||||||
const title = splitString[0].split("(")[0].trim();
|
title = splitString[0].split("(")[0].trim();
|
||||||
const year = splitString[0].split("(")[1].split(")")[0].trim();
|
const year = splitString[0].split("(")[1].split(")")[0].trim();
|
||||||
// create (find) tmdb api url
|
// create (find) tmdb api url
|
||||||
tmdbURL = theMovieDbURL + 'search/' + type + '?api_key=' + tmdbApiKey + '&language=' + theMovieDbLanguage + '&query=' + title + '&first_air_date_year=' + year;
|
tmdbURL = theMovieDbURL + 'search/' + type + '?api_key=' + tmdbApiKey + '&language=' + theMovieDbLanguage + '&query=' + title + '&first_air_date_year=' + year;
|
||||||
@@ -146,6 +147,7 @@ class FlixInfo {
|
|||||||
} else {
|
} else {
|
||||||
getDetailResult.netflix_overview = netflixOverview;
|
getDetailResult.netflix_overview = netflixOverview;
|
||||||
getDetailResult.netflix_poster = netflixPoster;
|
getDetailResult.netflix_poster = netflixPoster;
|
||||||
|
getDetailResult.netflix_title = title;
|
||||||
returnResult = { result: 1, error: 0, watch: type, details: getDetailResult, credits: getCreditsResult, images: getImagesResult, trailers: getTrailersResult };
|
returnResult = { result: 1, error: 0, watch: type, details: getDetailResult, credits: getCreditsResult, images: getImagesResult, trailers: getTrailersResult };
|
||||||
resolve(returnResult);
|
resolve(returnResult);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user