Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yify group plans 'community coup' #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 0.3.9 Beta - The one with CE - 30 November 2015

Bug Fixes:

- Added secondary tvapi, eztv
- changed movie api to yts.ag (don't listen to those .is guys)
- fixed episode/season mixup (mitjacotic | issue #1)
- Updated naming
- Updated icons
- various improvements
- verified some missing dependencies we lost with .io
- updated some ui stuff
- changed loading help link on init to wait a bit longer

new api coming soon

## 0.3.8 Beta - There's nothing on TV - 09 July 2015

BugFixes:
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# [Popcorn Time CE](https://github.com/PopcornTimeCE/popcorntimece)

Allow any computer user to watch movies easily streaming from torrents, without any particular knowledge.
Allow anyone to easily watch their favorite movies, shows, and anime.

![Popcorn Time](http://popcorntime.ml/wp-content/uploads/2015/11/poppy-ce-256.png)

Visit the project's website at <http://popcorntime.ml>.

This project would absolutely **not** be possible without the original developer's hard work into making Popcorn Time what it is today. All credit should go to them, we're just trying to help the community :)

***

## Getting Involved
Expand Down Expand Up @@ -78,6 +80,10 @@ You should have received a copy of the GNU General Public License along with thi

***

**This project and the distribution of this project is not illegal, nor does it violate *any* DMCA laws. The use of this project, however, may be illegal in your area. Check your local laws and regulations regarding the use of torrents to watch potentially copyrighted content. The maintainers of this project do not condone the use of this project for anything illegal, in any state, region, country, or planet. *Please use at your own risk*.**

***

If you want to contact us : [[email protected]](mailto:[email protected]) or [use the form](http://popcorntime.ml/contact/) on our website.

Copyright (c) 2015 Popcorn Time CE - Released under the [GPL v3 license](LICENSE.txt).
Copyright (c) 2015 Popcorn Time CE - Released under the [GPL v3 license](LICENSE.txt).
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "Popcorn-Time",
"homepage": "https://popcorntime.io",
"bugs": "https://git.popcorntime.io/popcorntime/desktop/issues",
"name": "Popcorn-Time-CE",
"homepage": "http://popcorntime.ml",
"bugs": "https://github.com/PopcornTimeCE/popcorntimece/issues",
"repository": {
"type": "git",
"url": "https://git.popcorntime.io/popcorntime/desktop.git"
"url": "https://github.com/PopcornTimeCE/popcorntimece.git"
},
"license": "GPL-3.0",
"main": "app://host/src/app/index.html",
"version": "0.3.8-5",
"version": "0.3.9-11",
"node-remote": "client.vpn.ht",
"releaseName": "There's nothing on TV (0.12.2)",
"releaseName": "The one with CE",
"scripts": {
"postinstall": "node_modules/.bin/bower install --config.interactive=false && grunt setup",
"postupdate": "node_modules/.bin/bower update --config.interactive=false && grunt setup",
"test": "grunt --verbose"
},
"window": {
"title": "Popcorn Time",
"title": "Popcorn Time CE",
"icon": "src/app/images/icon.png",
"toolbar": false,
"frame": false,
Expand All @@ -29,9 +29,9 @@
},
"dependencies": {
"adm-zip": "0.4.7",
"airplay-js": "git+https://git.popcorntime.io/mirrors/node-airplay-js.git",
"airplay-js": "git+https://github.com/feross/node-airplay-js.git",
"async": "0.9.0",
"chromecast-js": "git+https://git.popcorntime.io/mirrors/chromecast-js.git",
"chromecast-js": "git+https://github.com/guerrerocarlos/chromecast-js.git",
"gitlab": "1.3.0",
"i18n": "0.5.0",
"iconv-lite": "^0.4.7",
Expand All @@ -45,11 +45,11 @@
"mv": "^2.0.3",
"nedb": "1.1.2",
"node-captions": "0.3.8",
"nodecast-js": "git+https://git.popcorntime.io/mirrors/nodecast-js.git",
"nodecast-js": "git+https://github.com/gyzerok/nodecast-js.git",
"node-tvdb": "1.3.1",
"node-webkit-fdialogs": "latest",
"os-name": "^1.0.3",
"peerflix": "git+https://git.popcorntime.io/mirrors/peerflix.git",
"peerflix": "git+https://github.com/mafintosh/peerflix.git",
"opensubtitles-api": "^0.0.3",
"q": "2.0.3",
"read-torrent": "1.3.0",
Expand Down
Binary file modified src/app/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/app/images/icons/icon-github.png
Binary file not shown.
Binary file modified src/app/images/icons/icon-stash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/app/images/icons/local-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/app/images/popcorntime.icns
Binary file not shown.
Binary file modified src/app/images/popcorntime.ico
Binary file not shown.
126 changes: 56 additions & 70 deletions src/app/lib/providers/yts.js
Original file line number Diff line number Diff line change
@@ -1,93 +1,90 @@
(function (App) {
'use strict';

var Q = require('q');
var request = require('request');
var inherits = require('util').inherits;

function YTS() {
if (!(this instanceof YTS)) {
return new YTS();
}

App.Providers.Generic.call(this);
}
inherits(YTS, App.Providers.Generic);

YTS.prototype.extractIds = function (items) {
return _.pluck(items.results, 'imdb_id');
};
var format = function (data, page, limit) {
console.log("data", data);
var results = _.chain(data)/*.filter(function (movie) {

var format = function (data) {
var results = _.chain(data.movies)/*
.filter(function (movie) {
// Filter any 3D only movies
return _.any(movie.torrents, function (torrent) {
return torrent.quality !== '3D';
});
})*/.map(function (movie) {
return {
type: 'movie',
imdb_id: movie.imdb,
imdb_id: movie.imdb_code,
title: movie.title,
year: movie.year,
genre: movie.genres,
rating: movie.rating,
runtime: movie.runtime,
image: movie.poster_med,
cover: movie.poster_med,
backdrop: movie.poster_big,
synopsis: movie.description,
trailer: 'https://www.youtube.com/watch?v=' + movie.trailer || false,
image: movie.medium_cover_image,
cover: movie.medium_cover_image, //movie.large_cover_image,
backdrop: movie.background_image,
synopsis: movie.description_full,
trailer: 'https://www.youtube.com/watch?v=' + movie.yt_trailer_code || false,
certification: movie.mpa_rating,
torrents: _.reduce(movie.items, function (torrents, torrent) {
console.log(torrent);
torrents: _.reduce(movie.torrents, function (torrents, torrent) {
if (torrent.quality !== '3D') {
if ( !(torrent.quality in torrents) ){
torrents[torrent.quality] = {
url: torrent.torrent_url,
magnet: torrent.torrent_magnet, //'magnet:?xt=urn:btih:' + torrent.hash + '&tr=udp://open.demonii.com:1337&tr=udp://tracker.coppersurfer.tk:6969',
url: torrent.url,
magnet: 'magnet:?xt=urn:btih:' + torrent.hash + '&tr=udp://glotorrents.pw:6969/announce&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://torrent.gresille.org:80/announce&tr=udp://tracker.openbittorrent.com:80&tr=udp://tracker.coppersurfer.tk:6969&tr=udp://tracker.leechers-paradise.org:6969&tr=udp://p4p.arenabg.ch:1337&tr=udp://tracker.internetwarriors.net:1337',
size: torrent.size_bytes,
filesize: torrent.size_bytes,
seed: torrent.torrent_seeds,
peer: torrent.torrent_peers
filesize: torrent.size,
seed: torrent.seeds,
peer: torrent.peers
};
}
}
return torrents;
}, {})
};
}).value();
console.log("results", results);

return {
results: Common.sanitize(results),
hasMore: true // data.length > page * limit
hasMore: true //data.movie_count > data.page_number * data.limit
};
};

YTS.prototype.fetch = function (filters) {
var params = {
sort_by: 'seeds',
limit: 50,
with_rt_ratings: true
};

if (filters.page) {
params.page = filters.page;
}

if (filters.keywords) {
params.keywords = filters.keywords;
params.query_term = filters.keywords;
}
if (filters.genre && filters.genre != 'All') {

if (filters.genre && filters.genre !== 'All') {
params.genre = filters.genre;
}

if (filters.order === 1) {
params.order_by = 'asc';
}

if (filters.sorter && filters.sorter !== 'popularity') {
switch (filters.sorter) {
case 'last added':
Expand All @@ -100,71 +97,60 @@
params.sort_by = filters.sorter;
}
}

if (Settings.movies_quality !== 'all') {
params.quality = Settings.movies_quality;
}

if (Settings.translateSynopsis) {
params.lang = Settings.language;
}

var defer = Q.defer();

function get(index) {
var options = {
//uri: Settings.ytsAPI[index].uri + 'list',
uri:"http://api.torrentsapi.com/list?",
uri: Settings.ytsAPI[index].uri + 'api/v2/list_movies.json',
//uri: 'https://yts.ag/api/v2/list_movies.json',
qs: params,
json: true,
timeout: 10000
};
console.log('test', params);

/*var url = 'http://api.torrentsapi.com/list?';//sort=seeds&quality=720p&page=' + params.page + "&count=" + params.limit;
if(filters.keywords){ url+="&keywords="+filters.keywords; }
jQuery.getJSON(url, function(data) {
return defer.resolve(format(data.MovieList), params.page, params.limit);

}).fail(function( jqxhr, textStatus, error ) {
console.log('Error loading data...');
return defer.reject(textStatus);

});*/
var req = jQuery.extend(true, {}, Settings.ytsAPI[index], options);
//var req = jQuery.extend(true, {}, Settings.ytsAPI[index], options);
var req = jQuery.extend(true, {}, 'https://yts.ag/', options);
win.info('Request to YTS', req);
request(req, function (err, res, data) {
if (err || res.statusCode >= 400 || (data && !data.MovieList)) {
win.warn('YTS API endpoint \'%s\' failed.', Settings.ytsAPI[index].uri);
if (index + 1 >= Settings.ytsAPI.length) {
return defer.reject(err || 'Status Code is above 400');
} else {
get(index + 1);
}
return;
if (err || res.statusCode >= 400 || (data && !data.data)) {
win.warn('YTS API endpoint \'%s\' failed.', 'https://yts.ag/');
return defer.reject(err || 'Status Code is above 400');
// if (index + 1 >= Settings.ytsAPI.length) {
// return defer.reject(err || 'Status Code is above 400');
// } else {
// get(index + 1);
// }
//return;
} else if (!data || data.status === 'error') {
err = data ? data.status_message : 'No data returned';
return defer.reject(err);
} else {
console.log("data",data);
return defer.resolve(format(data.MovieList));
return defer.resolve(format(data.data));
}
});


}
get(0);

return defer.promise;
};

YTS.prototype.random = function () {
var defer = Q.defer();

function get(index) {
var options = {
uri: Settings.ytsAPI[index].uri + 'api/v2/get_random_movie.json?' + Math.round((new Date()).valueOf() / 1000),
json: true,
timeout: 10000
};
console.log('getting movies');
var req = jQuery.extend(true, {}, Settings.ytsAPI[index], options);
request(req, function (err, res, data) {
if (err || res.statusCode >= 400 || (data && !data.data)) {
Expand All @@ -184,14 +170,14 @@
});
}
get(0);

return defer.promise;
};

YTS.prototype.detail = function (torrent_id, old_data) {
return Q(old_data);
};

App.Providers.Yts = YTS;

})(window.App);
4 changes: 2 additions & 2 deletions src/app/lib/streamer.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@
model.set('tvdb_id', res.show.tvdbid);
model.set('episode_id', res.show.episode.tvdbid);
model.set('imdb_id', res.show.imdbid);
model.set('episode', sub_data.season);
model.set('season', sub_data.episode);
model.set('episode', sub_data.episode);
model.set('season', sub_data.season);
title = res.show.title + ' - ' + i18n.__('Season %s', res.show.episode.season) + ', ' + i18n.__('Episode %s', res.show.episode.episode) + ' - ' + res.show.episode.title;
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion src/app/lib/views/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
$('.changelog-text').html(contents.replace(/\n/g, '<br />'));
$('.changelog-overlay').show();
} else {
gui.Shell.openExternal('https://git.popcorntime.io/popcorntime/desktop/blob/master/CHANGELOG.md');
gui.Shell.openExternal('https://github.com/PopcornTimeCE/popcorntimece/blob/master/CHANGELOG.md');
}
});
},
Expand Down
2 changes: 1 addition & 1 deletion src/app/lib/views/browser/generic_browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}));

if (!isNaN(startupTime)) {
win.debug('Popcorn Time %s startup time: %sms', Settings.version, (window.performance.now() - startupTime).toFixed(3)); // started in database.js;
win.debug('Popcorn Time CE %s startup time: %sms', Settings.version, (window.performance.now() - startupTime).toFixed(3)); // started in database.js;
startupTime = 'none';
if (Settings.bigPicture) {
var zoom = ScreenResolution.HD ? 2 : 3;
Expand Down
2 changes: 1 addition & 1 deletion src/app/lib/views/init_modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

fixer = setTimeout(function () {
self.ui.waitingblock.show();
}, 7000);
}, 10000);
},

onDestroy: function () {
Expand Down
2 changes: 1 addition & 1 deletion src/app/lib/views/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';

var PT_id = 13, //ID of project (got with gitlab.projects.all). 13 is for 'popcorntime/desktop'
PT_url = 'https://git.popcorntime.io/popcorntime/desktop/issues/', //Url of 'issues' of the above project
PT_url = 'https://github.com/PopcornTimeCE/popcorntimece/issues', //Url of 'issues' of the above project
token;

var Issue = Backbone.Marionette.ItemView.extend({
Expand Down
Loading