Compare commits

..

1 Commits

Author SHA1 Message Date
Antoine WEBER 9e01dd3724 modification de la TODOLIST 2015-10-08 12:19:05 +02:00
17 changed files with 113 additions and 130 deletions

130
README.md
View File

@ -1,135 +1,133 @@
Plex Web Downloader Plex Web Downloader
=============== ===============
The original translated into english and using pwd url base for nginx reverse proxy use Ce projet permet de créer une liste de vos fichiers vidéo plex et de les partager aux travers d'une interface web.
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
-------------------- --------------------
If you prefer to compile the latest version of the project yourself, or if your operating system is not supported: **Sur Windows**
** On Windows ** pré requis, installer git ( https://git-scm.com/download/win )
  prerequisites, install git (https://git-scm.com/download/win) pré requis, installer nodejs 0.12.x ( https://nodejs.org/dist/v0.12.7/ )
  prerequisites, install nodejs 0.12.x (https://nodejs.org/dist/v0.12.7/) ouvrir l'invite de commande 'cmb', puis se deplacer dans un repertoire où vous voulez installer
  open the 'cmb' command prompt, and then move to a directory where you want to install 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 (attention il faut doubler les anti-slash et proteger les espaces )
  modify the file config.js, to put the path of the database plex (attention must double the anti-slash and protect the spaces) exemple: C:\\Users\\yourUsername\\AppData\\Local\\Plex\ Media\ Server\\Plug-in\ Support\\Databases\\com.plexapp.plugins.library.db
  For example: C: \\ Users \\ yourUsername \\ AppData \\ Local \\ 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
** Under MacOS ** **Sous MacOS**
  prerequisites, nodejs pré requis, nodejs
    brew install node sinon installer homebrew
  then ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    git clone https://github.com/12nick12/pwd.git et :
    cd plex-web-downloader brew install node
    npm install git clone https://github.com/TwanoO67/plex-web-downloader.git
  modify the file config.js, to put the path of the database plex cd plex-web-downloader
  example: / Users / yourUsername / Library / Application Support / Plex Media Server / Plug-in Support / Databases / com.plexapp.plugins.library.db npm install
    npm start modifier le fichier config.js, pour y mettre le chemin de la base de données plex
  then open in your browser the address http: // localhost: 3000 exemple: /Users/yourUsername/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
npm start
puis ouvrir dans votre navigateur l'adresse http://localhost:3000
** Under Ubuntu ** **Sous Ubuntu**
  prerequisites nodejs, or pré requis nodejs, ou
    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
  then move to your directory to install and: puis, se déplacer dans votre repertoire pour l'install et :
    git clone https://github.com/12nick12/pwd.git git clone https://github.com/TwanoO67/plex-web-downloader.git
    cd plex-web-downloader cd plex-web-downloader
    npm install npm install
  modify the file config.js, to put the path of the database plex modifier le fichier config.js, pour y mettre le chemin de la base de données plex
  Example: / home / yourUsername / plex-config / Plex Media Server / Plug-in Support / Databases / com.plexapp.plugins.library.db exemple: /home/yourUsername/plex-config/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
    npm start npm start
  then open in your browser the address http: // localhost: 3000 puis ouvrir dans votre navigateur l'adresse http://localhost:3000
DEVELOPMENT DEVELOPPEMENT
-------------------- --------------------
** the project was originally created with ** **le projet a été créée initialement avec**
    node install express -g node install express -g
    node install express-generator -g node install express-generator -g
    express project_name express nom_du_projet
    cd project_name cd nom_du_projet
    npm install npm install
** to install plex (from a dockerfile) ** **pour installer plex (depuis un dockerfile)**
    mkdir ~ / plex-config mkdir ~/plex-config
    sudo chown 797: 797 -R ~ / plex-config sudo chown 797:797 -R ~/plex-config
    sudo docker -d --restart = always -v ~ / plex-config: / config -v ~ / Movies: / media / plex -p 32400: 32400 wernight / plex-media-server sudo docker run -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
then configure your channels on: http: // localhost: 32400 / web / index.html puis configurer vos chaines sur: 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 List TODO Liste
-------------------- --------------------
* Manage thumbnail images * Gérer les images des vignettes
* Manage multi-source downloads by offering a link aria2 (see aria2.sourceforge.net) * Intégrer dans un logiciel avec system-tray pour start/stop le serveur
* Integrated web ui: http://ziahamza.github.io/webui-aria2/ * Mutualisé les sources avec un mirroir centralisé
* Set up an upload limit that can be activated on demand * Gérer les téléchargements multi-source en proposant un lien aria2 (voir aria2.sourceforge.net)
* 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');
//password protection //protection par mot de passe
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");
} }
//send config to everyone //envoyer config a tout le monde
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('/pwd/', require('./routes/index')); app.use('/', require('./routes/index'));
app.use('/pwd/users', require('./routes/users')); app.use('/users', require('./routes/users'));
app.use('/pwd/file', require('./routes/file')); app.use('/file', require('./routes/file'));
app.use('/pwd/channel', require('./routes/channel')); app.use('/channel', require('./routes/channel'));
app.use('/pwd/movie', require('./routes/movie')); app.use('/movie', require('./routes/movie'));
app.use('/pwd/show_list', require('./routes/show_list')); app.use('/show_list', require('./routes/show_list'));
app.use('/pwd/show', require('./routes/show')); app.use('/show', require('./routes/show'));
app.use('/pwd/divers', require('./routes/divers')); app.use('/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
//One begins with the clustering //On commence par la mise en cluster
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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 KiB

View File

@ -23,7 +23,7 @@ router.get('/:id', function(req, res, next) {
} }
} }
//we do all the basic operations following //on fais toute les opération de base a la suite
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);
}, },
//after all the operations of the database //aprés toute les opération de la base
function() { function() {
res.render('channel', { title: 'List of videos',videos: data, channel: channel_info }); res.render('channel', { title: 'Liste des vidéos',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 = [];
//we do all the basic operations following //on fais toute les opération de base a la suite
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 = [];
//we do all the basic operations following //on fais toute les opération de base a la suite
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);
}, },
//after all the operations of the database //aprés toute les opération de la base
function() { function() {
res.render('index', { title: 'List of videos',channels: data, presentation: config.presentation }); res.render('index', { title: 'Liste des channel',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: 'Video Detail',movie: row }); res.render('movie', { title: 'Détail vidéo',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 = [];
//we do all the basic operations following //on fais toute les opération de base a la suite
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(){
//after all the operations of the database //aprés toute les opération de la base
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 = [];
//we do all the basic operations following //on fais toute les opération de base a la suite
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);
}, },
//after all the operations of the database //aprés toute les opération de la base
function(){ function(){
console.log(shows); console.log(shows);
res.render('show_list', { title: 'List of series',shows: shows, channel_id: req.params.id }); res.render('show_list', { title: 'Liste des séries',shows: shows, channel_id: req.params.id });
}); });
}); });

View File

@ -1,15 +0,0 @@
# /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 Name th Nom
th duration th Durée
th Year th Année
tbody tbody
each video, i in videos each video, i in videos
tr tr
td td
a(href="/pwd/movie/#{video.id}") #{video.title}  a(href="/movie/#{video.id}") #{video.title} 
td= video.duration td= video.duree
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/English.json" "url": "//cdn.datatables.net/plug-ins/1.10.8/i18n/French.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="/pwd/show_list/#{channel.id}")= channel.name a(href="/show_list/#{channel.id}")= channel.name
else else
a(href="/pwd/channel/#{channel.id}")= channel.name a(href="/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="/pwd/") a.navbar-brand(href="/")
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="/pwd/") Home a(href="/") Accueil
li li
a(href="/pwd/divers") Divers a(href="/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();") back to the list a(href="#",onclick="window.history.back();") Retour à la liste
br br
br br
label Note label Note
p= movie.rating p= movie.rating
label Download label Télécharger
br br
each file, i in movie.file each file, i in movie.file
a(href="/pwd/file/#{file.id}/#{file.filename}") #{file.size} #{file.filename} a(href="/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="/pwd/show_list/#{channel_id}") Back to the list of series a(href="/show_list/#{channel_id}") Retour à la liste des séries
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 Name th Nom
th Season & Episode th Saison & Episode
th duration th Durée
tbody tbody
each video, i in videos each video, i in videos
tr tr
td td
a(href="/pwd/movie/#{video.id}") #{video.titre}  a(href="/movie/#{video.id}") #{video.titre} 
td= video.season_episode td= video.season_episode
td= video.duration td= video.duree
script. script.
$(document).ready(function() { $(document).ready(function() {
$('#example').DataTable({ $('#example').DataTable({
"language": { "language": {
"url": "//cdn.datatables.net/plug-ins/1.10.8/i18n/English.json" "url": "//cdn.datatables.net/plug-ins/1.10.8/i18n/French.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 Series th Série
th Year th Année
tbody tbody
each show, i in shows each show, i in shows
tr tr
td td
a(href="/pwd/show/#{show.id}/#{channel_id}")= show.title a(href="/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/English.json" "url": "//cdn.datatables.net/plug-ins/1.10.8/i18n/French.json"
} }
}); });
}); });