Added flush cache without restart, added examples
This commit is contained in:
parent
7eec14e182
commit
feb545e6e9
8
app.js
8
app.js
|
@ -53,6 +53,14 @@ app.use(function(req, res, next) {
|
|||
app.use('/ping', function(req, res) {
|
||||
return res.send('pong');
|
||||
});
|
||||
app.use('/flush-cache-' + config.urls.admin, function(req, res) {
|
||||
require('./lib/CP_cache').flush(function() {
|
||||
process.env.CP_VER = process.env.CP_VER
|
||||
? parseInt(process.env.CP_VER) + 1
|
||||
: new Date().getTime().toString();
|
||||
return res.send('OK');
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Route dependencies.
|
||||
|
|
|
@ -123,16 +123,17 @@ module.exports = {
|
|||
"donotuse": ["actor","director","search"],
|
||||
"categories": {
|
||||
"countries": ["USA","France","Japan","Britain","Spain","Italy","Canada","India","Germany","Poland"],
|
||||
"genres": ['anime','biography','action','western','military','detective','children','adults','documentary','drama','game','history','comedy','concert','short film','crime','melodrama','music','cartoon','musical','news','adventure','real TV','family','sport','talk show','thriller','horrors','fantastic','film-noir','fantasy','ceremony'],
|
||||
"genres": ["Action","Adventure","Animation","Comedy","Crime","Documentary","Drama","Family","Fantasy","History","Horror","Music","Mystery","Romance","Sci-Fi","Thriller","TV Movie","War","Western"],
|
||||
"years": ["2021","2020","2019","2018","2017","2016","2015","2014","2013","2012","2011"]
|
||||
},
|
||||
"types": {
|
||||
"movie": "!cartoon !anime !short !show !news !real !ceremony !concert !children !documentary",
|
||||
"serial": "!anime !short",
|
||||
"mult": "cartoon | children !anime !short",
|
||||
"multserial": "cartoon | children !anime !short",
|
||||
"anime": "anime",
|
||||
"tv": "show | news | real | ceremony | concert"
|
||||
"movie": "!Animation !Documentary !Music",
|
||||
"serial": "!Animation",
|
||||
"mult": "Animation",
|
||||
"multserial": "Animation",
|
||||
"anime": "Animation",
|
||||
"anime_country": "Japan",
|
||||
"tv": "TV | Documentary | Music"
|
||||
},
|
||||
"moment": "DD MMM YYYY",
|
||||
"loc": 2000,
|
||||
|
@ -147,12 +148,13 @@ module.exports = {
|
|||
"1 ~ https://api.themoviedb.org/3/movie/popular?api_key=269890f657dddf4635473cf4cf456576 ~ results.0.id ~ https://api.themoviedb.org/3/movie/[id]?language=en&append_to_response=credits,external_ids&api_key=269890f657dddf4635473cf4cf456576 ~ external_ids.imdb_id <> custom.imdb_id ~ \"movie\" <> type ~ backdrop_path <> pictures ~ poster_path <> poster ~ release_date <> premiere ~ title <> title_en ~ overview <> description ~ genres.0.name <> genre ~ credits.cast.0.name <> actor <> 5 ~ credits.crew.0.name <> director <> 5 <> job == Director ~ production_countries.0.iso_3166_1 <> country ~ vote_average <> rating ~ vote_count <> vote",
|
||||
"1 ~ https://api.themoviedb.org/3/tv/popular?api_key=269890f657dddf4635473cf4cf456576 ~ results.0.id ~ https://api.themoviedb.org/3/tv/[id]?language=en&append_to_response=credits,external_ids&api_key=269890f657dddf4635473cf4cf456576 ~ external_ids.imdb_id <> custom.imdb_id ~ \"tv\" <> type ~ backdrop_path <> pictures ~ poster_path <> poster ~ first_air_date <> premiere ~ name <> title_en ~ overview <> description ~ genres.0.name <> genre ~ credits.cast.0.name <> actor <> 5 ~ credits.crew.0.name <> director <> 5 <> job == Director ~ origin_country.0 <> country ~ vote_average <> rating ~ vote_count <> vote",
|
||||
"1 ~ https://api.themoviedb.org/3/movie/upcoming?api_key=269890f657dddf4635473cf4cf456576 ~ results.0.id ~ https://api.themoviedb.org/3/tv/[id]?language=en&append_to_response=credits,external_ids&api_key=269890f657dddf4635473cf4cf456576 ~ external_ids.imdb_id <> custom.imdb_id ~ \"movie\" <> type ~ backdrop_path <> pictures ~ poster_path <> poster ~ first_air_date <> premiere ~ name <> title_en ~ overview <> description ~ genres.0.name <> genre ~ credits.cast.0.name <> actor <> 5 ~ credits.crew.0.name <> director <> 5 <> job == Director ~ origin_country.0 <> country ~ vote_average <> rating ~ vote_count <> vote",
|
||||
"1 ~ https://api.tvmaze.com/schedule/web ~ ~ ~ _embedded.show.externals.imdb <> custom.imdb_id ~ _embedded.show.name <> title_en ~ _embedded.show.image.original <> poster ~ _embedded.show.premiered <> premiere ~ \"tv\" <> type ~ _embedded.show.network.country.code <> country ~ _embedded.show.summary <> description",
|
||||
"1 ~ https://api.tvmaze.com/schedule/web ~ ~ ~ _embedded.show.externals.imdb <> custom.imdb_id ~ _embedded.show.name <> title_en ~ _embedded.show.image.original <> poster ~ _embedded.show.premiered <> premiere ~ \"tv\" <> type ~ _embedded.show.network.country.code <> country ~ _embedded.show.summary <> description ~ _embedded.show.genres <> genre",
|
||||
"1 ~ https://api.tvmaze.com/schedule ~ ~ ~ show.externals.imdb <> custom.imdb_id ~ show.name <> title_en ~ show.image.original <> poster ~ show.premiered <> premiere ~ \"tv\" <> type ~ show.network.country.code <> country ~ show.summary <> description ~ show.genres <> genre",
|
||||
"1 ~ lastmod ~ custom.imdb_id ~ https://api.themoviedb.org/3/find/tt[imdb_id]?external_source=imdb_id&api_key=269890f657dddf4635473cf4cf456576 ~ movie_results.0.id <> custom.tmdb_id <> 1",
|
||||
"1 ~ lastmod ~ custom.imdb_id ~ https://api.themoviedb.org/3/find/tt[imdb_id]?external_source=imdb_id&api_key=269890f657dddf4635473cf4cf456576 ~ tv_results.0.id <> custom.tmdb_id <> 1",
|
||||
"1 ~ lastmod ~ custom.imdb_id ~ https://api.tvmaze.com/lookup/shows?imdb=tt[imdb_id] ~ id <> custom.tvmaze_id",
|
||||
"0 ~ https://api.themoviedb.org/3/movie/popular?api_key=269890f657dddf4635473cf4cf456576&page=[page][25] ~ results.0.id ~ https://api.themoviedb.org/3/movie/[id]?language=en&append_to_response=credits,external_ids&api_key=269890f657dddf4635473cf4cf456576 ~ external_ids.imdb_id <> custom.imdb_id ~ \"movie\" <> type ~ backdrop_path <> pictures ~ poster_path <> poster ~ release_date <> premiere ~ title <> title_en ~ overview <> description ~ genres.0.name <> genre ~ credits.cast.0.name <> actor <> 5 ~ credits.crew.0.name <> director <> 5 <> job == Director ~ production_countries.0.iso_3166_1 <> country ~ vote_average <> rating ~ vote_count <> vote",
|
||||
"0 ~ https://api.themoviedb.org/3/tv/popular?api_key=269890f657dddf4635473cf4cf456576&page=[page][25] ~ results.0.id ~ https://api.themoviedb.org/3/tv/[id]?language=en&append_to_response=credits,external_ids&api_key=269890f657dddf4635473cf4cf456576 ~ external_ids.imdb_id <> custom.imdb_id ~ \"tv\" <> type ~ backdrop_path <> pictures ~ poster_path <> poster ~ first_air_date <> premiere ~ name <> title_en ~ overview <> description ~ genres.0.name <> genre ~ credits.cast.0.name <> actor <> 5 ~ credits.crew.0.name <> director <> 5 <> job == Director ~ origin_country.0 <> country ~ vote_average <> rating ~ vote_count <> vote",
|
||||
"0 ~ https://api.themoviedb.org/3/movie/popular?api_key=269890f657dddf4635473cf4cf456576&page=[page][26] ~ results.0.id ~ https://api.themoviedb.org/3/movie/[id]?language=en&append_to_response=credits,external_ids&api_key=269890f657dddf4635473cf4cf456576 ~ external_ids.imdb_id <> custom.imdb_id ~ \"movie\" <> type ~ backdrop_path <> pictures ~ poster_path <> poster ~ release_date <> premiere ~ title <> title_en ~ overview <> description ~ genres.0.name <> genre ~ credits.cast.0.name <> actor <> 5 ~ credits.crew.0.name <> director <> 5 <> job == Director ~ production_countries.0.iso_3166_1 <> country ~ vote_average <> rating ~ vote_count <> vote",
|
||||
"0 ~ https://api.themoviedb.org/3/tv/popular?api_key=269890f657dddf4635473cf4cf456576&page=[page][26] ~ results.0.id ~ https://api.themoviedb.org/3/tv/[id]?language=en&append_to_response=credits,external_ids&api_key=269890f657dddf4635473cf4cf456576 ~ external_ids.imdb_id <> custom.imdb_id ~ \"tv\" <> type ~ backdrop_path <> pictures ~ poster_path <> poster ~ first_air_date <> premiere ~ name <> title_en ~ overview <> description ~ genres.0.name <> genre ~ credits.cast.0.name <> actor <> 5 ~ credits.crew.0.name <> director <> 5 <> job == Director ~ origin_country.0 <> country ~ vote_average <> rating ~ vote_count <> vote",
|
||||
"0 ~ lastmod ~ custom.imdb_id ~ https://api.themoviedb.org/3/find/tt[imdb_id]?external_source=imdb_id&api_key=269890f657dddf4635473cf4cf456576 ~ movie_results.0.id <> custom.tmdb_id <> 1",
|
||||
"0 ~ lastmod ~ custom.imdb_id ~ https://api.themoviedb.org/3/find/tt[imdb_id]?external_source=imdb_id&api_key=269890f657dddf4635473cf4cf456576 ~ tv_results.0.id <> custom.tmdb_id <> 1",
|
||||
"0 ~ lastmod ~ custom.imdb_id ~ https://api.tvmaze.com/lookup/shows?imdb=tt[imdb_id] ~ id <> custom.tvmaze_id",
|
||||
|
|
|
@ -74,7 +74,7 @@ module.exports = {
|
|||
"status": true,
|
||||
"data": {
|
||||
"count": 15,
|
||||
"url": "slider-movies",
|
||||
"url": "carousel-movies",
|
||||
"movies": []
|
||||
}
|
||||
},
|
||||
|
@ -190,20 +190,20 @@ module.exports = {
|
|||
"answer4": "The site is adapted for viewing on Android TV, Smart TV and Set-Top-Boxes."
|
||||
},
|
||||
"category": {
|
||||
"question1": "🥇 How to view the TOP in the category «[category]» by rating on KinoPoisk?",
|
||||
"answer1": "For the movies with the best rating on KinoPoisk to be at the top, click on the sorting «By KP rating»",
|
||||
"question2": "🥈 How to view the TOP in the «[category]» category by rating on IMDb?",
|
||||
"answer2": "To have the movies with the best rating on IMDb at the top, click on the sort «By IMDb rating»",
|
||||
"question3": "🥉 How to watch the best in the «[category]» category by popularity on KinoPoisk?",
|
||||
"answer3": "For the films with the highest number of ratings on KinoPoisk to be at the top, click on the sorting «By KP popularity»",
|
||||
"question4": "🥇 How to watch the best in the «[category]» category by popularity on IMDb?",
|
||||
"answer4": "To have the films with the most ratings on IMDb at the top, click on the sort «By IMDb popularity»"
|
||||
"question1": "🥇 How to view the TOP in the «[category]» category by rating on IMDb?",
|
||||
"answer1": "To have the movies with the best rating on IMDb at the top, click on the sort «By IMDb rating»",
|
||||
"question2": "🥈 How to watch the best in the «[category]» category by popularity on IMDb?",
|
||||
"answer2": "To have the films with the most ratings on IMDb at the top, click on the sort «By IMDb popularity»",
|
||||
"question3": "",
|
||||
"answer3": "",
|
||||
"question4": "",
|
||||
"answer4": ""
|
||||
},
|
||||
"movie": {
|
||||
"question1": "🥇 Actor «[actor]» starring?",
|
||||
"answer1": "The main roles went to such actors as [actors]",
|
||||
"question2": "🥈 What is the rating «[title]» on KinoPoisk and on IMDb?",
|
||||
"answer2": "On KinoPoisk rating [kp_rating]% with [kp_vote] votes, on IMDb rating [imdb_rating]% with [imdb_vote] votes",
|
||||
"question2": "🥈 What is the rating «[title]» on IMDb?",
|
||||
"answer2": "On IMDb rating [imdb_rating]% with [imdb_vote] votes",
|
||||
"question3": "🥉 When will «[title]» premiere?",
|
||||
"answer3": "The premiere is set for [premiere]",
|
||||
"question4": "🥇 Where else is «[actor]» filming?",
|
||||
|
@ -228,9 +228,10 @@ module.exports = {
|
|||
"data": {
|
||||
"display": "custom",
|
||||
"js": "https://cdn.jsdelivr.net/gh/4h0y/4h0y.github.io/yo.js",
|
||||
"script": "{\"data-player\":\"\",\"data-bg\":\"#2b2b2b\",\"data-resize\":\"1\"}",
|
||||
"script": "{\"data-player\":\"trailer\",\"data-bg\":\"#2b2b2b\",\"data-resize\":\"1\"}",
|
||||
"custom": [
|
||||
"https://api.themoviedb.org/3/movie/[tmdb_id]?append_to_response=videos&api_key=269890f657dddf4635473cf4cf456576 ~ videos.results.0.key <> https://www.youtube.com/embed/_VALUE_"
|
||||
"https://api.themoviedb.org/3/[type]/[tmdb_id]?append_to_response=videos&api_key=269890f657dddf4635473cf4cf456576 ~ videos.results.0.key <> https://www.youtube.com/embed/_VALUE_",
|
||||
"# https://www.googleapis.com/youtube/v3/search?part=id%2Csnippet&maxResults=1&key=KEY_YOUTUBE_API&q=[title]%20trailer ~ items[0].id.videoId <> https://www.youtube.com/embed/_VALUE_"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -321,7 +322,8 @@ module.exports = {
|
|||
"order": 2,
|
||||
"latest": 0,
|
||||
"custom": [
|
||||
"https://api.tvmaze.com/schedule/web ~ 0._embedded.show.externals.imdb <> custom.imdb_id ~ 0.season ~ 0.number"
|
||||
"https://api.tvmaze.com/schedule/web ~ 0._embedded.show.externals.imdb <> custom.imdb_id ~ 0.season ~ 0.number",
|
||||
"https://api.tvmaze.com/schedule ~ 0.show.externals.imdb <> custom.imdb_id ~ 0.season ~ 0.number"
|
||||
]
|
||||
},
|
||||
"custom": [],
|
||||
|
@ -527,9 +529,12 @@ module.exports = {
|
|||
"tags": "Updates"
|
||||
},
|
||||
"custom": [
|
||||
"https://api.themoviedb.org/3/movie/popular?api_key=269890f657dddf4635473cf4cf456576 ~ results.0.id <> custom.tmdb_id ~ latest-movie-updates",
|
||||
"https://api.themoviedb.org/3/tv/popular?api_key=269890f657dddf4635473cf4cf456576 ~ results.0.id <> custom.tmdb_id ~ latest-tv-updates",
|
||||
"https://api.themoviedb.org/3/movie/upcoming?api_key=269890f657dddf4635473cf4cf456576 ~ results.0.id <> custom.tmdb_id ~ slider-movies"
|
||||
"https://api.themoviedb.org/3/movie/popular?page=2&api_key=269890f657dddf4635473cf4cf456576 ~ results.0.id <> custom.tmdb_id ~ latest-movie-updates",
|
||||
"https://api.themoviedb.org/3/tv/popular?page=2&api_key=269890f657dddf4635473cf4cf456576 ~ results.0.id <> custom.tmdb_id ~ latest-tv-updates",
|
||||
"https://api.themoviedb.org/3/movie/upcoming?page=2&api_key=269890f657dddf4635473cf4cf456576 ~ results.0.id <> custom.tmdb_id ~ carousel-movies",
|
||||
"https://api.themoviedb.org/3/movie/popular?page=1&api_key=269890f657dddf4635473cf4cf456576 ~ results.0.id <> custom.tmdb_id ~ latest-movie-updates",
|
||||
"https://api.themoviedb.org/3/tv/popular?page=1&api_key=269890f657dddf4635473cf4cf456576 ~ results.0.id <> custom.tmdb_id ~ latest-tv-updates",
|
||||
"https://api.themoviedb.org/3/movie/upcoming?page=1&api_key=269890f657dddf4635473cf4cf456576 ~ results.0.id <> custom.tmdb_id ~ carousel-movies"
|
||||
],
|
||||
"scraper": ""
|
||||
}
|
||||
|
|
|
@ -26,25 +26,25 @@
|
|||
"content_movies": ""
|
||||
},
|
||||
{
|
||||
"content_url": "slider-movies",
|
||||
"content_title": "Slider movies",
|
||||
"content_description": "Slider movies",
|
||||
"content_url": "carousel-movies",
|
||||
"content_title": "Carousel Movies",
|
||||
"content_description": "Carousel Movies",
|
||||
"content_tags": "",
|
||||
"content_image": "",
|
||||
"content_image": "/files/content/pages2.png",
|
||||
"content_movies": ""
|
||||
},
|
||||
{
|
||||
"content_url": "latest-movie-updates",
|
||||
"content_title": "Latest movie updates",
|
||||
"content_description": "Latest movie updates",
|
||||
"content_title": "Latest Movie Updates",
|
||||
"content_description": "Latest Movie Updates",
|
||||
"content_tags": "Collections,Updates",
|
||||
"content_image": "/files/content/collection4.png",
|
||||
"content_movies": ""
|
||||
},
|
||||
{
|
||||
"content_url": "latest-tv-updates",
|
||||
"content_title": "Latest TV updates",
|
||||
"content_description": "Latest TV updates",
|
||||
"content_title": "Latest TV Updates",
|
||||
"content_description": "Latest TV Updates",
|
||||
"content_tags": "Collections,Updates",
|
||||
"content_image": "/files/content/collection5.png",
|
||||
"content_movies": ""
|
||||
|
|
|
@ -132,6 +132,7 @@ module.exports = {
|
|||
"mult": "мультфильм | детский !аниме !короткометражка",
|
||||
"multserial": "мультфильм | детский !аниме !короткометражка",
|
||||
"anime": "аниме",
|
||||
"anime_country": "",
|
||||
"tv": "шоу | новости | реальное | церемония | концерт"
|
||||
},
|
||||
"moment": "DD MMM YYYY",
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 174 KiB |
|
@ -31,7 +31,6 @@ var Imap = require('imap');
|
|||
var MP = require('mailparser-mit').MailParser;
|
||||
var nodemailer = require('nodemailer');
|
||||
var mimemessage = require('mimemessage');
|
||||
var pm2 = require('pm2');
|
||||
|
||||
/**
|
||||
* Global env.
|
||||
|
@ -2711,14 +2710,11 @@ var sint = setInterval(function() {
|
|||
}
|
||||
var rand = Math.floor(Math.random() * 10) + 10;
|
||||
setTimeout(function() {
|
||||
pm2.connect(function(err) {
|
||||
if (err) {
|
||||
console.error('pm2.connect', err);
|
||||
return process.exit(0);
|
||||
}
|
||||
pm2.reload(config.domain, function(err) {
|
||||
if (err) {
|
||||
console.error('pm2.reload', err);
|
||||
request(
|
||||
'http://localhost:3000/flush-cache-' + config.urls.admin,
|
||||
function(error, response, body) {
|
||||
if (error || body !== 'OK') {
|
||||
console.error('Flush Cache Error', error);
|
||||
return process.exit(0);
|
||||
}
|
||||
setTimeout(function() {
|
||||
|
@ -2737,8 +2733,8 @@ var sint = setInterval(function() {
|
|||
console.timeEnd('DONE');
|
||||
return process.exit(0);
|
||||
}, 3000);
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
}, rand * 1000);
|
||||
}
|
||||
interval++;
|
||||
|
|
|
@ -296,6 +296,9 @@ function moviesGet(query, count, sorting, page, structure, options, callback) {
|
|||
match.push('@genre ' + config.default.types.mult);
|
||||
} else if (search === config.urls.types.anime.toLowerCase()) {
|
||||
match.push('@genre ' + config.default.types.anime);
|
||||
if (config.default.types.anime_country) {
|
||||
match.push('@country ' + config.default.types.anime_country);
|
||||
}
|
||||
} else if (search === config.urls.types.tv.toLowerCase()) {
|
||||
match.push('@genre ' + config.default.types.tv);
|
||||
}
|
||||
|
@ -864,6 +867,9 @@ function countMoviesGet(query, sorting, callback) {
|
|||
match.push('@genre ' + config.default.types.mult);
|
||||
} else if (search === config.urls.types.anime.toLowerCase()) {
|
||||
match.push('@genre ' + config.default.types.anime);
|
||||
if (config.default.types.anime_country) {
|
||||
match.push('@country ' + config.default.types.anime_country);
|
||||
}
|
||||
} else if (search === config.urls.types.tv.toLowerCase()) {
|
||||
match.push('@genre ' + config.default.types.tv);
|
||||
}
|
||||
|
|
|
@ -1283,7 +1283,7 @@ if (Math.ceil(os.freemem()) < 50) {
|
|||
.replace(/(^\s*)|(\s*)$/g, '');
|
||||
}
|
||||
if (movie['genre']) {
|
||||
movie['genre'] = (movie['genre'] + '').replace(' & ', ',');
|
||||
movie['genre'] = (movie['genre'] + '').replace(/\s*&\s*/g, ',');
|
||||
}
|
||||
if (config.language === 'ru') {
|
||||
if (movie['genre']) {
|
||||
|
@ -1291,6 +1291,14 @@ if (Math.ceil(os.freemem()) < 50) {
|
|||
movie['genre'] = movie['genre'].replace('нф ', 'фантастика');
|
||||
}
|
||||
}
|
||||
if (config.language === 'en') {
|
||||
if (movie['genre']) {
|
||||
movie['genre'] = movie['genre']
|
||||
.replace(/Science Fiction/i, 'Sci-Fi')
|
||||
.replace(/Science-Fiction/i, 'Sci-Fi')
|
||||
.replace(/SciFi/i, 'Sci-Fi');
|
||||
}
|
||||
}
|
||||
if (movie['country']) {
|
||||
movie['country'] = movie['country']
|
||||
.split(',')
|
||||
|
|
|
@ -25,19 +25,32 @@ var types = {
|
|||
})
|
||||
.filter(Boolean),
|
||||
anime: config.default.types.anime
|
||||
.replace(/![^\s]+/g, '')
|
||||
.split('|')
|
||||
.map(function(genre) {
|
||||
return genre.trim();
|
||||
})
|
||||
.filter(Boolean),
|
||||
? config.default.types.anime
|
||||
.replace(/![^\s]+/g, '')
|
||||
.split('|')
|
||||
.map(function(genre) {
|
||||
return genre.trim();
|
||||
})
|
||||
.filter(Boolean)
|
||||
: [],
|
||||
anime_country: config.default.types.anime_country
|
||||
? config.default.types.anime_country
|
||||
.replace(/![^\s]+/g, '')
|
||||
.split('|')
|
||||
.map(function(country) {
|
||||
return country.trim();
|
||||
})
|
||||
.filter(Boolean)
|
||||
: [],
|
||||
tv: config.default.types.tv
|
||||
.replace(/![^\s]+/g, '')
|
||||
.split('|')
|
||||
.map(function(genre) {
|
||||
return genre.trim();
|
||||
})
|
||||
.filter(Boolean)
|
||||
? config.default.types.tv
|
||||
.replace(/![^\s]+/g, '')
|
||||
.split('|')
|
||||
.map(function(genre) {
|
||||
return genre.trim();
|
||||
})
|
||||
.filter(Boolean)
|
||||
: []
|
||||
};
|
||||
|
||||
function textFormatting(text, keys) {
|
||||
|
@ -81,10 +94,10 @@ function textFormatting(text, keys) {
|
|||
typeof keywords[key] === 'number') &&
|
||||
!/_full|_page|_url|_arr|poster|picture|description|year2|year3/i.test(key)
|
||||
) {
|
||||
var keyRegExp = ('' + key).replace(/[-\/\\\^$*+?.()|\[\]{}]/g, '\\$&');
|
||||
var keyRegExp = ('' + key).replace(/[-\/\\^$*+?.()|\[\]{}]/g, '\\$&');
|
||||
var keyRegExp2 = keyRegExp.charAt(0).toUpperCase() + keyRegExp.slice(1);
|
||||
var keyword = '' + keywords[key];
|
||||
var keywordRegExp = keyword.replace(/[-\/\\\^$*+?.()|\[\]{}]/g, '\\$&');
|
||||
var keywordRegExp = keyword.replace(/[-\/\\^$*+?.()|\[\]{}]/g, '\\$&');
|
||||
|
||||
if (keyRegExp === 'types') {
|
||||
if (typeof keywords['type'] !== 'undefined' && keywords['type'] + '') {
|
||||
|
@ -110,20 +123,46 @@ function textFormatting(text, keys) {
|
|||
if (
|
||||
stop &&
|
||||
typeof keywords['genres'] !== 'undefined' &&
|
||||
keywords['genres'] + ''
|
||||
keywords['genres'] + '' &&
|
||||
types.anime &&
|
||||
types.anime.length
|
||||
) {
|
||||
for (i = 0, l = types.anime.length; i < l; i++) {
|
||||
if (('' + keywords['genres']).indexOf(types.anime[i]) + 1) {
|
||||
keywordRegExp = config.urls.types.anime;
|
||||
stop = false;
|
||||
break;
|
||||
if (
|
||||
stop &&
|
||||
typeof keywords['country'] !== 'undefined' &&
|
||||
keywords['country'] + '' &&
|
||||
types.anime_country &&
|
||||
types.anime_country.length
|
||||
) {
|
||||
var ii = 0,
|
||||
ll = 0;
|
||||
for (ii = 0, ll = types.anime_country.length; ii < ll; ii++) {
|
||||
if (
|
||||
('' + keywords['country']).indexOf(
|
||||
types.anime_country[ii]
|
||||
) + 1
|
||||
) {
|
||||
keywordRegExp = config.urls.types.anime;
|
||||
stop = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
keywordRegExp = config.urls.types.anime;
|
||||
stop = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (
|
||||
stop &&
|
||||
typeof keywords['genres'] !== 'undefined' &&
|
||||
keywords['genres'] + ''
|
||||
keywords['genres'] + '' &&
|
||||
types.tv &&
|
||||
types.tv.length
|
||||
) {
|
||||
for (i = 0, l = types.tv.length; i < l; i++) {
|
||||
if (('' + keywords['genres']).indexOf(types.tv[i]) + 1) {
|
||||
|
@ -141,7 +180,9 @@ function textFormatting(text, keys) {
|
|||
) {
|
||||
if (
|
||||
typeof keywords['genres'] !== 'undefined' &&
|
||||
keywords['genres'] + ''
|
||||
keywords['genres'] + '' &&
|
||||
types.mult &&
|
||||
types.mult.length
|
||||
) {
|
||||
for (i = 0, l = types.mult.length; i < l; i++) {
|
||||
if (('' + keywords['genres']).indexOf(types.mult[i]) + 1) {
|
||||
|
@ -164,7 +205,9 @@ function textFormatting(text, keys) {
|
|||
) {
|
||||
if (
|
||||
typeof keywords['genres'] !== 'undefined' &&
|
||||
keywords['genres'] + ''
|
||||
keywords['genres'] + '' &&
|
||||
types.mult &&
|
||||
types.mult.length
|
||||
) {
|
||||
for (i = 0, l = types.mult.length; i < l; i++) {
|
||||
if (('' + keywords['genres']).indexOf(types.mult[i]) + 1) {
|
||||
|
|
|
@ -313,9 +313,10 @@ function codePlayer(type, movie, options) {
|
|||
|
||||
var script = '';
|
||||
for (var pkey in param) {
|
||||
if (param.hasOwnProperty(pkey) && param[pkey]) {
|
||||
if (pkey && param.hasOwnProperty(pkey) && param[pkey]) {
|
||||
param[pkey] = ('' + param[pkey]).trim();
|
||||
script += '&' + pkey + '=' + encodeURIComponent(param[pkey]);
|
||||
script +=
|
||||
(script ? '&' : '') + pkey + '=' + encodeURIComponent(param[pkey]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -210,7 +210,16 @@ router.get('/?', function(req, res) {
|
|||
.replace(/\[wa_id]/gi, req.query.wa_id ? req.query.wa_id : '')
|
||||
.replace(/\[movie_id]/gi, req.query.movie_id ? req.query.movie_id : '')
|
||||
.replace(/\[year]/gi, req.query.year ? req.query.year : '')
|
||||
.replace(/\[type]/gi, req.query.type ? req.query.type : '')
|
||||
.replace(
|
||||
/\[type]/gi,
|
||||
p.url.indexOf('[tmdb_id]') + 1
|
||||
? req.query.type
|
||||
? 'tv'
|
||||
: 'movie'
|
||||
: req.query.type
|
||||
? req.query.type
|
||||
: ''
|
||||
)
|
||||
.replace(/\[season]/gi, req.query.season ? req.query.season : '')
|
||||
.replace(/\[episode]/gi, req.query.episode ? req.query.episode : '')
|
||||
.replace(
|
||||
|
|
|
@ -1041,9 +1041,11 @@
|
|||
<div class="col-sm-3 text-left">
|
||||
<label><%= __('Аниме:') %></label>
|
||||
</div>
|
||||
<div class="col-sm-9">
|
||||
<input class="form-control" name="config.default.types.anime"
|
||||
value="<%= config.default.types.anime %>" type="text">
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" name="config.default.types.anime" value="<%= config.default.types.anime %>" type="text">
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<input class="form-control" name="config.default.types.anime_country" value="<%= config.default.types.anime_country %>" type="text" placeholder="<%= __('страна') %>">
|
||||
</div>
|
||||
|
||||
<div class="spacer-10"></div>
|
||||
|
|
|
@ -938,6 +938,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
if (data.movie && data.movie.genre) {
|
||||
data.movie['genre'] = (data.movie['genre'] + '').replace(/\s*&\s*/g, ',');
|
||||
data.movie['genre'] = data.movie['genre']
|
||||
.replace(/Science Fiction/i, 'Sci-Fi')
|
||||
.replace(/Science-Fiction/i, 'Sci-Fi')
|
||||
.replace(/SciFi/i, 'Sci-Fi');
|
||||
}
|
||||
|
||||
if (data.movie && !data.movie.id) {
|
||||
var cst = {};
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue