app.get('/', function(req, res) {
var id = req.query.id;
res.send("Welcome");
});
app.get('/category', function(req, res) {
var stream = x(baseUrl, '#moviehome .cat-item',[{
title: 'a',
id: 'a@href | catId',
thispage: 'a@href | category',
count : 'span | number',
}])
.stream()
stream.pipe(res)
});
app.get('/category/:name/page/:page', function(req, res) {
var page = req.params.page;
var name = req.params.name;
var xurl = 'https://channelmyanmar.org/category/'+name+'/page/'+page;
stream = x(xurl, {
title: 'title',
thispage: '.paginado ul li.dd a | number',
totalCount: '.paginado ul li:last-child a@href | number',
nextpage: '.paginado ul li.dd a | fix2',
totalpage: '.paginado ul li:last-child a@href',
results: x('.peliculas .items .item', [{
id: '@id | number',
quality: '.calidad2',
title: '.image img@alt | regex',
rate: '.imdbs',
type: '.typepost',
year: '.image img@alt | number',//'.fixyear .year',
link: ' a@href | movieid',
img: '.image img@src',
details: x('a@href', {
title: 'h1 | regex',
// description: 'a@href',
category: 'i.limpiar',
uploadDate: 'meta[itemprop="uploadDate"]@content',
embedUrl: 'meta[itemprop="embedUrl"]@content',
director: '#single div[itemprop="director"] meta@content',
actors: x('div[itemprop="actors"]', ['meta[itemprop="name"]@content']),
gallary: x('div.galeria_img', ['img@src']),
download: x('li.elemento', [{ size: '.c', site: '.b | host', quality: '.e', url: 'a@href' }]),
mega: x('li.elemento', [{ url: 'a@href | mega' }]),
yadi: x('li.elemento', [{url: 'a@href | yadi', id:'a@href | yadi |yadiId'}]),
})
}])
})
.stream()
stream.pipe(res)
});
// app.get('/category/:name/page/:page', function(req, res) {
// let catUrl = 'https://channelmyanmar.org/category/';
// var name = req.params.name,
// page = req.params.page,
// url = catUrl + name + '/page/' + page;
// var stream = x(url, {
// title: 'title',
// thispage: '.paginado ul li.dd a | number',
// totalCount: '.paginado ul li:last-child a@href | number',
// nextpage: '.paginado ul li.dd a | next',
// totalpage: '.paginado ul li:last-child a@href',
// data: x('.peliculas .items .item', [{
// id: '@id | number',
// quality: '.calidad2',
// title: '.image img@alt',
// }])
// }).stream()
// stream.pipe(res);
// // res.send(url)
// });