EZTV Plugin
Added by ßlueplanet . almost 9 years ago
With the ball officially rolling on torrent streaming, I thought I would look around for an EZTV API.
(EZTV is basically the popcorn time of TV)
I managed to find one written in JavaScript, but don't really know how to edit the js file to work within showtime.
var request = require('request');
var cheerio = require('cheerio');
var S = require('string');
var self = module.exports;
self.getShows = function(options, callback) {
request("http://eztv.it/showlist/", function (error, response, body) {
if (!error && response.statusCode == 200) {
var list = [];
var $ = cheerio.load(body);
var $elements = $("table.forum_header_border tr[name=hover]");
$elements.each(function(i, e) {
var show = {};
show.url = $(e).find("td").eq(0).find("a").attr("href");
var regex = show.url.match(/\/shows\/(\d+)\/([^\/]+)/);
if (!regex) {
//console.log("Unparsed show: " + show.url);
return;
}
show.id = parseInt(regex[1]);
show.slug = regex[2];
var title = $(e).find("td").eq(0).text();
if (S(title).endsWith(", The")) {
title = "The " + S(title).chompRight(", The").s;
}
show.title = title;
show.status = $(e).find("td").eq(1).find("font").attr("class");
if (options && options.query) {
if (show.title.toLowerCase().search(options.query.toLowerCase()) >= 0) {
//console.log(show.title);
list.push(show);
}
}
else {
list.push(show);
}
});
if (callback) callback(null, list);
}
else {
if (callback) callback(new Error("Error getting shows"), null);
}
});
};
self.getShowEpisodes = function(showId, callback) {
request("http://eztv.it/shows/" + showId + "/", function (error, response, body) {
if (!error && response.statusCode == 200) {
var result = {
id: showId,
episodes: []
};
var $ = cheerio.load(body);
result.title = $("td.section_post_header").eq(0).find("b").text();
var $episodes = $("table.forum_header_noborder tr[name=hover]");
$episodes.each(function(i, e) {
var episode = {};
episode.url = $(e).find("td").eq(1).find("a").attr("href");
var urlRegex = episode.url.match(/\/ep\/(\d+)\/.*/);
episode.id = parseInt(urlRegex[1]);
episode.title = $(e).find("td").eq(1).find("a").text();
var titleRegex = episode.title.match(/(.+) s?(\d+)[ex](\d+)(e(\d+))?(.*)/i);
if (titleRegex) {
episode.show = titleRegex[1];
episode.seasonNumber = parseInt(titleRegex[2]);
episode.episodeNumber = parseInt(titleRegex[3]);
episode.episodeNumber2 = parseInt(titleRegex[5]);
episode.extra = titleRegex[6].trim();
episode.proper = episode.extra.toLowerCase().indexOf("proper") >= 0;
episode.repack = episode.extra.toLowerCase().indexOf("repack") >= 0;
}
else {
//console.log("unparsed episode: " + episode.title);
}
episode.magnet = $(e).find("td").eq(2).find("a.magnet").attr("href");
episode.torrentURL = $(e).find("td").eq(2).find("a.download_1").attr("href");
result.episodes.push(episode);
});
if (callback) callback(null, result);
}
else {
if (callback) callback(new Error("Error getting show episodes"), null);
}
});
}
heres the repo
https://github.com/moesalih/node-eztv
Replies (41)
RE: EZTV Plugin
-
Added by gekko nl almost 8 years ago
Thank you for your reply
Nice to hear that everything is working and that you like it.
Those two things i added to my todo list.
RE: EZTV Plugin
-
Added by - SBP - almost 8 years ago
gekko nl wrote:
Good afternoon,
Nice to hear that it works for you :)
Yes the https links wont work i know that but add it for later use.
And its better to turn off the load extra info its very slow because of the limited request i can do.SBP can you please try the other link in the option menu en turn off load extra info.
Yeah, that works now, thanks it was the url link as you suggested. Once I changed that. Things are working. Including load extra info etc.... just got back so I'll try playing some links later.
Thanks again for this nice plugin.
I just tried a few links and all working great so far. I like it. Keep up the great work.
RE: EZTV Plugin
-
Added by Leonid Protasov almost 8 years ago
Hey, I have practically rewritten plugin from scratch. Now it properly paginates, searches, sorts seasons and episodes, indicates all info and hd quality (sd can be forced via settings). Gekko, you only need to go into plugin repo and push Injest button.
For those who can't wait and wants to manually update here's the link to new version https://github.com/lprot/showtime-plugins/blob/master/plugins/eztvapi.zip?raw=true
Gekko, the source can be found here: https://github.com/lprot/showtime-plugins/tree/master/eztvapi
About Seen marks and duration not show - that's Movian's bug, you just need to wait for a new version...
RE: EZTV Plugin
-
Added by - SBP - almost 8 years ago
Leonid Protasov wrote:
Hey, I have practically rewritten plugin from scratch. Now it properly paginates, searches, sorts seasons and episodes, indicates all info and hd quality (sd can be forced via settings). Gekko, you only need to go into plugin repo and push Injest button.
For those who can't wait and wants to manually update here's the link to new version https://github.com/lprot/showtime-plugins/blob/master/plugins/eztvapi.zip?raw=true
Gekko, the source can be found here: https://github.com/lprot/showtime-plugins/tree/master/eztvapi
About Seen marks and duration not show - that's Movian's bug, you just need to wait for a new version...
Sweet. Great job, thanks as always. I will probably wait for the update push to test.
RE: EZTV Plugin
-
Added by gekko nl almost 8 years ago
Thank you for rewritting it because the script was a bit messy :D
i didt have the time yet for rewritting it and adding new options
so many thanks i will look into the code,
Iam thinking about adding
- quality options when opening episode
- something like Trakt.tv so you can track what you have been watching
RE: EZTV Plugin
-
Added by ludwig esteve almost 8 years ago
This plug-in is awesome, but i cannot play any video (ps3) tells me there a problem with the link.
Any idea?
Thanks a lot
RE: EZTV Plugin
-
Added by Leonid Protasov almost 8 years ago
ludwig esteve wrote:
This plug-in is awesome, but i cannot play any video (ps3) tells me there a problem with the link.
Any idea?
Thanks a lot
Is the Movian 4.10? If yes, try to set another domain in settings...
RE: EZTV Plugin
-
Added by ludwig esteve almost 8 years ago
I updated to Movian 4.10.21 and now the link error is gone, thanks a lot Mr Leonid.
The plug in seems to works, just looks like it need long time to load videos.....
Best regards.
RE: EZTV Plugin
-
Added by Leonid Protasov almost 8 years ago
ludwig esteve wrote:
I updated to Movian 4.10.21 and now the link error is gone, thanks a lot Mr Leonid.
The plug in seems to works, just looks like it need long time to load videos.....
Best regards.
You can set in settings force SD mode and it will be better for HD videos. I never managed to play HD properly
RE: EZTV Plugin
-
Added by Jacen Solo over 7 years ago
First of all, thanks for the great plug-in!
I would like to report a possible bug. The plug-in stopped working a few days ago, I'm unable to open it as it results a error message saying it's unable to open resource.
I've attached a log.
tmp_22002-movian-0-357635141.log (8.56 KB)
RE: EZTV Plugin
-
Added by Leonid Protasov over 7 years ago
Jacen Solo wrote:
First of all, thanks for the great plug-in!
I would like to report a possible bug. The plug-in stopped working a few days ago, I'm unable to open it as it results a error message saying it's unable to open resource.
I've attached a log.
I commented the issue here: https://movian.tv/issues/2821
RE: EZTV Plugin
-
Added by nikkpap (Nikos) over 7 years ago
hi leonid ...
look here and the rest you know them better
i tried to replace the only the https// links worked but i get only the first page of the series
please add a a-z , z-a sort list
thanks
RE: EZTV Plugin
-
Added by gekko nl over 7 years ago
Nice nikos
I was looking for that if i got some time i will fix the plugin.
Thank you for the link
RE: EZTV Plugin
-
Added by gekko nl over 7 years ago
Updated the plugin today.
I would like to know the source that popcorn-time.se is using for there app
because they dont relay on the yts.re api and the eztv one.
But i hope you all enjoy the eztvapi plugin again.
and the yts.re plugin is also working again great job leonid.
« Previous 1 2 (26-41/41)