EZTV Plugin

Added by ßlueplanet . about 5 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 ßlueplanet . about 5 years ago

I have looked at buksa's ororo plugin (TV plugin) to see if there are any similarities in the code, but all the showtime plugins look completely different to me.

Im a bit of a noob when it comes to java anyway :P

I just thought I would post my findings, as its a great site for TV and the API is already in place.

RE: EZTV Plugin - Added by Leonid Protasov almost 5 years ago

Try to set my nickname as betapass.

RE: EZTV Plugin - Added by gekko nl about 4 years ago

Good afternoon,

Iam working on this plugin its almost finished,

I hope some one can help me with the magnet links in movian.

Greatings,

Gekko

RE: EZTV Plugin - Added by Leonid Protasov about 4 years ago

gekko nl wrote:

Good afternoon,

Iam working on this plugin its almost finished,

I hope some one can help me with the magnet links in movian.

Greatings,

Gekko

Maybe you can attach the plugin here or point to github if you store it there?

RE: EZTV Plugin - Added by gekko nl about 4 years ago

Its not finished yet i will post it later.

But you can open links with http://ipadress:42000/showtime/open

when you try to open a magnet link like this one its give you a hash error

Thats the problem i try to fix.

magnet:?xt=urn:btih:NTBDT7R5MYQHLCV2HCWEU2FLIOKVUYQ4&dn=The.100.S01E01.HDTV.x264-2HD&tr=udp://tracker.openbittorrent.com:80&tr=udp://open.demonii.com:80&tr=udp://tracker.coppersurfer.tk:80&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://exodus.desync.com:6969

RE: EZTV Plugin - Added by Andreas Smas about 4 years ago

Ok, seems that those magnet links use the older base32 encoded hash, fixed in 4.9.521

RE: EZTV Plugin - Added by gekko nl about 4 years ago

Thank you very mucht Andreas for your fast response,

Its working now i tested it this morning.

I will work on the plugin and post it here :) so more people can watch tv shows.

@ leonid can you add it later if you test it to the plugin list, would be nice.

RE: EZTV Plugin - Added by Leonid Protasov about 4 years ago

gekko nl wrote:

Thank you very mucht Andreas for your fast response,

Its working now i tested it this morning.

I will work on the plugin and post it here :) so more people can watch tv shows.

@ leonid can you add it later if you test it to the plugin list, would be nice.

np :) is just wonder why you didn't use .torrent links from that site?

you could just use it like:
torrent:url
torrent:browse:url

Try it and maybe you will like that way more :)

RE: EZTV Plugin - Added by gekko nl about 4 years ago

I didt use the source from the first post,
the site in the first post got alot of bad torrent links and not very fast (down)loading.

And i wanted to make something like yts.re because its fast and do the job right.

So i made a plugin with the resources from popcorn time ( TV Shows ) and that resources use magnet links,
i tried it this morning and its very fast you can start and watch a tv show in seconds same like yts.re.

This plugins together is popcorntime :) that is what a couple of people searching for here.

Iam happy that its working and i really like Movian thank you for making this work.

RE: EZTV Plugin - Added by - SBP - about 4 years ago

gekko nl wrote:

I didt use the source from the first post,
the site in the first post got alot of bad torrent links and not very fast (down)loading.

And i wanted to make something like yts.re because its fast and do the job right.

So i made a plugin with the resources from popcorn time ( TV Shows ) and that resources use magnet links,
i tried it this morning and its very fast you can start and watch a tv show in seconds same like yts.re.

This plugins together is popcorntime :) that is what a couple of people searching for here.

Iam happy that its working and i really like Movian thank you for making this work.

This sounds like a great movian plugin, I hope to see it soon added to the forums & plugin list. Keep up the great work. I will also put it through a test regiment once you are ready for release.

Cheers

RE: EZTV Plugin - Added by gekko nl about 4 years ago

i finishend the plugin and uploaded it here,
so lets test it :D

RE: EZTV Plugin - Added by - SBP - about 4 years ago

gekko nl wrote:

i finishend the plugin and uploaded it here,
so lets test it :D

Sweet, has this been added to the plugin list from within movian? I am not sure how to install from your git Repo on my ps3. If not maybe Leonid Protasov can push this to the plugin list for us. :)

RE: EZTV Plugin - Added by - SBP - about 4 years ago

gekko nl wrote:

i finishend the plugin and uploaded it here,
so lets test it :D

OK just installed it on my ps3 and it does not load. Here is snip of crash log.

00:00:15.685: navigator [INFO ]:Opening eztvapi:start
00:00:15.737: eztvapi [DEBUG]:Welkom bij eztvapi bekijk hier al uw tv shows groeten Gekko
00:00:15.929: eztvapi [ERROR]:TypeError (invalid base value) at zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:124
00:00:15.929: eztvapi [ERROR]:STACK DUMP: TypeError: invalid base value
00:00:15.930: duk_hobject_props.c:2085
00:00:15.930: addShowItem zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:124
00:00:15.930: lader zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:95
00:00:15.930: browseItems zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:101
00:00:15.931: anon zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:110 preventsyield
00:00:15.931: apply native strict preventsyield
00:00:15.931: anon showtime/page:366 preventsyield

Also it is listed as eztvapi in the plugin list not just eztv is this the correct name?

RE: EZTV Plugin - Added by gekko nl about 4 years ago

Thank you for testing it,
I really hate the message Invalid base value
but i will look into it and fix it :D

So we all can watch tv shows.

RE: EZTV Plugin - Added by Leonid Protasov about 4 years ago

gekko nl wrote:

Thank you for testing it,
I really hate the message Invalid base value
but i will look into it and fix it :D

So we all can watch tv shows.

I can't reproduce the error, maybe it can be something like geoprotection? or old movian ver?

RE: EZTV Plugin - Added by ßlueplanet . about 4 years ago

Leonid Protasov wrote:

gekko nl wrote:

Thank you for testing it,
I really hate the message Invalid base value
but i will look into it and fix it :D

So we all can watch tv shows.

I can't reproduce the error, maybe it can be something like geoprotection? or old movian ver?

Well geo is definitely a factor as eztv.re and popcorntime.io are both blocked in my country

this is a log from when i first opened the plugin

00:00:27.204: navigator [INFO ]:Opening eztvapi:start
00:00:27.269: eztvapi [DEBUG]:Welkom bij eztvapi bekijk hier al uw tv shows groeten Gekko
00:00:27.619: eztvapi [ERROR]:SyntaxError (invalid json (at offset 1)) at (null):0
00:00:27.619: eztvapi [ERROR]:STACK DUMP: SyntaxError: invalid json (at offset 1)
00:00:27.619: duk_bi_json.c:75
00:00:27.620: parse native strict preventsyield
00:00:27.620: lader zip:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:89
00:00:27.620: browseItems zip:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:101
00:00:27.620: anon zip:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:110 preventsyield
00:00:27.621: apply native strict preventsyield
00:00:27.621: anon showtime/page:366 preventsyield

And after changing the url to eztv.ch

00:01:09.839: navigator [INFO ]:Opening eztvapi:start
00:01:09.863: eztvapi [DEBUG]:Welkom bij eztvapi bekijk hier al uw tv shows groeten Gekko
00:01:10.894: eztvapi [ERROR]:Error (HTTP request failed https://eztv.ch/shows/1 -- HTTP error: 404) at /project/repo/checkout/src/ecmascript/es_io.c:412
00:01:10.894: eztvapi [ERROR]:STACK DUMP: Error: HTTP request failed https://eztv.ch/shows/1 -- HTTP error: 404
00:01:10.895: /project/repo/checkout/src/ecmascript/es_io.c:412
00:01:10.895: anon native strict preventsyield
00:01:10.895: anon showtime/http:101 tailcalled
00:01:10.895: lader zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:89
00:01:10.896: browseItems zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:101
00:01:10.896: anon zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:110 preventsyield
00:01:10.896: apply native strict preventsyield
00:01:10.896: anon showtime/page:366 preventsyield

https://eztv.ch/shows/ does not exist
where as https://eztv.ch/showlist/ does, could that be part of the problem?

I cant wait to try this out, great work Gekko :)

RE: EZTV Plugin - Added by gekko nl about 4 years ago

The error sb got
is about not getting the information about rating,
i dont understand why thats holding up the program but i fix that later.
Could you please post your version of movian you using.

The first error that blueplanet gets could be geoprotection and i will try to search a solution for it ,
The second error is because my script wont fetch information from the eztv.ch

Leonid everything working fine for you ?

I got 2 system running bleeding edge and everything is working.

RE: EZTV Plugin - Added by Leonid Protasov about 4 years ago

gekko nl wrote:

The error sb got
is about not getting the information about rating,
i dont understand why thats holding up the program but i fix that later.
Could you please post your version of movian you using.

The first error that blueplanet gets could be geoprotection and i will try to search a solution for it ,
The second error is because my script wont fetch information from the eztv.ch

Leonid everything working fine for you ?

I got 2 system running bleeding edge and everything is working.

I always running the latest bleeding edge. I didn't test your plugin much but what I tried was working ok. About different urls. You can take a look at rutor plugin and move baseurl to settings like there. The way I did it on yts plugins now seems to me complicated :)

RE: EZTV Plugin - Added by gekko nl about 4 years ago

I uploaded a new version
for the bug that sb got i added a backup
and for blueplanet i added a extra link so he can try that one.
and thank you for the telling me about rutor plugin but i dont want to give them that option.

let me know how it go :D

RE: EZTV Plugin - Added by - SBP - about 4 years ago

gekko nl wrote:

I uploaded a new version
for the bug that sb got i added a backup
and for blueplanet i added a extra link so he can try that one.
and thank you for the telling me about rutor plugin but i dont want to give them that option.

let me know how it go :D

Sorry to say that with latest bleeding edge and your last update still not working on my ps3. Same error. Here is snip from the log. Hope it helps. Is there any other info I can provide to assist you with this issue?

00:00:19.611: navigator [INFO ]:Opening eztvapi:start
00:00:19.617: eztvapi [DEBUG]:Welkom bij eztvapi bekijk hier al uw tv shows groeten Gekko
00:00:19.760: eztvapi [ERROR]:TypeError (invalid base value) at zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:124
00:00:19.760: eztvapi [ERROR]:STACK DUMP: TypeError: invalid base value
00:00:19.760: duk_hobject_props.c:2085
00:00:19.761: addShowItem zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:124
00:00:19.761: lader zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:95
00:00:19.761: browseItems zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:101
00:00:19.761: anon zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:110 preventsyield
00:00:19.762: apply native strict preventsyield
00:00:19.762: anon showtime/page:366 preventsyield

I like the new app logo BTW, looks great.

RE: EZTV Plugin - Added by ßlueplanet . about 4 years ago

Unfortunately I still get an error if I use HTTPS

00:03:11.872: navigator [INFO ]:Opening eztvapi:start
00:03:11.978: eztvapi [DEBUG]:Welkom bij eztvapi bekijk hier al uw tv shows groeten Gekko
00:04:13.970: eztvapi [ERROR]:Error (HTTP request failed https://br.api.ptn.pm/shows/1 -- HTTP error: 1) at /project/repo/checkout/src/ecmascript/es_io.c:412
00:04:13.971: eztvapi [ERROR]:STACK DUMP: Error: HTTP request failed https://br.api.ptn.pm/shows/1 -
HTTP error: -1
00:04:13.971: /project/repo/checkout/src/ecmascript/es_io.c:412
00:04:13.971: anon native strict preventsyield
00:04:13.971: anon showtime/http:101 tailcalled
00:04:13.972: lader zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:89
00:04:13.972: browseItems zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:101
00:04:13.972: anon zip://file:///dev_hdd0/game/HTSS00003/USRDIR/settings/installedplugins/eztvapi.zip/eztvv.js:110 preventsyield
00:04:13.972: apply native strict preventsyield
00:04:13.972: anon showtime/page:366 preventsyield

If I use HTTP I am presented with the screenshot attached, if I then open a directory I am just given a blank screen
I have attached the log of the full event

Some good news is http://br.api.ptn.pm/ is unblocked in my country :)

I use it as the api endpoint for the popcorntime program

EDIT*

If I wait on the first screen for a few minutes the directories do open and the shows work! its just very slow at opening everything, and I don't know the show until I open it

Thanks Gekko :)

SCREENSHOT.png (865 KB)

showtime-0.log (7.45 KB)

RE: EZTV Plugin - Added by ßlueplanet . about 4 years ago

Ok if I use HTTP And I turn off load extra info and I turn off enable metadata fetching
Everything works perfectly :)

Ignore the attached files

Excellent work Gekko thank you :)

RE: EZTV Plugin - Added by gekko nl about 4 years ago

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.

RE: EZTV Plugin - Added by ßlueplanet . about 4 years ago

I've been testing this all day and it works great :)

The only things I would suggest are:

Enabling the little blue ticks when you finish an episode (so you know what you've already seen)
Using the shows poster as the icon when you save a show to the homescreen (like ororo)
Sorting episodes alphabetically as they aren't always in order (though I'm guessing this is down to the site itself)

Either way it's a really good plugin

Thank you :)

1 2 (1-25/41)