Compare commits

..

9 Commits

Author SHA1 Message Date
12nick12 4cb7d225da
Create systemd script 2017-12-12 09:12:17 -05:00
Nick Leffler a9c80e1318 Translated comment to eng using g trans 2017-09-27 09:09:25 -04:00
12nick12 6760ff6a7a Update README.md 2017-09-27 08:15:47 -04:00
Nick Leffler 94b5e30969 Translated to english and added pwd as url base 2017-09-27 08:11:26 -04:00
WEBER Antoine b2f849e738 Update README.md 2016-08-05 16:03:36 +02:00
WEBER Antoine 132df540bc ajout d'une image 2015-10-13 22:55:27 +02:00
WEBER Antoine 34ea276f63 ajout d'une image 2015-10-13 22:52:04 +02:00
WEBER Antoine 248723b698 Merge branch 'release' of https://github.com/TwanoO67/plex-web-downloader into release 2015-10-13 22:48:14 +02:00
WEBER Antoine 468f4cb2b7 modification du readme 2015-10-13 22:46:38 +02:00
17 changed files with 130 additions and 113 deletions

130
README.md
View File

@ -1,133 +1,135 @@
Plex Web Downloader Plex Web Downloader
=============== ===============
Ce projet permet de créer une liste de vos fichiers vidéo plex et de les partager aux travers d'une interface web. The original translated into english and using pwd url base for nginx reverse proxy use
This project allows you to create a list of your plex video files and to share them through a web interface.
INSTALLATION **************************************************************************************************************************************
I would recomend setting up a crontab that backups the plex database every night then have this use the new file that has been created that way this doesn't lock the plex database
***************************************************************************************************************************************
MANUAL INSTALLATION
-------------------- --------------------
**Sur Windows** If you prefer to compile the latest version of the project yourself, or if your operating system is not supported:
pré requis, installer git ( https://git-scm.com/download/win ) ** On Windows **
pré requis, installer nodejs 0.12.x ( https://nodejs.org/dist/v0.12.7/ )   prerequisites, install git (https://git-scm.com/download/win)
ouvrir l'invite de commande 'cmb', puis se deplacer dans un repertoire où vous voulez installer   prerequisites, install nodejs 0.12.x (https://nodejs.org/dist/v0.12.7/)
git clone https://github.com/TwanoO67/plex-web-downloader.git   open the 'cmb' command prompt, and then move to a directory where you want to install
cd plex-web-downloader     git clone https://github.com/12nick12/pwd.git
npm install     cd plex-web-downloader
modifier le fichier config.js, pour y mettre le chemin de la base de données plex (attention il faut doubler les anti-slash et proteger les espaces )     npm install
exemple: C:\\Users\\yourUsername\\AppData\\Local\\Plex\ Media\ Server\\Plug-in\ Support\\Databases\\com.plexapp.plugins.library.db   modify the file config.js, to put the path of the database plex (attention must double the anti-slash and protect the spaces)
npm start   For example: C: \\ Users \\ yourUsername \\ AppData \\ Local \\ Plex \ Media \ Server \\ Plug-in \ Support \\ Databases \\ com.plexapp.plugins.library.db
puis ouvrir dans votre navigateur l'adresse http://localhost:3000     npm start
  then open in your browser the address http: // localhost: 3000
**Sous MacOS** ** Under MacOS **
pré requis, nodejs   prerequisites, nodejs
sinon installer homebrew     brew install node
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"   then
et :     git clone https://github.com/12nick12/pwd.git
brew install node     cd plex-web-downloader
git clone https://github.com/TwanoO67/plex-web-downloader.git     npm install
cd plex-web-downloader   modify the file config.js, to put the path of the database plex
npm install   example: / Users / yourUsername / Library / Application Support / Plex Media Server / Plug-in Support / Databases / com.plexapp.plugins.library.db
modifier le fichier config.js, pour y mettre le chemin de la base de données plex     npm start
exemple: /Users/yourUsername/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db   then open in your browser the address http: // localhost: 3000
npm start
puis ouvrir dans votre navigateur l'adresse http://localhost:3000
**Sous Ubuntu** ** Under Ubuntu **
pré requis nodejs, ou   prerequisites nodejs, or
apt-get install nodejs     apt-get install nodejs
ln -s /usr/bin/nodejs /usr/local/bin/node     ln -s / usr / bin / nodejs / usr / local / bin / node
puis, se déplacer dans votre repertoire pour l'install et :   then move to your directory to install and:
git clone https://github.com/TwanoO67/plex-web-downloader.git     git clone https://github.com/12nick12/pwd.git
cd plex-web-downloader     cd plex-web-downloader
npm install     npm install
modifier le fichier config.js, pour y mettre le chemin de la base de données plex   modify the file config.js, to put the path of the database plex
exemple: /home/yourUsername/plex-config/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db   Example: / home / yourUsername / plex-config / Plex Media Server / Plug-in Support / Databases / com.plexapp.plugins.library.db
npm start     npm start
puis ouvrir dans votre navigateur l'adresse http://localhost:3000   then open in your browser the address http: // localhost: 3000
DEVELOPPEMENT DEVELOPMENT
-------------------- --------------------
**le projet a été créée initialement avec** ** the project was originally created with **
node install express -g     node install express -g
node install express-generator -g     node install express-generator -g
express nom_du_projet     express project_name
cd nom_du_projet     cd project_name
npm install     npm install
**pour installer plex (depuis un dockerfile)** ** to install plex (from a dockerfile) **
mkdir ~/plex-config     mkdir ~ / plex-config
sudo chown 797:797 -R ~/plex-config     sudo chown 797: 797 -R ~ / plex-config
sudo docker run -d --restart=always -v ~/plex-config:/config -v ~/Movies:/media/plex -p 32400:32400 wernight/plex-media-server     sudo docker -d --restart = always -v ~ / plex-config: / config -v ~ / Movies: / media / plex -p 32400: 32400 wernight / plex-media-server
sudo chmod 777 ~/plex-config/Plex\ Media\ Server/Plug-in\ Support/Databases/*     sudo chmod 777 ~ / plex-config / Plex \ Media \ Server / Plug-in / Support / Databases / *
sudo chmod 777 ~/Movies     sudo chmod 777 ~ / Movies
sudo ln -s ~/Movies /media/plex     sudo ln -s ~ / Movies / media / plex
puis configurer vos chaines sur: http://localhost:32400/web/index.html then configure your channels on: http: // localhost: 32400 / web / index.html
COMPILATION COMPILATION
-------------------- --------------------
npm install enclose -g     npm install enclose -g
enclose -o bin/mac_bin --loglevel info -c enclose_config.js -v 0.12.7 ./bin/www       enclose -o bin / mac_bin --loglevel info -c enclose_config.js -v 0.12.7 ./bin/www
TODO Liste TODO List
-------------------- --------------------
* Gérer les images des vignettes * Manage thumbnail images
* Intégrer dans un logiciel avec system-tray pour start/stop le serveur * Manage multi-source downloads by offering a link aria2 (see aria2.sourceforge.net)
* Mutualisé les sources avec un mirroir centralisé * Integrated web ui: http://ziahamza.github.io/webui-aria2/
* Gérer les téléchargements multi-source en proposant un lien aria2 (voir aria2.sourceforge.net) * Set up an upload limit that can be activated on demand
* Intégré web ui: http://ziahamza.github.io/webui-aria2/
* Mettre en place une limite d'upload activable à la demande

20
app.js
View File

@ -12,7 +12,7 @@ var app = express();
app.set('views', path.join(__dirname, 'views')); app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade'); app.set('view engine', 'jade');
//protection par mot de passe //password protection
if( typeof config.auth_user !== 'undefined' && typeof config.auth_password !== 'undefined' ){ if( typeof config.auth_user !== 'undefined' && typeof config.auth_password !== 'undefined' ){
console.log("SAFE MODE: votre serveur est protégé par mot de passe."); console.log("SAFE MODE: votre serveur est protégé par mot de passe.");
var basicAuth = require('basic-auth'); var basicAuth = require('basic-auth');
@ -31,7 +31,7 @@ else{
console.log("UNSAFE MODE: configurez un auth_user et auth_password dans le fichier config.js"); console.log("UNSAFE MODE: configurez un auth_user et auth_password dans le fichier config.js");
} }
//envoyer config a tout le monde //send config to everyone
app.use(function(req, res, next) { app.use(function(req, res, next) {
res.locals.config = config; res.locals.config = config;
next(); next();
@ -45,14 +45,14 @@ app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public'))); app.use(express.static(path.join(__dirname, 'public')));
app.use('/', require('./routes/index')); app.use('/pwd/', require('./routes/index'));
app.use('/users', require('./routes/users')); app.use('/pwd/users', require('./routes/users'));
app.use('/file', require('./routes/file')); app.use('/pwd/file', require('./routes/file'));
app.use('/channel', require('./routes/channel')); app.use('/pwd/channel', require('./routes/channel'));
app.use('/movie', require('./routes/movie')); app.use('/pwd/movie', require('./routes/movie'));
app.use('/show_list', require('./routes/show_list')); app.use('/pwd/show_list', require('./routes/show_list'));
app.use('/show', require('./routes/show')); app.use('/pwd/show', require('./routes/show'));
app.use('/divers', require('./routes/divers')); app.use('/pwd/divers', require('./routes/divers'));
// catch 404 and forward to error handler // catch 404 and forward to error handler
app.use(function(req, res, next) { app.use(function(req, res, next) {

View File

@ -1,5 +1,5 @@
#!/usr/bin/env node #!/usr/bin/env node
//On commence par la mise en cluster //One begins with the clustering
var cluster = require('cluster'); var cluster = require('cluster');
// Code to run if we're in the master process // Code to run if we're in the master process

BIN
public/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

View File

@ -23,7 +23,7 @@ router.get('/:id', function(req, res, next) {
} }
} }
//on fais toute les opération de base a la suite //we do all the basic operations following
db.serialize(function() { db.serialize(function() {
//db.run("CREATE TABLE if not exists user_info (info TEXT)"); //db.run("CREATE TABLE if not exists user_info (info TEXT)");
@ -47,9 +47,9 @@ router.get('/:id', function(req, res, next) {
data.push(row); data.push(row);
}, },
//aprés toute les opération de la base //after all the operations of the database
function() { function() {
res.render('channel', { title: 'Liste des vidéos',videos: data, channel: channel_info }); res.render('channel', { title: 'List of videos',videos: data, channel: channel_info });
}); });
}); });

View File

@ -42,7 +42,7 @@ router.get('/', function(req, res, next) {
var db = config.init_db(); var db = config.init_db();
/*var data = []; /*var data = [];
//on fais toute les opération de base a la suite //we do all the basic operations following
db.serialize(function() { db.serialize(function() {
//db.run("CREATE TABLE if not exists user_info (info TEXT)"); //db.run("CREATE TABLE if not exists user_info (info TEXT)");

View File

@ -8,7 +8,7 @@ router.get('/', function(req, res, next) {
var db = config.init_db(); var db = config.init_db();
var data = []; var data = [];
//on fais toute les opération de base a la suite //we do all the basic operations following
db.serialize(function() { db.serialize(function() {
//db.run("CREATE TABLE if not exists user_info (info TEXT)"); //db.run("CREATE TABLE if not exists user_info (info TEXT)");
@ -22,9 +22,9 @@ router.get('/', function(req, res, next) {
+ " FROM library_sections ORDER BY name ASC", function(err, row) { + " FROM library_sections ORDER BY name ASC", function(err, row) {
data.push(row); data.push(row);
}, },
//aprés toute les opération de la base //after all the operations of the database
function() { function() {
res.render('index', { title: 'Liste des channel',channels: data, presentation: config.presentation }); res.render('index', { title: 'List of videos',channels: data, presentation: config.presentation });
}); });
}); });

View File

@ -41,7 +41,7 @@ router.get('/:id', function(req, res, next) {
row.file.push(ligne); row.file.push(ligne);
},function(){ },function(){
res.render('movie', { title: 'Détail vidéo',movie: row }); res.render('movie', { title: 'Video Detail',movie: row });
}); });
}); });

View File

@ -21,7 +21,7 @@ router.get('/:id/:incoming_chan', function(req, res, next) {
var db = config.init_db(); var db = config.init_db();
var data = []; var data = [];
//on fais toute les opération de base a la suite //we do all the basic operations following
db.serialize(function() { db.serialize(function() {
db.each("SELECT episode.id as id, episode.title as titre, episode.[index] as episode, episode.duration as second, season.[index] as saison, show.title as serie "+ db.each("SELECT episode.id as id, episode.title as titre, episode.[index] as episode, episode.duration as second, season.[index] as saison, show.title as serie "+
@ -51,7 +51,7 @@ router.get('/:id/:incoming_chan', function(req, res, next) {
}); });
db.close(function(){ db.close(function(){
//aprés toute les opération de la base //after all the operations of the database
var titre = "Série inexistante"; var titre = "Série inexistante";
if(data.length > 0){ if(data.length > 0){
titre = 'Episode de '+data[0].serie; titre = 'Episode de '+data[0].serie;

View File

@ -8,7 +8,7 @@ router.get('/:id', function(req, res, next) {
var shows = []; var shows = [];
//on fais toute les opération de base a la suite //we do all the basic operations following
db.serialize(function() { db.serialize(function() {
db.each("SELECT id, title, year" db.each("SELECT id, title, year"
@ -17,10 +17,10 @@ router.get('/:id', function(req, res, next) {
,req.params.id, function(err, row) { ,req.params.id, function(err, row) {
shows.push(row); shows.push(row);
}, },
//aprés toute les opération de la base //after all the operations of the database
function(){ function(){
console.log(shows); console.log(shows);
res.render('show_list', { title: 'Liste des séries',shows: shows, channel_id: req.params.id }); res.render('show_list', { title: 'List of series',shows: shows, channel_id: req.params.id });
}); });
}); });

15
systemd script Normal file
View File

@ -0,0 +1,15 @@
# /etc/systemd/system/pwd.service
# change user to someone whos not root
[Unit]
Description=pwd
After=network-online.target
[Service]
User=root
Type=simple
ExecStart=/usr/bin/npm start /opt/plex-web-downloader/
Restart=on-abort
[Install]
WantedBy=default.target

View File

@ -6,21 +6,21 @@ block content
table(id="example", class="table table-striped table-bordered", cellspacing="0", width="100%") table(id="example", class="table table-striped table-bordered", cellspacing="0", width="100%")
thead thead
tr tr
th Nom th Name
th Durée th duration
th Année th Year
tbody tbody
each video, i in videos each video, i in videos
tr tr
td td
a(href="/movie/#{video.id}") #{video.title}  a(href="/pwd/movie/#{video.id}") #{video.title} 
td= video.duree td= video.duration
td= video.year td= video.year
script. script.
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable({ $('#example').DataTable({
"language": { "language": {
"url": "//cdn.datatables.net/plug-ins/1.10.8/i18n/French.json" "url": "//cdn.datatables.net/plug-ins/1.10.8/i18n/English.json"
} }
}); });
}); });

View File

@ -11,6 +11,6 @@ block content
each channel, i in channels each channel, i in channels
li li
if(channel.type == 2) if(channel.type == 2)
a(href="/show_list/#{channel.id}")= channel.name a(href="/pwd/show_list/#{channel.id}")= channel.name
else else
a(href="/channel/#{channel.id}")= channel.name a(href="/pwd/channel/#{channel.id}")= channel.name

View File

@ -16,16 +16,16 @@ html
button.navbar-toggle(type="button",data-toggle="collapse",data-target="#collapse-menu") button.navbar-toggle(type="button",data-toggle="collapse",data-target="#collapse-menu")
span.sr-only Toggle navigation span.sr-only Toggle navigation
i.fa.fa-bars i.fa.fa-bars
a.navbar-brand(href="/") a.navbar-brand(href="/pwd/")
b Plex  b Plex 
| Web Downloader | Web Downloader
div#collapse-menu.collapse.navbar-collapse div#collapse-menu.collapse.navbar-collapse
ul.nav.navbar-nav.navbar-right ul.nav.navbar-nav.navbar-right
li.active li.active
a(href="/") Accueil a(href="/pwd/") Home
li li
a(href="/divers") Divers a(href="/pwd/divers") Divers
div.wrapper div.wrapper
div.container div.container

View File

@ -3,17 +3,17 @@ extends layout
block content block content
h1= movie.title h1= movie.title
a(href="#",onclick="window.history.back();") Retour à la liste a(href="#",onclick="window.history.back();") back to the list
br br
br br
label Note label Note
p= movie.rating p= movie.rating
label Télécharger label Download
br br
each file, i in movie.file each file, i in movie.file
a(href="/file/#{file.id}/#{file.filename}") #{file.size} #{file.filename} a(href="/pwd/file/#{file.id}/#{file.filename}") #{file.size} #{file.filename}
br br
br br
label Résumé label Résumé

View File

@ -3,28 +3,28 @@ extends layout
block content block content
h1= title h1= title
a(href="/show_list/#{channel_id}") Retour à la liste des séries a(href="/pwd/show_list/#{channel_id}") Back to the list of series
br br
br br
table(id="example", class="table table-striped table-bordered", cellspacing="0", width="100%") table(id="example", class="table table-striped table-bordered", cellspacing="0", width="100%")
thead thead
tr tr
th Nom th Name
th Saison & Episode th Season & Episode
th Durée th duration
tbody tbody
each video, i in videos each video, i in videos
tr tr
td td
a(href="/movie/#{video.id}") #{video.titre}  a(href="/pwd/movie/#{video.id}") #{video.titre} 
td= video.season_episode td= video.season_episode
td= video.duree td= video.duration
script. script.
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable({ $('#example').DataTable({
"language": { "language": {
"url": "//cdn.datatables.net/plug-ins/1.10.8/i18n/French.json" "url": "//cdn.datatables.net/plug-ins/1.10.8/i18n/English.json"
} }
}); });
}); });

View File

@ -6,19 +6,19 @@ block content
table(id="example", class="table table-striped table-bordered", cellspacing="0", width="100%") table(id="example", class="table table-striped table-bordered", cellspacing="0", width="100%")
thead thead
tr tr
th Série th Series
th Année th Year
tbody tbody
each show, i in shows each show, i in shows
tr tr
td td
a(href="/show/#{show.id}/#{channel_id}")= show.title a(href="/pwd/show/#{show.id}/#{channel_id}")= show.title
td= show.year td= show.year
script. script.
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable({ $('#example').DataTable({
"language": { "language": {
"url": "//cdn.datatables.net/plug-ins/1.10.8/i18n/French.json" "url": "//cdn.datatables.net/plug-ins/1.10.8/i18n/English.json"
} }
}); });
}); });