Skip to content
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
977 changes: 489 additions & 488 deletions src/app/language/de.json

Large diffs are not rendered by default.

27 changes: 25 additions & 2 deletions src/app/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -503,5 +503,28 @@
"Seeds:": "Seeds:",
"Peers:": "Peers:",
"Torrents-Time v2": "Torrents-Time v2",
"Torrents Time v2": "Torrents Time v2"
}
"Torrents Time v2": "Torrents Time v2",
"YTS.ph Search": "YTS.ph Search",
"This feature has a built-in kat.cr search, which allows you to stream any movies, series or anime torrents with automatic subtitle support. The casting option integrates features including Chromecast, Airplay and DLNA. This library also provides an Anti-Virus Scanner and a 'History' feature, that keeps track of all your downloaded KAT torrents": "This feature has a built-in kat.cr search, which allows you to stream any movies, series or anime torrents with automatic subtitle support. The casting option integrates features including Chromecast, Airplay and DLNA. This library also provides an Anti-Virus Scanner and a 'History' feature, that keeps track of all your downloaded KAT torrents",
"Plugins": "Plugins",
"western": "western",
"crime": "crime",
"comedy": "comedy",
"action": "action",
"HTML5 Video Player": "HTML5 Video Player",
"VLC Player": "VLC Player",
" Horror": " Horror",
"thriller": "thriller",
"animation": "animation",
" War": " War",
" Animation": " Animation",
" Family": " Family",
" Fantasy": " Fantasy",
" Romance": " Romance",
" Sci-Fi": " Sci-Fi",
" Adventure": " Adventure",
" Thriller": " Thriller",
" Comedy": " Comedy",
" Musical": " Musical",
" Documentary": " Documentary"
}
95 changes: 71 additions & 24 deletions src/app/lib/device/ext-player.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(function (App) {
(function(App) {
'use strict';

var path = require('path');
Expand All @@ -14,10 +14,35 @@
name: i18n.__('External Player'),
},

play: function (streamModel) {
// "" So it behaves when spaces in path
play: function(streamModel) {
var options = {};
var args = [];
var url = streamModel.attributes.src;
var cmd = path.normalize('"' + this.get('path') + '" ') + getPlayerSwitches(this.get('id')) + ' ';
var cmd;

if (process.platform == 'win32') {
// "" So it behaves when spaces in path
//Node.js Format: spawn('"with spaces.cmd"', ['arg with spaces'], { shell: true });
cmd = path.normalize('"' + this.get('path') + '"');
options = {
shell: true
};

} else
if (process.platform == 'linux' || process.platform == 'darwin') {
cmd = path.normalize('' + this.get('path') + '');
options = {
shell: true
};
} else {
cmd = path.normalize('"' + this.get('path') + '" ');
}

//var cmd = path.normalize('"' + this.get('path') + '" ');
//var cmd = path.normalize('' + this.get('path') + '');

args.push(getPlayerSwitches(this.get('id')));

var subtitle = streamModel.attributes.subFile || '';
if (subtitle !== '') {

Expand All @@ -30,27 +55,49 @@
var detectedEncoding = charset.encoding;
win.debug('Subtitles charset detected: %s', detectedEncoding);
if (detectedEncoding.toLowerCase() === 'utf-8') {
cmd += '-utf8 ';
args.push('-utf8 ');
}
}
cmd += getPlayerSubSwitch(this.get('id')) + '"' + subtitle + '" ';
args.push(getPlayerSubSwitch(this.get('id')) + '"' + subtitle + '" ');
}
if (getPlayerFS(this.get('id')) !== '') {
// Start player fullscreen if available and asked
if (Settings.alwaysFullscreen) {
cmd += getPlayerFS(this.get('id')) + ' ';
args.push(this.get('id'));
}
}
if (getPlayerFilenameSwitch(this.get('id')) !== '') {
// The video file is the biggest file in the torrent
var videoFile = _.sortBy(streamModel.attributes.torrent.info.files, function (file) {
var videoFile = _.sortBy(streamModel.attributes.torrent.info.files, function(file) {
return -file.length;
})[0];
cmd += videoFile ? (getPlayerFilenameSwitch(this.get('id')) + '"' + videoFile.name + '" ') : '';
args.push(videoFile ? (getPlayerFilenameSwitch(this.get('id')) + '"' + videoFile.name + '" ') : '');
}
cmd += url;
win.info('Launching External Player: ' + cmd);
child.exec(cmd, function (error, stdout, stderr) {
args.push(url);

win.info('Launching External Player: ' + cmd + ' URL: ' + url);
win.info('Launching External Player Args: ' + args);
win.info('Launching External Player Options: ' + options);

var player = child.spawn(cmd, args, options);

player.stdout.on('data', (data) => {
win.info(`stdout: ${data}`);
});

player.stderr.on('data', (data) => {
win.debug(`stderr: ${data}`);
});

player.on('error', (data) => {
win.error("External Player Error" + data);
App.vent.trigger('player:close');
App.vent.trigger('stream:stop');
App.vent.trigger('preload:stop');
});

player.on('close', (code) => {
win.debug(`Player process exited with code ${code}`);
if (streamModel.attributes.device.id === 'Bomi') {
// don't stop on exit, because Bomi could be already running in background and the command ends while the stream should continue
return;
Expand All @@ -61,11 +108,11 @@
});
},

pause: function () {},
pause: function() {},

stop: function () {},
stop: function() {},

unpause: function () {}
unpause: function() {}
});

function getPlayerName(loc) {
Expand Down Expand Up @@ -128,7 +175,7 @@
},
'mpv': {
type: 'mpv',
switches: '',
switches: '-quiet',
subswitch: '--sub=',
fs: '--fs'
},
Expand Down Expand Up @@ -173,7 +220,7 @@
};

/* map name back into the object as we use it in match */
_.each(players, function (v, k) {
_.each(players, function(v, k) {
players[k].name = k;
});

Expand All @@ -183,7 +230,7 @@
win32: []
};

var addPath = function (path) {
var addPath = function(path) {
if (fs.existsSync(path)) {
searchPaths[process.platform].push(path);
}
Expand All @@ -203,17 +250,17 @@
var folderName = '';
var birthtimes = {};

async.each(searchPaths[process.platform], function (folderName, pathcb) {
async.each(searchPaths[process.platform], function(folderName, pathcb) {
folderName = path.resolve(folderName);
win.info('Scanning: ' + folderName);
var appIndex = -1;
var fileStream = readdirp({
root: folderName,
depth: 3
});
fileStream.on('data', function (d) {
fileStream.on('data', function(d) {
var app = d.name.replace('.app', '').replace('.exe', '').toLowerCase();
var match = _.filter(players, function (v, k) {
var match = _.filter(players, function(v, k) {
return k.toLowerCase() === app;
});

Expand All @@ -240,10 +287,10 @@
}
}
});
fileStream.on('end', function () {
fileStream.on('end', function() {
pathcb();
});
}, function (err) {
}, function(err) {

if (err) {
win.error('External Players: scan', err);
Expand All @@ -255,4 +302,4 @@
});

App.Device.ExtPlayer = ExtPlayer;
})(window.App);
})(window.App);
22 changes: 11 additions & 11 deletions src/app/lib/views/browser/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
genre: this.model.get('genre'),
synopsis: this.model.get('synopsis'),
runtime: this.model.get('runtime'),
year: this.model.get('year'),
year: this.model.get('year'),
health: this.model.get('health'),
subtitle: this.model.get('subtitle'),
backdrop: this.model.get('backdrop'),
Expand All @@ -212,11 +212,11 @@
provider: this.model.get('provider'),
watched: this.model.get('watched'),
bookmarked: true,
id: this.model.get('id'),
slug: this.model.get('slug'),
google_video: this.model.get('google_video'),
directors: this.model.get('directors'),
cast: this.model.get('cast'),
id: this.model.get('id'),
slug: this.model.get('slug'),
google_video: this.model.get('google_video'),
directors: this.model.get('directors'),
cast: this.model.get('cast'),
});

App.vent.trigger('movie:showDetail', SelectedMovie);
Expand Down Expand Up @@ -397,11 +397,11 @@
rating: this.model.get('rating'),
trailer: this.model.get('trailer'),
provider: this.model.get('provider'),
id: this.model.get('id'),
slug: this.model.get('slug'),
google_video: this.model.get('google_video'),
directors: this.model.get('directors'),
cast: this.model.get('cast'),
id: this.model.get('id'),
slug: this.model.get('slug'),
google_video: this.model.get('google_video'),
directors: this.model.get('directors'),
cast: this.model.get('cast'),
};

Database.addMovie(movie)
Expand Down
14 changes: 7 additions & 7 deletions src/app/lib/views/movie_detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,13 @@
if (!player.match(/[0-9]+.[0-9]+.[0-9]+.[0-9]/ig) &&
player=='images/icons/googlecloud-icon.png' && this.model.get('google_video')) {
var google_video = new Backbone.Model({
src: this.model.get('google_video'),
type: 'video/mp4',
techOrder: ['html5', 'flash'],
quality: this.model.get('quality'), //quality: 'quality unknown', //quality: false,
subtitle: this.model.get('subtitle'), //subtitle: null,
defaultSubtitle: this.subtitle_selected,
title: this.model.get('title')
src: this.model.get('google_video'),
type: 'video/mp4',
techOrder: ['html5', 'flash'],
quality: this.model.get('quality'), //quality: 'quality unknown', //quality: false,
subtitle: this.model.get('subtitle'), //subtitle: null,
defaultSubtitle: this.subtitle_selected,
title: this.model.get('title')
});
var tmpPlayer = App.Device.Collection.selected.attributes.id;
App.Device.Collection.setDevice('local');
Expand Down
23 changes: 23 additions & 0 deletions src/app/lib/views/player/loading.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,22 @@
Mousetrap.bind(['esc', 'backspace'], function (e) {
_this.cancelStreaming();
});
Mousetrap.bind(['space'], function (e) {
_this.toggleStreaming();
});
Mousetrap.bind(['left'], function (e) {
_this.backwardStreaming();
});
Mousetrap.bind(['right'], function (e) {
_this.forwardStreaming();
});
},

unbindKeyboardShortcuts: function () {
Mousetrap.unbind(['esc', 'backspace']);
Mousetrap.unbind(['space']);
Mousetrap.unbind(['left']);
Mousetrap.unbind(['right']);
},

onShow: function () {
Expand Down Expand Up @@ -197,6 +209,17 @@
$('.play').removeClass('fa-play').removeClass('play').addClass('fa-pause').addClass('pause');
},

toggleStreaming: function(){
if($('.play').length){
this.resumeStreaming();
return;
}
if($('.pause').length){
this.pauseStreaming();
return;
}
},

stopStreaming: function () {
this.cancelStreaming();
},
Expand Down