<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Void And Any &#187; serie</title>
	<atom:link href="http://voidandany.free.fr/index.php/tag/serie/feed/" rel="self" type="application/rss+xml" />
	<link>http://voidandany.free.fr</link>
	<description>mon bazar...</description>
	<lastBuildDate>Sat, 09 Dec 2017 09:24:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Téléchargement automatique de séries avec le dockstar</title>
		<link>http://voidandany.free.fr/index.php/telechargement-automatique-de-series-avec-le-dockstar/</link>
		<comments>http://voidandany.free.fr/index.php/telechargement-automatique-de-series-avec-le-dockstar/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 21:11:27 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[flexget]]></category>
		<category><![CDATA[periscope]]></category>
		<category><![CDATA[serie]]></category>
		<category><![CDATA[sous-titres]]></category>
		<category><![CDATA[Transmission]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=3953</guid>
		<description><![CDATA[Voici un article décrivant tout un workflow de téléchargement automatisé de séries au fur et à mesure de leur diffusion sur Internet. Cette article est la compilation de nombreux de mes articles qui traitaient d&#8217;un bout du sujet Les manipulation &#8230; <a href="http://voidandany.free.fr/index.php/telechargement-automatique-de-series-avec-le-dockstar/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Voici un article décrivant tout un workflow de téléchargement automatisé de séries au fur et à mesure de leur diffusion sur Internet.</p>
<p>Cette article est la compilation de nombreux de mes articles qui traitaient d&#8217;un bout du sujet</p>
<p>Les manipulation décrites ont été testé sur mon Dockstar mais peuvent être adaptées sans grand efforts sur tout autre machine Linux.</p>
<p>&nbsp;</p>
<p>Cette article met en œuvre différentes briques logiciels et différents scripts :</p>
<ul>
<li>Flexget : Surveille un flux RSS listant la disponibilité des épisodes de série, si la série est configurée, télécharge le fichier .torrent correspondant et le place dans un répertoire surveillé par Transmission</li>
<li>Transmission : télécharge la série via le protocole P2P bittorent</li>
<li>Scripts Transmission : un ensemble de scripts qui limitent la bande passante dès lors qu&#8217;un PC du LAN est allumé (pour ne pas perturber la navigation sur Internet), déplacent le fichier vidéo de la série dans une répertoire particulier dès lors que le téléchargement par Transmission est terminé (et que le ratio de partage est atteint)</li>
<li>Periscope : Scrute à intervalle régulier le répertoire où sont placé les téléchargements terminés et cherche sur divers sites la disponibilité de sous-titres, auquel cas le fichier de sous titre est téléchargé et renommé automatiquement avec le même nom que le fichier vidéo</li>
<li>Script de rangement : ce script scrute à son tour le répertoire où sont placé les téléchargements terminés et si sont présents à la fois le fichier vidéo et le fichier de sous-titre il les déplace dans un répertoire où la série peut être visionné (répertoire accessible par un HTPC ou par une Freebox)</li>
</ul>
<p>&nbsp;</p>
<p>Enfin avertissement d&#8217;usage : Télécharger c&#8217;est mal, cet article est une démonstration des possibilités de Linux et non pas une incitation à commettre un crime&#8230;</p>
<p>&nbsp;</p>
<h2>Flexget : téléchargement des fichiers torrent à partir d&#8217;un flux RSS</h2>
<h3>Installation</h3>
<p>Dépendances : Flexget est un programme python distribué sous la forme d&#8217;un paquet egg installable via la commande easy_install du paquet python-setuptools :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> python2.6 python-setuptools</pre></div></div>

<p>(Cette installation est assez gourmande en espace disque presque 17Mo sur mon Dockstar)</p>
<p>Comme indiqué l&#8217;installation de Flexget est ensuite simple car packagé sous la forme d&#8217;un egg :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> easy_install flexget</pre></div></div>

<p>Les paquets egg s&#8217;assurent de l’installation des dépendance (en terme de librairies Python). Lors de l&#8217;installation de PyYAML j&#8217;ai eu cette erreur qui ne semble pas avoir de conséquences :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">libyaml is not found or a compiler error: forcing --without-libyaml
(if libyaml is installed correctly, you may need to
specify the option --include-dirs or uncomment and
modify the parameter include_dirs in setup.cfg)
zip_safe flag not set; analyzing archive contents...
Adding PyYAML 3.09 to easy-install.pth file</pre></div></div>

<p>&nbsp;</p>
<h3>Configuration</h3>
<p>Par défaut Flexget va chercher sa configuration dans un fichier config.yml dans un répertoire .flexget du répertoire  home de l&#8217;utilisateur le lançant, on créé donc ce fichier :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> ~<span style="color: #000000; font-weight: bold;">/</span>.flexget
<span style="color: #7a0874; font-weight: bold;">cd</span> ~<span style="color: #000000; font-weight: bold;">/</span>.flexget
<span style="color: #c20cb9; font-weight: bold;">touch</span> config.yml</pre></div></div>

<p>Vient ensuite la configuration proprement dite de Flexget et partie la plus compliquée (enfin le temps de comprendre la syntaxe de la configuration Flexget).</p>
<p>Pour vous aider vous pouvez :</p>
<ul>
<li>lire le paragraphe Configuration de mon article <a title="Lien permanent vers Téléchargement automatisé de séries avec Flexget" rel="bookmark" href="../index.php/telechargement-automatise-de-series-avec-flexget-torrents/">Téléchargement automatisé de séries avec Flexget</a></li>
<li>lire, parcourir, étudier le <a href="http://flexget.com/">site de Flexget</a> et plus particulièrement les pages <a href="http://flexget.com/wiki/Plugins/series">series</a>, <a href="http://flexget.com/wiki/Plugins/series/per_series_settings">How to configure settings per series, </a><a href="http://flexget.com/wiki/Plugins/series/per_group_settings">How to configure settings with groups</a> et <a href="http://flexget.com/wiki/Cookbook/Series">series cookbook</a></li>
<li>vous inspirer du squelette de mon fichier qui fonctionne parfaitement (l&#8217;envoi de mail se fait en utilisant le serveur SMTP de Free qui ne nécessite pas d&#8217;authentification si c&#8217;est votre FAI)</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">presets:
  global:
    email:
      from: adresse@free.fr
      to:
        - adresse@free.fr
      smtp_host: smtp.free.fr
feeds:
  Series_torrent:
    rss: http://showrss.karmorra.info/xxx
    series:
       settings:
         hdtv:
           timeframe: 3 hours
           quality: hdtv
         720p:
           timeframe: 3 hours
           quality: 720p
       hdtv:
         - Nom série 1
         - Nom série 2
       720p:
         - Nom série téléchargée en HD
    download: /data/downloads/torrents/watch/</pre></div></div>

<p>&nbsp;</p>
<h2>Transmission : téléchargement de la série</h2>
<p>Flexget télécharge le fichier .torrent correspondant à un épisode de série, Transmission se charge de télécharger l&#8217;épisode.</p>
<h3>Installation</h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> transmission-daemon transmission-cli</pre></div></div>

<p>(place occupé sur mon système : 1 692 ko)</p>
<p>Le paquet transmission-cli n&#8217;est utile que pour les scripts périphériques à Transmission (déplacement des torrents terminés, économie de bande passante)</p>
<p>Pour ma configuration j&#8217;utilise l&#8217;arborescence de répertoire suivante :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">download/
    torrents/
        complete/
        downloading/
        seeding/
        watch/</pre></div></div>

<ul>
<li>watch : répertoire configuré dans Flexget dans lequel les fichiers .torrent vont être déposés, Transmission est configuré pour surveiller ce répertoire et démarrer automatiquement le téléchargement correspondant</li>
<li>downloading : répertoire ou sont situés les fichiers en cours de téléchargement (fichier avec une extension part pour partial)</li>
<li>seeding : fichier complet mais pour lesquels le ratio de partage n&#8217;a pas encore été atteint</li>
<li>complete : répertoire où sont déposés in-fine les fichiers complétement téléchargés (et ayant atteint le bon ratio de partage). Ce répertoire est ensuite scruté pour la recherche des sous-titres</li>
</ul>
<p>&nbsp;</p>
<h3>Changement de l&#8217;utilisateur démarrant Transmission (optionnel)</h3>
<p>Stopper Transmission :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon stop</pre></div></div>

<p>Éditer le fichier default du script d&#8217;init :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>default<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon</pre></div></div>

<p>Mettre la ligne OPTIONS en commentaire :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#OPTIONS=&quot;--config-dir $CONFIG_DIR&quot;</span></pre></div></div>

<p>Éditer le script d&#8217;init</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon</pre></div></div>

<p>Changer l&#8217;utilisateur démarrant le service en modifiant la ligne USER :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">USER</span>=mon_utilisateur <span style="color: #666666; font-style: italic;">#debian-transmission</span></pre></div></div>

<p>Copier le fichier de configuration vers le HOME de notre utilisateur (et mettre à jour les droits) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon<span style="color: #000000; font-weight: bold;">/</span>settings.json <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> mon_utilisateur:mon_utilisateur <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.config<span style="color: #000000; font-weight: bold;">/</span>transmission-daemon<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-R</span></pre></div></div>

<p>&nbsp;</p>
<h3>Configuration de Transmission</h3>
<p>La configuration de Transmission doit se faire lorsque ce dernier ne fonctionne pas, il faut donc arrêter le démon si cela n&#8217;est pas déjà fait :</p>

<div class="wp_syntax"><div class="code"><pre class="avisynth" style="font-family:monospace;">sudo <span style="color:#006600; font-weight:bold;">/</span>etc<span style="color:#006600; font-weight:bold;">/</span>init<span style="color:#006600; font-weight:bold;">.</span><span style="color:#9900CC;">d</span><span style="color:#006600; font-weight:bold;">/</span>transmission<span style="color:#006600; font-weight:bold;">-</span>daemon stop</pre></div></div>

<p>On édite ensuite le fichier settings.json qui contient tous les paramètres de Transmission, selon si vous avez réalisé la configuration du paragraphe ci-dessus ce fichier se situe dans votre $HOME dans .config/transmission-deamon sinon il est dans /etc/transmission-deamon</p>
<p>Je ne reprendrais pas ici l&#8217;explication des différents paramètres voir pour cela mon article <a title="Lien permanent vers Installer et configurer Transmission en tant que démon" rel="bookmark" href="https://wakala.davidy.fr/ph/index.php?q=406a0f0004b616c61154637a12e91a0a1eb4d83aCkJHEwlOTkAJUVYDDFdTDUwYXhcHUxdfFxkIXgEBSR9IDBUdXlYSFgNaXwZBTARCS1tdDARaVRZHU0pIFkRYVxZbCEMWDV5fFQELH0NZDxZPR0YGHgUEWwlWHQ%3D%3D">Installer et configurer Transmission en tant que démon</a></p>
<p>&nbsp;</p>
<h3>Paramétrage d&#8217;une Blocklist personnalisée</h3>
<p>Une blocklist est une liste d&#8217;adresse IP avec qui on ne souhaite pas partager les fichiers en cours de téléchargement. Pour mettre à jour cette liste ou en utiliser une personnalisée se référer à mon article <a title="Lien permanent vers Utiliser des listes de blocage personnalisées (blocklist) avec le démon Transmission" rel="bookmark" href="../index.php/utiliser-des-listes-de-blocage-personnalisees-blocklist-avec-le-demon-transmission/">utiliser des listes de blocage personnalisées (blocklist) avec le démon Transmission</a></p>
<h3>Déplacement des téléchargements terminés</h3>
<p>Par défaut une fois les téléchargements terminés Transmission partage indéfiniment le fichier, ce comportement peut être modifié par script voir mon article <a title="Lien permanent vers Déplacer/enlever les téléchargements terminés de Transmission (démon)" rel="bookmark" href="../index.php/deplacerenlever-les-telechargements-termines-de-transmission-demon/">Déplacer/enlever les téléchargements terminés de Transmission (démon)</a></p>
<h3>Limitation automatique de la bande passante</h3>
<p>Lorsque Transmission télécharge il prendra par défaut toute la bande passante, pénalisant les autres usage d&#8217;Internet sur le réseau.</p>
<p>Il est possible de définir des vitesses maximales de téléchargement afin de limiter ce comportement, voir il est possible de définir 2 vitesses maximales et de les planifier en fonction des jours / heures.</p>
<p>Mais encore mieux grâce a un petit script qui s’exécute à intervalle régulier le basculement de la vitesse maximal à la vitesse modéré se fait automatiquement dès lors qu&#8217;un PC du réseau est allumé, pour en savoir plus voir mon article <a title="Lien permanent vers Limiter l’usage de la bande passante par Transmission automatiquement" rel="bookmark" href="../index.php/limiter-lusage-de-la-bande-passante-par-transmission-automatiquement/">Limiter l’usage de la bande passante par Transmission automatiquement</a></p>
<p>&nbsp;</p>
<h2>Periscope : recherche des sous-titres</h2>
<p>Périscope permet de télécharger les sous-titres associés à un fichier vidéo. Il se base sur divers sites fournissant des sous titres (dont <a rel="nofollow" href="http://www.opensubtitles.org/en">OpenSubtitles.org</a>)</p>
<p>Personnellement je l&#8217;installe depuis les sources ainsi :</p>
<p>Installation de subversion pour récupérer le dernier code source et des dépendances de Périscope :</p>
<pre>sudo aptitude install subversion python-setuptools python-beautifulsoup python-xdg</pre>
<p>Téléchargement du code source :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> checkout http:<span style="color: #000000; font-weight: bold;">//</span>periscope.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">/</span> periscope-svn</pre></div></div>

<p>Installation :</p>
<div>
<div>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> periscope-svn
<span style="color: #c20cb9; font-weight: bold;">sudo</span> python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

</div>
</div>
<p>Bonus : <a href="http://voidandany.free.fr/wp-content/uploads/SousTitresEu.py">mon plugin sous-titres.eu</a> (pour l&#8217;installer copier le fichier dans le répertoire plugins des     sources et ajouter la ligne &laquo;&nbsp;from SousTitresEu import SousTitresEu&nbsp;&raquo;     dans le fichier __init__.py du répertoire plugins puis compiler)</p>
<p>&nbsp;</p>
<p>Configuration de la langue via le fichier ~/.config/periscope</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[DEFAULT]
 lang = fr
 plugins =</pre></div></div>

<p>Plus de détails :<a title="Lien permanent vers Téléchargement automatique des sous-titres de série avec Periscope" rel="bookmark" href="../index.php/telechargement-automatique-des-sous-titres-de-serie-avec-periscope/">Téléchargement automatique des sous-titres de série avec Periscope</a> et<a title="Lien permanent vers Installer Periscope depuis les sources + activation / désactivation des plugins" rel="bookmark" href="../index.php/installer-periscope-depuis-les-sources-activation-desactivation-des-plugins/"> Installer Periscope depuis les sources + activation / désactivation des plugins</a></p>
<p>&nbsp;</p>
<h2>Script de déplacement des fichiers</h2>
<p>Dernière étape, on a le fichier vidéo (téléchargé via Flexget et Transmission) et le fichier de sous-titre (téléchargé par Periscope), tous deux portent le même nom (merci Periscope) maitenant on veut pouvoir les ranger, c&#8217;est à dire les déplacer vers un autre espace disque où ils pourront être visionnées.</p>
<p>Ce répertoire est très spécifique à l&#8217;installation de chacun je vais ici décrire la mienne, à vous de l’adapter à votre architecture.</p>
<p>&nbsp;</p>
<p>Donc dans mon cas c&#8217;est mon <a title="7 sujets" href="../index.php/tag/dockstar/">dockstar</a> qui réalise toutes les opération de téléchargement, les séries sont ensuite déplacé vers le Freebox Server pour celle en HD et vers mon <a title="12 sujets" href="../index.php/tag/mediacenter/">mediacenter</a> pour les séries SD.</p>
<p>&nbsp;</p>
<p>Mon mediacenter est une machine Linux le plus simple est donc de monter le répertoire de destination via sshfs.</p>
<h3>Préparation déplacement de fichier via sshfs</h3>
<p>Sur la machine cible le client openssh (paquet openssh-client) devra être installé.</p>
<p>Sur la machine source (Dockstar) ayant réalisée les téléchargements et sur laquelle le script va tourner on crée ce qu&#8217;il faut pour établir une connexion SSH sans mot de passe (donc scriptable)</p>
<p>Création des clés :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-t</span> rsa <span style="color: #660033;">-b</span> <span style="color: #000000;">2048</span></pre></div></div>

<p>Ce qui donne :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Generating public/private rsa key pair.
 Enter file in which to save the key (/home/mon_user/.ssh/id_rsa):
 Enter passphrase (empty for no passphrase):
 Enter same passphrase again:
 Your identification has been saved in /home/mon_user/.ssh/id_rsa.
 Your public key has been saved in /home/mon_user/.ssh/id_rsa.pub.
 The key fingerprint is:
 bb:3c:91:f4:6f:cb:da:b1:32:7b:08:f8:4b:33:35:44 mon_user@mon_dockstar
 The key's randomart image is:
 +--[ RSA 2048]----+
 |          E      |
 |         .       |
 |          .      |
 |        ..       |
 |       oSoo      |
 |      . +o..     |
 |       .=o o.    |
 |       oo++o+o   |
 |        +ooB=.   |
 +-----------------+</pre></div></div>

<p>Copie de la clé  publique sur la mahcine cible (le mediacenter) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ssh-copy-id <span style="color: #660033;">-i</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>mon_user<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_rsa.pub mon_user_distant<span style="color: #000000; font-weight: bold;">@</span>IP_machine_distante</pre></div></div>

<p>Ce qui donne :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Now try logging into the machine, with &quot;ssh 'mon_user_distant@IP_machine_distante'&quot;, and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.</pre></div></div>

<p>On obéit au recommandation ci-dessus et on se connecte en SSH sur la machine cible (mediacenter) et on ajoute l’ordinateur distant à liste des known_host, puis on se déconnecte.</p>
<p>On installe ensuite le paquet sshfs (2 879 ko sur mon Dockstar)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> sshfs</pre></div></div>

<p>Préparation du répertoire devant accueillir le montage via sshfs et gestion des droits utilisateur :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>sweetbox
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> mon_user:mon_user <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>sweetbox
<span style="color: #c20cb9; font-weight: bold;">sudo</span> adduser mon_user fuse
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> root:fuse <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>fuse</pre></div></div>

<p>Et on reboot, on peut ensuite (toujours du Dockstar) tester le montage sshfs :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">sshfs mon_user_distant<span style="color: #000000; font-weight: bold;">@</span>IP_mediacenter:<span style="color: #000000; font-weight: bold;">/</span>chemin<span style="color: #000000; font-weight: bold;">/</span>cible<span style="color: #000000; font-weight: bold;">/</span>vers<span style="color: #000000; font-weight: bold;">/</span>les<span style="color: #000000; font-weight: bold;">/</span>series <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>sweetbox<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>Pour démonter :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">fusermount <span style="color: #660033;">-u</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>sweetbox</pre></div></div>

<h3>Script de déplacement des fichiers</h3>
<p>Voici le script de déplacement des fichier de série proprement dit (voir les explication après le script) :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #007800;">SERIESNONTRIE</span>=<span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>torrents<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">complete</span>
<span style="color: #007800;">SERIES_SD_PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>sweetbox
<span style="color: #007800;">SERIES_HD_PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>freebox
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">dirname</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${0}</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #007800;">FREEBOX_MOUNTED</span>=<span style="color: #c20cb9; font-weight: bold;">false</span>
<span style="color: #000000; font-weight: bold;">function</span> chechAndMountFreebox <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$FREEBOX_MOUNTED</span> == <span style="color: #c20cb9; font-weight: bold;">false</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Montage du répertoire contenant les séries de la Freebox&quot;</span>
    curlftpfs <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>192.168.1.254<span style="color: #000000; font-weight: bold;">/</span>Disque<span style="color: #000000; font-weight: bold;">%</span>20dur<span style="color: #000000; font-weight: bold;">/</span>Vidéos<span style="color: #000000; font-weight: bold;">/</span>Séries <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>freebox<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-o</span> <span style="color: #007800;">user</span>=freebox:password,<span style="color: #007800;">uid</span>=<span style="color: #000000;">1000</span>,<span style="color: #007800;">gid</span>=<span style="color: #000000;">1000</span>,<span style="color: #007800;">umask</span>=003
    <span style="color: #007800;">FREEBOX_MOUNTED</span>=<span style="color: #c20cb9; font-weight: bold;">true</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #007800;">SWEETBOX_MOUNTED</span>=<span style="color: #c20cb9; font-weight: bold;">false</span>
<span style="color: #000000; font-weight: bold;">function</span> chechAndMountSweetbox <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$SWEETBOX_MOUNTED</span> == <span style="color: #c20cb9; font-weight: bold;">false</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Montage du répertoire contenant les séries de Sweetbox&quot;</span>
    .<span style="color: #000000; font-weight: bold;">/</span>wakeonlan.sh <span style="color: #ff0000;">&quot;adresse MAC&quot;</span> <span style="color: #ff0000;">&quot;Adresse IP&quot;</span>
    sshfs user_distant<span style="color: #000000; font-weight: bold;">@</span>adresse_ip:<span style="color: #000000; font-weight: bold;">/</span>chemin<span style="color: #000000; font-weight: bold;">/</span>cible<span style="color: #000000; font-weight: bold;">/</span>vers<span style="color: #000000; font-weight: bold;">/</span>les<span style="color: #000000; font-weight: bold;">/</span>series <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>sweetbox<span style="color: #000000; font-weight: bold;">/</span>
    <span style="color: #007800;">SWEETBOX_MOUNTED</span>=<span style="color: #c20cb9; font-weight: bold;">true</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#pour tous les éléments présents dans le repertoire à trier </span>
<span style="color: #000000; font-weight: bold;">for</span> F <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #007800;">$SERIESNONTRIE</span><span style="color: #000000; font-weight: bold;">/*</span>
<span style="color: #000000; font-weight: bold;">do</span>
  <span style="color: #666666; font-style: italic;"># si c'est un fichier</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$F</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">extension</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #800000;">${F##*.}</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tr</span> <span style="color: #ff0000;">&quot;[:upper:]&quot;</span> <span style="color: #ff0000;">&quot;[:lower:]&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$extension</span> == <span style="color: #ff0000;">&quot;avi&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #007800;">SERIES_PATH</span>=<span style="color: #007800;">$SERIES_SD_PATH</span>
      chechAndMountSweetbox
    <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$extension</span> == <span style="color: #ff0000;">&quot;mkv&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #007800;">SERIES_PATH</span>=<span style="color: #007800;">$SERIES_HD_PATH</span>
      chechAndMountFreebox
    <span style="color: #000000; font-weight: bold;">else</span>
      <span style="color: #7a0874; font-weight: bold;">continue</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># on deduit le nom de la serie à partir du nom du fichier</span>
    <span style="color: #007800;">serie</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">basename</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$F</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/\([a-zA-Z.]*\.S[0-9]\{2\}\)E[0-9]\{2\}.*/\1/'</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># si il existe un fichier srt portant le meme nom dans le meme repertoire</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${F%.*}</span>.srt&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
&nbsp;
      <span style="color: #666666; font-style: italic;"># on deplace les 2 fichiers dans un repertoire portant le nom de la serie et de la saison</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> Deplacement de <span style="color: #ff0000;">&quot;<span style="color: #007800;">${F%.*}</span>.*&quot;</span> dans <span style="color: #007800;">$SERIES_PATH</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$serie</span>
&nbsp;
      <span style="color: #666666; font-style: italic;"># si le repertoire destination n'existe pas</span>
      <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SERIES_PATH</span>/<span style="color: #007800;">$serie</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #666666; font-style: italic;"># on le crée</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> Creation <span style="color: #c20cb9; font-weight: bold;">du</span> repertoire <span style="color: #007800;">$SERIES_PATH</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$serie</span>
        <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SERIES_PATH</span>/<span style="color: #007800;">$serie</span>/Vus&quot;</span>
      <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
      <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #800000;">${F%.*}</span>.srt <span style="color: #007800;">$SERIES_PATH</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$serie</span>
      <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #800000;">${F%.*}</span>.<span style="color: #007800;">$extension</span> <span style="color: #007800;">$SERIES_PATH</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$serie</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$FREEBOX_MOUNTED</span> == <span style="color: #c20cb9; font-weight: bold;">true</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Démontage du répertoire contenant les séries de la Freebox&quot;</span>
  <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>freebox<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$SWEETBOX_MOUNTED</span> == <span style="color: #c20cb9; font-weight: bold;">true</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Démontage du répertoire contenant les séries de Sweetbox&quot;</span>
  fusermount <span style="color: #660033;">-u</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>sweetbox
  .<span style="color: #000000; font-weight: bold;">/</span>shutdown.sh <span style="color: #ff0000;">&quot;mon_user_distant&quot;</span> <span style="color: #ff0000;">&quot;IP distante&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p>&nbsp;</p>
<p>Le principe de ce script est le suivant, on parcours tous les  fichiers présents dans le répertoire où sont stocké les téléchargements  terminés (download/torrents/complete/)  (ligne 29)</p>
<p>Ligne 37 : Si le fichier à l&#8217;extension .mkv c&#8217;est une série en HD on va donc potentiellement le déplacer vers la Freebox.</p>
<p>On verifie donc que le disque dur de la Freebox est bien monté (via un booléen) sinon on le fait (voir mon article <a title="Lien permanent vers Monter le disque dur du Freebox Server (v6) en ligne de commande" rel="bookmark" href="../index.php/monter-le-disque-dur-du-freebox-server-v6-en-ligne-de-commande/">Monter le disque dur du Freebox Server (v6) en ligne de commande</a>) (ligne 39 et fonction en ligne 9-16)</p>
<p>Ligne 34 : Si  le fichier à l&#8217;extension .avi c&#8217;est une série en SD on va donc  potentiellement le déplacer vers le mediacenter (sweetbox) via sshfs.</p>
<p>Je  fais alors appel à mon script de démarrage via WakeOnLan qui démarre la  machine dont on passe l&#8217;adresse IP et MAC en paramètre si elle ne l&#8217;est  pas déjà, sinon on flag le fait que le mediacenter était déjà allumé  pour ne pas l&#8217;éteindre à la fin (voir <a title="Lien permanent vers Allumer / éteindre un PC sous Linux à distance (scripts)" rel="bookmark" href="../index.php/allumer-eteindre-un-pc-sous-linux-a-distance-scripts/">Allumer / éteindre un PC sous Linux à distance (scripts)</a>). Puis on monte le répertoire de destination. (ligne 36 et fonction en ligne 18-27)</p>
<p>Ligne 48 : on vérifie si on a un fichier de sous-titre, si oui on est OK pour déplacer les 2 fichiers (lignes 60-61) vers le chemin cible déterminé en fonction du type du fichier vidéo en cours de traitement (lignes 35 et 38)</p>
<p>Les séries sont rangé dans le répertoire cible dans un sous répertoire du nom de la série (ligne 45) que l&#8217;on crée le cas échéant (lignes 54-58)</p>
<p>Lignes 66-74 : Puis on range comme c&#8217;était avant notre arrivé, on démonte les point de montage et on n’éteint le mediacenter si ce dernier n&#8217;était pas allumé avant le script (voir <a title="Lien permanent vers Allumer / éteindre un PC sous Linux à distance (scripts)" rel="bookmark" href="../index.php/allumer-eteindre-un-pc-sous-linux-a-distance-scripts/">Allumer / éteindre un PC sous Linux à distance (scripts)</a>)</p>
<p>&nbsp;</p>
<h2>Planification</h2>
<p>Dans cette article de nombreux scripts ont été mis en œuvre il faut les planifier via CRON, en voici un exemple :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">MAILTO</span>=<span style="color: #ff0000;">&quot;&quot;</span>
 <span style="color: #007800;">LANG</span>=fr_FR.UTF-<span style="color: #000000;">8</span>
 <span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>sbin
 <span style="color: #666666; font-style: italic;">##########################################################</span>
 <span style="color: #666666; font-style: italic;">#minute (0-59),                                          #</span>
 <span style="color: #666666; font-style: italic;">#|  hour (0-23),                                         #</span>
 <span style="color: #666666; font-style: italic;">#|  |  day of the month (1-31),                          #</span>
 <span style="color: #666666; font-style: italic;">#|  |  |  month of the year (1-12),                      #</span>
 <span style="color: #666666; font-style: italic;">#|  |  |  |  day of the week (0-6 with 0=Sunday)         #</span>
 <span style="color: #666666; font-style: italic;">#|  |  |  |  |       commands                            #</span>
 <span style="color: #666666; font-style: italic;">##########################################################</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##### Opérations pour Transmission</span>
<span style="color: #666666; font-style: italic;"># téléchargement d'une blocklist personnalisé une fois par semaine</span>
<span style="color: #000000;">0</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000;">0</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>blocklist_transmission.sh <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>maintenance<span style="color: #000000; font-weight: bold;">/</span>blocklist.log
<span style="color: #666666; font-style: italic;"># Toutes les 3h on vérifie s'il n'y a pas une téléchargement terminé à déplacer</span>
<span style="color: #000000;">30</span> <span style="color: #000000; font-weight: bold;">*/</span><span style="color: #000000;">3</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>remove_completed_torrents.sh
<span style="color: #666666; font-style: italic;"># Toutes les minutes on vérifie s'il n'y a pas un PC qui s'allume sur le réseau pour basculer en vitesse lente</span>
<span style="color: #000000; font-weight: bold;">*/</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>alt_speed_transmission.sh
&nbsp;
<span style="color: #666666; font-style: italic;">##### Téléchargement des séries, on enchaine flexget, periscope et le déplacement des fichier toutes les 3h (les 3 scripts étant espacé de 20 minutes)</span>
<span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">*/</span><span style="color: #000000;">3</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> flexget <span style="color: #660033;">-v</span> <span style="color: #660033;">--cron</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>flexget.log
<span style="color: #000000;">20</span> <span style="color: #000000; font-weight: bold;">*/</span><span style="color: #000000;">3</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> periscope <span style="color: #000000; font-weight: bold;">/</span>data<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>torrents<span style="color: #000000; font-weight: bold;">/</span>complete<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #000000;">40</span> <span style="color: #000000; font-weight: bold;">*/</span><span style="color: #000000;">3</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>move_tv_show.sh</pre></div></div>

<p>&nbsp;</p>
<p><span style="text-decoration: underline;"><em><strong>Sources: </strong></em></span></p>
<p><em>Flexget : </em></p>
<ul>
<li><a href="http://flexget.com/wiki/Plugins/transmission">Plugins/transmission – FlexGet</a> : Plugin pour Transmission (pas utilisé)</li>
</ul>
<p><em>Transmission : </em></p>
<ul>
<li><a href="http://www.transmissionbt.com/">Transmission</a> : Site officiel </li>
<li><a href="http://www.transmissionbt.com/resources/">Transmission</a> : Liste de plugins sur le site officiel</li>
<li><a href="https://trac.transmissionbt.com/wiki/EditConfigFiles">EditConfigFiles – Transmission</a> : Description des option du fichier settings.json sur le site officiel</li>
<li><a href="http://papillon-butineur.blogspot.com/2010/08/blocklists-avec-transmissionrecopie.html">Papillon-butineur: Blocklists avec Transmission</a> : script de téléchargement des blocklists</li>
<li><a href="http://1000umbrellas.com/2010/10/04/updated-transmission-installationconfiguration-on-ubuntu-server">Updated: Transmission Installation/Configuration on Ubuntu Server &#8211; 1000umbrellas.com</a> : Exemple de configuration et manipulations à effectuer sur les répertoires accueillant les torrents si vous laissez Transmission tourner avec l&#8217;utilisateur debian-transmission</li>
<li><a href="http://www.d3vinside.fr/blog/installer-et-configurer-le-package-transmission-daemon-sous-debian-11">devINSIDE :: Blog :: Installer et configurer le package transmission-daemon sous debian</a> : configuration de base + interaction avec un Vhost apache (intérêt ?)</li>
<li><a href="http://www.realpeace.fr/blog/2010/07/09/installation-transmission-remote-sur-ubuntu-server/">Installation Transmission daemon sur Ubuntu Server « Realpeace&#8217;s Blog</a> : installation et configuration + quelques clients Transmission</li>
<li><a href="http://www.hahadopi.eu/tuto/transmission-daemon-sur-sa-seedbox/">HaHadopi » Transmission-daemon sur sa seedbox</a> : installation et configuration</li>
<li><a href="http://blog.shk-desktop.com/1002-configurer-transmission-pour-laccess-distance-cli">Configurer Transmission pour l’access a distance (CLI) | Shtark.fr</a> : installation et configuration</li>
<li><a href="http://flexget.com/wiki/Plugins/transmission">Plugins/transmission – FlexGet</a> : Plugin Flexget</li>
<li><a href="http://1000umbrellas.com/2010/10/05/updated-how-to-automatically-move-and-remove-transmission-daemon-downloads">Updated: How to Automatically Move and Remove Transmission-Daemon Downloads &#8211; 1000umbrellas.com</a>: Source du script de suppression des torrent terminés</li>
</ul>
<p><em>TVNamer (pas utilisé encore) : </em></p>
<ul>
<li><a href="http://hellnino.homelinux.com/blog/?p=169">HowTo : Renommer un épisode de série automatiquement avec TVNamer | Hellnino&#8217;s Blog</a></li>
<li><a href="http://1000umbrellas.com/2010/04/27/tvnamer-installationconfiguration">TVNamer Installation/Configuration &#8211; 1000umbrellas.com</a></li>
<li><a href="http://1000umbrellas.com/2010/10/10/using-tvnamer-to-move-completed-tv-torrent-downloads">Using TVNamer to Move Completed TV Torrent Downloads &#8211; 1000umbrellas.com</a></li>
<li><a href="https://github.com/dbr/tvnamer/">dbr/tvnamer &#8211; GitHub</a></li>
</ul>
<p><em>SSHFS : </em></p>
<ul>
<li><a href="http://doc.ubuntu-fr.org/sshfs">sshfs &#8211; Documentation Ubuntu Francophone</a></li>
<li><a href="http://www.howtogeek.com/howto/ubuntu/how-to-mount-a-remote-folder-using-ssh-on-ubuntu/">How to Mount a Remote Folder using SSH on Ubuntu &#8211; How-To Geek</a> : indique l&#8217;astuce pour monter un système de fichier distant sans le sudo</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/telechargement-automatique-de-series-avec-le-dockstar/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Installer Periscope depuis les sources + activation / désactivation des plugins</title>
		<link>http://voidandany.free.fr/index.php/installer-periscope-depuis-les-sources-activation-desactivation-des-plugins/</link>
		<comments>http://voidandany.free.fr/index.php/installer-periscope-depuis-les-sources-activation-desactivation-des-plugins/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 20:06:21 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[serie]]></category>
		<category><![CDATA[sous-titres]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=2478</guid>
		<description><![CDATA[Dans l&#8217;article précédent j&#8217;ai décris l&#8217;installation de Periscope depuis le package fournis par l&#8217;auteur, cependant en fin d&#8217;article je mentionne 2-3 points gênants que l&#8217;on peut aisément corriger en modifiant un peu le source. On va donc tout d&#8217;abord voir &#8230; <a href="http://voidandany.free.fr/index.php/installer-periscope-depuis-les-sources-activation-desactivation-des-plugins/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://voidandany.free.fr/wp-content/uploads/periscope-231299375_c77fad231f.jpg"><img class="alignleft size-medium wp-image-2487" style="margin-left: 10px; margin-right: 10px;" title="periscope 231299375_c77fad231f" src="http://voidandany.free.fr/wp-content/uploads/periscope-231299375_c77fad231f-300x202.jpg" alt="" width="300" height="202" /></a>Dans l&#8217;article précédent j&#8217;ai décris l&#8217;installation de Periscope depuis le package fournis par l&#8217;auteur, cependant en fin d&#8217;article je mentionne 2-3 points gênants que l&#8217;on peut aisément corriger en modifiant un peu le source.</p>
<p><br class="spacer_" /></p>
<p>On va donc tout d&#8217;abord voir comment installer Periscope depuis les sources, puis ensuite voir quelles modifications apporter aux sources pour corriger quelques désagréments.</p>
<p><br class="spacer_" /></p>
<p>En pré-requis il faut tout d&#8217;abord désinstaller Periscope si vous l&#8217;avez préalablement installé depuis le package :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> purge python-periscope</pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h3>Installation depuis les sources</h3>
<p>Pour installer Periscope depuis les sources il faut les télécharger avec la commande svn qui fait partie du partie du paquet subversion, on installe donc ce dernier :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> subversion</pre></div></div>

<p><br class="spacer_" /></p>
<p>Puis on télécharge les sources :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> checkout http:<span style="color: #000000; font-weight: bold;">//</span>periscope.googlecode.com<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>trunk<span style="color: #000000; font-weight: bold;">/</span> periscope-svn</pre></div></div>

<p>Cette commande va créer un répertoire periscope-svn dans le répertoire courant et y télécharger tous les fichiers sources de Periscope.</p>
<p><br class="spacer_" /></p>
<p>On installe ensuite les dépendances de Periscope :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> python-setuptools python-beautifulsoup python-xdg</pre></div></div>

<p><br class="spacer_" /></p>
<p>Puis on installe Periscope :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> periscope-svn
<span style="color: #c20cb9; font-weight: bold;">sudo</span> python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h3>Désinstallation de Periscope (installé via les sources)</h3>
<p>Lorsque l&#8217;on a installé Periscope via les sources, il n&#8217;y a pas de commande permettant de la désinstaller automatiquement, il faut il aller à la main :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>python2.6<span style="color: #000000; font-weight: bold;">/</span>dist-packages<span style="color: #000000; font-weight: bold;">/</span>periscope-dev-py2.6.egg<span style="color: #000000; font-weight: bold;">/</span>EGG-INFO<span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>periscope
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>python2.6<span style="color: #000000; font-weight: bold;">/</span>dist-packages<span style="color: #000000; font-weight: bold;">/</span>periscope-dev-py2.6.egg<span style="color: #000000; font-weight: bold;">/</span>periscope
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>periscope</pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h3>Activation / désactivation des plugins</h3>
<p>En désactivant certains plugins de Periscope on peut résoudre 2 des &laquo;&nbsp;problèmes&nbsp;&raquo; remontés lors de l&#8217;article précédent :</p>
<ul>
<li>Certains plugins ne fonctionnent pas bien et remontent des erreurs (exemple plugin podnapisi)</li>
<li>L’empilement des plugins, fait que le temps d’exécution est relativement long</li>
</ul>
<p><br class="spacer_" /></p>
<p>Pour cela il suffit d&#8217;éditer le fichier source suivant : <strong> periscope/plugins/__init__.py</strong></p>
<p><br class="spacer_" /></p>
<p>Qui contient initialement ceci :</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">from OpenSubtitles import OpenSubtitles
from SubtitleSource import SubtitleSource
from SubScene import SubScene
from Subtitulos import Subtitulos
from Addic7ed import Addic7ed
from Podnapisi import Podnapisi</pre></div></div>

</p>
<p><br class="spacer_" /></p>
<p>On peut dès lors supprimer un plugin en commentant la ligne avec un # et en réinstallant Periscope depuis les sources (sudo python setup.py install)</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><span style="text-decoration: underline;"><em><strong>Sources : </strong></em></span></p>
<p>image par <a title="Lien vers la galerie de photos de adam.hyland" rel="dc:creator cc:attributionURL" href="http://www.flickr.com/photos/protonk/"><strong>adam.hyland</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/installer-periscope-depuis-les-sources-activation-desactivation-des-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Téléchargement automatique des sous-titres de série avec Periscope</title>
		<link>http://voidandany.free.fr/index.php/telechargement-automatique-des-sous-titres-de-serie-avec-periscope/</link>
		<comments>http://voidandany.free.fr/index.php/telechargement-automatique-des-sous-titres-de-serie-avec-periscope/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 09:39:59 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[serie]]></category>
		<category><![CDATA[sous-titres]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=2464</guid>
		<description><![CDATA[Periscope est un projet visant à fournir un script Python permettant de télécharger les sous titres d&#8217;une série de façon automatique au fur et a mesure de sa diffusion/téléchargement. Sur mon serveur cette fonction est occupé par Subdl (cf. Subdl &#8230; <a href="http://voidandany.free.fr/index.php/telechargement-automatique-des-sous-titres-de-serie-avec-periscope/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://voidandany.free.fr/wp-content/uploads/Periscope_2329545970_007dc97eb4.jpg"><img class="alignleft size-medium wp-image-2470" style="margin-left: 10px; margin-right: 10px;" title="Periscope_2329545970_007dc97eb4" src="http://voidandany.free.fr/wp-content/uploads/Periscope_2329545970_007dc97eb4-300x225.jpg" alt="" width="300" height="225" /></a>Periscope est un projet visant à fournir un script Python permettant de t<strong>élécharger les sous titres </strong>d&#8217;une série de <strong>façon automatique </strong>au fur et a mesure de sa diffusion/téléchargement.</p>
<p><br class="spacer_" /></p>
<p>Sur mon serveur cette fonction est occupé par Subdl (cf. <a title="Subdl – Téléchargement automatique des sous-titres" rel="bookmark" href="../index.php/subdownload-telechargement-automatique-des-sous-titres/">Subdl – Téléchargement automatique des sous-titres</a>,<a title="Corriger subdl, script de téléchargement automatique de sous-titres" rel="bookmark" href="../index.php/corriger-subdl-script-de-telechargement-automatique-de-sous-titres/"><span style="font-weight: bold;"> </span>Corriger subdl, script de téléchargement automatique de sous-titres</a>) mais ce dernier n&#8217;est plus maintenu (voir n&#8217;existe plus)</p>
<p><br class="spacer_" /></p>
<p>De plus Periscope offre l&#8217;avantage d&#8217;être <strong>multi-sources</strong> (<a rel="nofollow" href="http://www.opensubtitles.org/en">OpenSubtitles.org</a>, <a rel="nofollow" href="http://www.subtitlesource.org/">SubtitleSource.org</a>, <a rel="nofollow" href="http://subscene.com/">Subscene.com</a>, <a rel="nofollow" href="http://www.subtitulos.es/">Subtitulos.es</a> et <a rel="nofollow" href="http://www.addic7ed.com/">Addic7ed.com</a>) là où Subdl ne va chercher que sur <a rel="nofollow" href="http://www.opensubtitles.org/en">OpenSubtitles.org</a></p>
<p><br class="spacer_" /></p>
<ul>
</ul>
<h2>Installation</h2>
<p>Selon le <a href="http://code.google.com/p/periscope/wiki/UbuntuRepository">Wiki de Periscope</a> lorsque l&#8217;on est sous Ubuntu, pour l&#8217;installer il suffit d&#8217;ajouter le <strong>PPA</strong> correspondant puis de l&#8217;installer</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> add-apt-repository ppa:patrick-dessalle<span style="color: #000000; font-weight: bold;">/</span>ppa
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> update
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> python-periscope</pre></div></div>

<p><br class="spacer_" /></p>
<p>Malheureusement ce projet aussi semble un peu à l&#8217;<strong>abandon</strong> (malgré <a href="http://code.google.com/p/periscope/source/list">quelques interventions</a> du développeur dans ses sources en Mai) et vous aurez donc le message d&#8217;erreur suivant :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Impossible de trouver un paquet dont le nom ou la description correspond à « python-periscope »</pre></div></div>

<p>De plus si on regarde le PPA on constate que le package python-periscope <a href="https://launchpad.net/~patrick-dessalle/+archive/ppa/+packages">ne compile plus</a> depuis 10 semaines dû à un <a href="http://launchpadlibrarian.net/48514844/buildlog_ubuntu-lucid-i386.python-periscope_0.1.9.1-lucid_FAILEDTOBUILD.txt.gz">problème de dépendance avec le module beautifulSoup</a></p>
<p><br class="spacer_" /></p>
<p><em>Edit 25/08/2010</em> : Le développeur Patrick Dessalle (qui au passage parle français), indique dans le commentaire ci dessous que le package est réparé (je n&#8217;ai pas testé)</p>
<p><br class="spacer_" /></p>
<p>Bref on va devoir y aller à la main, on <strong>télécharge donc le package</strong> <a href="http://code.google.com/p/periscope/downloads/list">ici</a> et on l&#8217;installe par un simple :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-i</span> python-periscope_0.1.9-<span style="color: #000000;">2</span>_all.deb</pre></div></div>

<p><br class="spacer_" /></p>
<h2>Utilisation</h2>
<p>L&#8217;utilisation de Periscope est ensuite très simple, il suffit de lancer la commande suivante :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">periscope <span style="color: #660033;">-l</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>langage<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>liste fichiers vidéos ou répertoire contenant des vidéos<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p>Pour le langage on prendra &laquo;&nbsp;fr&nbsp;&raquo; pour le français et &laquo;&nbsp;en&nbsp;&raquo; pour l&#8217;anglais, il est possible de spécifier plusieurs langue le sous-titre choisi sera en priorité celui de la première langue.</p>
<p>On pourra sinon renseigner le langage pas défaut dans le fichier de configuration ~/.config/periscope/config</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[DEFAULT]
lang = fr</pre></div></div>

<p><br class="spacer_" /></p>
<p>Periscope est construit sur un mécanisme de plugins, un par site sur lequel on souhaite faire des recherches.</p>
<p>Si le sous-titre est disponible sur plusieurs site, sera gardé celui trouvé en premier c&#8217;est à dire celui du premier plugin appelé, c&#8217;est à à dire dans l&#8217;ordre suivant :</p>
<p><a rel="nofollow" href="http://www.opensubtitles.org/en">OpenSubtitles.org</a>, <a rel="nofollow" href="http://www.subtitlesource.org/">SubtitleSource.org</a>, <a rel="nofollow" href="http://subscene.com/">Subscene.com</a>, <a rel="nofollow" href="http://www.subtitulos.es/">Subtitulos.es</a> et <a rel="nofollow" href="http://www.addic7ed.com/">Addic7ed.com</a></p>
<p><br class="spacer_" /></p>
<p>Pour chaque fichier vidéo trouvé Periscope récupère du nom du fichier le nom de la série, la saison, le numéro d&#8217;épisode et la team ayant mis à disposition la vidéo.</p>
<p>Pour chaque plugin il fait ensuite une requête sur le site du plugin pour avoir la page correspondant à la série / saison / épisode, il récupère la page HTML, analyse le code source de cette dernière afin de trouver les liens de téléchargement et ajoute ces derniers dans une file d&#8217;attente.</p>
<p>Periscope analyse ensuite les liens trouvé afin de déterminer le meilleur en fonction de la/les langues voulues, il réalise le téléchargement, décompresse l&#8217;archive le cas échéant et renomme le fichier de sous titres pour qu&#8217;il ait le même nom que la vidéo.</p>
<p>Évidemment il y a des différences selon les plugins mais le principe général reste celui-ci</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Lors  de la recherche Periscope indique sur la sortie standard les actions  qu&#8217;il réalise et la sortie est plutôt verbeuse voyez plutôt pour un  répertoire ne contenant qu&#8217;une seule vidéo :</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">WARNING:root:/home/[mon user]/Vidéos/Fichier.srt mimetype is 'None' which is not a supported video format (('video/x-msvideo', 'video/quicktime', 'video/x-matroska', 'video/mp4'))
INFO:root:Searching subtitles for /home/[mon user]/Vidéos/Fichier_xxx.avi with langs ['fr']
INFO:root:Searching on OpenSubtitles
INFO:root:Searching on SubtitleSource
INFO:root:Searching on SubScene
INFO:root:Searching on Addic7ed
WARNING:root:Ooops, you found a missing language in the config file of Addic7ed: Spanish. Send a bug report to have it added.
INFO:root:Addic7ed writing 1 items to queue
INFO:root:SubtitleSource writing 0 items to queue
INFO:root:SubScene writing 0 items to queue
ERROR:root:Open subtitles could not be contacted for login
INFO:root:OpenSubtitles writing 0 items to queue
INFO:root:Trying to download subtitle: http://www.addic7ed.com/....
INFO:root:**************************************************
INFO:root:Downloaded 1 subtitles
INFO:root:fr - /home/{mon user]/Vidéos/Fichier_xxx.srt
INFO:root:**************************************************</pre></div></div>

<p><br class="spacer_" /></p>
<p>On peux constater 2 lignes de Warning :</p>
<ul>
<li>Le première indique qu&#8217;un des fichiers trouvés n&#8217;est pas de type vidéo</li>
<li>La deuxième indique qu&#8217;une langue non référencée à été trouvé. En effet Periscope maintient dans le code source de chacun des plugins une liste de correspondance entre les langues utilisé par le site et la liste des langues utilisées par Periscope (par exemple &laquo;&nbsp;fr&nbsp;&raquo; dans Periscope peut correspondre à &laquo;&nbsp;fre&nbsp;&raquo; sur un des sites)</li>
</ul>
<p><br class="spacer_" /></p>
<h2>Conclusion</h2>
<ul>
<li>Periscope offre un alternative intéressante à subdl car il est multi-site.</li>
</ul>
<p>MAIS :</p>
<ul>
<li>Il scan tous les sous-répertoire  du répertoire d&#8217;entrée (y compris les répertoires caché commençant par . par exemple .Trash)</li>
<li>Il est verbeux, par exemple si vous avez des fichiers autre que des vidéos dans le répertoire on aura une ligne de Warning par fichier</li>
<li>Les sites utilisés sont peu alimenté en sous-titres Français</li>
<li>Certains plugins ne fonctionnent pas bien et remontent des erreurs (exemple plugin podnapisi)</li>
<li>L&#8217;empilement des plugins, fait que le temps d&#8217;exécution est relativement long</li>
</ul>
<p><br class="spacer_" /></p>
<p>Dans un prochain article, nous verrons comment installer Periscope depuis les sources, afin de modifier 2-3 pour palier à certains de ces problèmes, enfin je suis en train d&#8217;écrire un plugin pour le site sous-titres.eu qui est une référence en matière de sous-titres Français.</p>
<p><br class="spacer_" /></p>
<p><span style="text-decoration: underline;"><em><strong>Sources :</strong></em></span><br class="spacer_" /></p>
<p><a href="http://code.google.com/p/periscope/"><em>periscope</em> &#8211; Project Hosting on Google Code</a></p>
<p><a href="http://www.ubuntuandus.info/2009/12/31/periscope-script-trouver-charger-directement-sous-titres-vo-films-series/">Periscope, le script pour trouver et charger directement les sous titres en VO de vos films et séries | Ubuntu And Us</a></p>
<p><a title="Permanent Link: Un script pour trouver directement des sous titres en VO pour vos films et séries" rel="bookmark" href="http://www.michtoblog.com/2009/10/23/un-script-pour-trouver-directement-des-sous-titres-en-vo-pour-vos-films-et-series/">Un script pour trouver directement des sous titres en VO pour vos films et séries</a></p>
<p><a href="http://www.xnoccio.com/1081-descarga-masiva-de-subtitulos-con-periscope/">Xnoccio.com &#8211; » Descarga masiva de subtítulos con Periscope</a></p>
<p><a href="http://www.webupd8.org/2009/10/right-click-movies-to-download.html">Right Click Movies To Download Subtitles In Ubuntu ~ Web Upd8</a></p>
<p>Image par <a title="Lien vers la galerie de photos de MATEUS_27:24&amp;25" rel="dc:creator cc:attributionURL" href="http://www.flickr.com/photos/mateus27_24-25/"><strong>MATEUS_27:24&amp;25</strong></a> sous CC BY-NC</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/telechargement-automatique-des-sous-titres-de-serie-avec-periscope/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Corriger subdl, script de téléchargement automatique de sous-titres</title>
		<link>http://voidandany.free.fr/index.php/corriger-subdl-script-de-telechargement-automatique-de-sous-titres/</link>
		<comments>http://voidandany.free.fr/index.php/corriger-subdl-script-de-telechargement-automatique-de-sous-titres/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 11:38:12 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[serie]]></category>
		<category><![CDATA[sous-titres]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=2414</guid>
		<description><![CDATA[Comme je l&#8217;ai indiqué dans mon article Subdl – Téléchargement automatique des sous-titres, j&#8217;utilise le script Python subdl pour télécharger de façon automatique les sous-titres des séries télé que je regarde. Bien que de moins en moins performant (pour des &#8230; <a href="http://voidandany.free.fr/index.php/corriger-subdl-script-de-telechargement-automatique-de-sous-titres/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://voidandany.free.fr/wp-content/uploads/bug_393879108_fd20c73825.jpg"><img class="alignleft size-medium wp-image-2458" style="margin-left: 10px; margin-right: 10px;" title="Bug" src="http://voidandany.free.fr/wp-content/uploads/bug_393879108_fd20c73825-300x281.jpg" alt="" width="300" height="281" /></a>Comme je l&#8217;ai indiqué dans mon article<a title="Subdl – Téléchargement automatique des sous-titres" rel="bookmark" href="../index.php/subdownload-telechargement-automatique-des-sous-titres/"><span style="font-weight: bold;"> </span>Subdl – Téléchargement automatique des sous-titres</a>, j&#8217;utilise le <span style="font-weight: bold;">script</span> Python subdl pour <span style="font-weight: bold;">télécharger de façon automatique les sous-titres des séries télé</span> que je regarde.</p>
<p><br class="spacer_" /></p>
<p>Bien que de moins en moins performant (pour des raisons de non disponibilité des sous-titres sur opensubtitle.org), ce script faire une première partie du travail.</p>
<p><br class="spacer_" /></p>
<p>Mais depuis plusieurs mois il ne <span style="font-weight: bold;">fonctionne plus</span>.</p>
<p>Pas de correction à attendre de l&#8217;auteur le script n&#8217;est plus maintenu et le site n&#8217;existe même plus (je peux héberger le script si vous êtes intéressés)</p>
<p><br class="spacer_" /></p>
<p>Ce problème provient du fait qu&#8217;opensubtitle.org à changé l&#8217;adresse web de son API, il faut donc corriger le script.</p>
<p><br class="spacer_" /></p>
<p>Dans le répertoire où vous avez installé / décompressé subdl, éditer le fichier subdl (qui est un script Python),  localiser la ligne suivante :</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">osdb_server = <span style="color: #483d8b;">&quot;http://www.opensubtitles.org/xml-rpc&quot;</span></pre></div></div>

<p><br class="spacer_" /></p>
<p>Et la modifier ainsi :</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">osdb_server = <span style="color: #483d8b;">&quot;http://api.opensubtitles.org/xml-rpc&quot;</span></pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><span style="font-weight: bold; font-style: italic;">Remarque </span>: cette correction supprime le problème systématique dû au changment d&#8217;URL de l&#8217;API opensubtitle.org, mais ce service reste très instable et pas très performant.</p>
<p>Sur 17 épisodes d&#8217;une même série (série de l&#8217;année 2009-2010, ayant fait parler d&#8217;elle), l&#8217;appel de subdl via :</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">*</span>.avi <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-t</span> <span style="color: #660033;">-I</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> python bin<span style="color: #000000; font-weight: bold;">/</span>subdl<span style="color: #000000; font-weight: bold;">/</span>subdl <span style="color: #660033;">--lang</span>=fre <span style="color: #660033;">--existing</span>=bypass <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #666666; font-style: italic;">#</span></pre></div></div>

<p>
m&#8217;a donnée :</p>
<ul>
<li>11 erreurs &laquo;&nbsp;Error in XMLRPC SearchSubtitles call: [Errno 104] Connection reset by peer&nbsp;&raquo;</li>
<li>2 erreurs &laquo;&nbsp;Error in XMLRPC SearchSubtitles call: &lt;ProtocolError for api.opensubtitles.org/xml-rpc: 503 Service Not Available&gt;&nbsp;&raquo;</li>
<li>3 sous-titre non trouvés</li>
</ul>
<p>Lors de la première exécution et</p>
<ul>
<li>3 erreurs &laquo;&nbsp;Error in XMLRPC SearchSubtitles call: [Errno 104] Connection reset by peer&nbsp;&raquo;</li>
<li>14 sous-titre non trouvés</li>
</ul>
<p>Lors de la deuxième exécution</p>
<p><br class="spacer_" /></p>
<p style="font-weight: bold; font-style: italic; text-decoration: underline;">Sources :</p>
<p><a href="http://johnbokma.com/mexit/2010/03/15/">Fixing subdl 1.0.2</a></p>
<p>Image par <a href="http://www.flickr.com/photos/aussiegall/"><strong>aussiegall</strong></a> sous CC</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/corriger-subdl-script-de-telechargement-automatique-de-sous-titres/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recevoir un email de notification lorsque flexget télécharge un nouvel épisode de série</title>
		<link>http://voidandany.free.fr/index.php/recevoir-un-email-de-notification-lorsque-flexget-telecharge-un-nouvel-episode-de-serie/</link>
		<comments>http://voidandany.free.fr/index.php/recevoir-un-email-de-notification-lorsque-flexget-telecharge-un-nouvel-episode-de-serie/#comments</comments>
		<pubDate>Thu, 06 May 2010 15:27:23 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[flexget]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[serie]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=2107</guid>
		<description><![CDATA[Dans l&#8217;article Téléchargement automatisé de séries avec Flexget, j&#8217;ai décrit l&#8217;installation et la configuration &#171;&#160;de base&#160;&#187; de flexget. Mais il existe une autre configuration optionnelle mais bien pratique, celle consistant à recevoir un email dès que flexget télécharge un nouveau &#8230; <a href="http://voidandany.free.fr/index.php/recevoir-un-email-de-notification-lorsque-flexget-telecharge-un-nouvel-episode-de-serie/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/biscotte/60963915/"><img class="alignleft size-medium wp-image-2118" style="margin-left: 10px; margin-right: 10px;" title="Email" src="http://voidandany.free.fr/wp-content/uploads/Email-60963915_7146709e9c-225x300.jpg" alt="" width="225" height="300" /></a>Dans l&#8217;article  <a title="Téléchargement automatisé de séries avec Flexget" rel="bookmark" href="../index.php/telechargement-automatise-de-series-avec-flexget-torrents/">Téléchargement  automatisé de séries avec Flexget</a>, j&#8217;ai décrit l&#8217;installation et la configuration &laquo;&nbsp;de base&nbsp;&raquo; de flexget.</p>
<p>Mais il existe une autre configuration optionnelle mais bien pratique, celle consistant à recevoir un email dès que flexget télécharge un nouveau fichier torrent/épisode.</p>
<p><br class="spacer_" /></p>
<p>L&#8217;email reçu aura le format suivant :</p>
<p>Sujet :</p>
<pre>[FlexGet] &lt;nom du flux&gt; : 2 new entries downloaded</pre>
<p><br class="spacer_" /></p>
<p>Corps du mail :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Hi,
&nbsp;
FlexGet has just downloaded <span style="color: #000000;">2</span> new entries <span style="color: #000000; font-weight: bold;">for</span> feed <span style="color: #000000; font-weight: bold;">&lt;</span>nom <span style="color: #c20cb9; font-weight: bold;">du</span> flux<span style="color: #000000; font-weight: bold;">&gt;</span> :
&nbsp;
- Serie A 5x21 <span style="color: #7a0874; font-weight: bold;">&#40;</span>HDTV-LOL<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>VTV<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">&lt;</span>adresse <span style="color: #c20cb9; font-weight: bold;">du</span> torrent<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>torrentfiles <span style="color: #7a0874; font-weight: bold;">&#40;</span>Serie.A.S05E21.HDTV.XviD-LOL.<span style="color: #7a0874; font-weight: bold;">&#91;</span>VTV<span style="color: #7a0874; font-weight: bold;">&#93;</span>.torrent<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
- Serie B S02E07 HDTV XviD-LOL <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">&lt;</span>adresse <span style="color: #c20cb9; font-weight: bold;">du</span> torrent<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> =<span style="color: #000000; font-weight: bold;">&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>torrentfiles <span style="color: #7a0874; font-weight: bold;">&#40;</span>Serie.B.S02E07.HDTV.XviD-LOL.torrent<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p><br class="spacer_" /></p>
<p>La configuration de l&#8217;email se fait très simplement en ajoutant/créant une section preset global :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">presets:
  global:
    email:
      from: <span style="color: #7a0874; font-weight: bold;">&#91;</span>adresse email expediteur<span style="color: #7a0874; font-weight: bold;">&#93;</span>
      to:
        - <span style="color: #7a0874; font-weight: bold;">&#91;</span>adresse email destinataire <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
        - <span style="color: #7a0874; font-weight: bold;">&#91;</span>adresse email destinataire <span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
      smtp_host: <span style="color: #7a0874; font-weight: bold;">&#91;</span>serveur SMTP<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p><br class="spacer_" /></p>
<p>Cette configuration est la configuration minimal pour un serveur SMTP ne gérant pas d&#8217;authentification comme celui de Free.fr (cf. <a title="Utiliser le serveur SMTP de Free avec sSMTP" rel="bookmark" href="../index.php/utiliser-le-serveur-smtp-de-free-avec-ssmtp/">Utiliser  le serveur SMTP de Free avec sSMTP)</a></p>
<p><br class="spacer_" /></p>
<p>Pour gmail il faudra :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">presets:
  global:
    email:
      from: <span style="color: #7a0874; font-weight: bold;">&#91;</span>user gmail<span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #000000; font-weight: bold;">@</span>gmail.com
      to:
        - <span style="color: #7a0874; font-weight: bold;">&#91;</span>adresse email destinataire <span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
        - <span style="color: #7a0874; font-weight: bold;">&#91;</span>adresse email destinataire <span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
      smtp_host: smtp.gmail.com
      smtp_port: <span style="color: #000000;">587</span>
      smtp_login: <span style="color: #c20cb9; font-weight: bold;">true</span>
      smtp_username: <span style="color: #7a0874; font-weight: bold;">&#91;</span>user gmail<span style="color: #7a0874; font-weight: bold;">&#93;</span>
      smtp_password: <span style="color: #7a0874; font-weight: bold;">&#91;</span>mot de passe gmail<span style="color: #7a0874; font-weight: bold;">&#93;</span>
      smtp_tls: <span style="color: #c20cb9; font-weight: bold;">true</span></pre></div></div>

<p><br class="spacer_" /></p>
<p style="font-weight: bold; font-style: italic; text-decoration: underline;">Sources :</p>
<p>Wiki Flexget : <a href="http://flexget.com/wiki/Plugins/email">http://flexget.com/wiki/Plugins/email</a></p>
<p>Images par <a href="http://www.flickr.com/photos/biscotte/"><strong>Mzelle  Biscotte</strong></a> sous CC BY-SA</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/recevoir-un-email-de-notification-lorsque-flexget-telecharge-un-nouvel-episode-de-serie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Téléchargement automatisé de séries avec Flexget</title>
		<link>http://voidandany.free.fr/index.php/telechargement-automatise-de-series-avec-flexget-torrents/</link>
		<comments>http://voidandany.free.fr/index.php/telechargement-automatise-de-series-avec-flexget-torrents/#comments</comments>
		<pubDate>Thu, 06 May 2010 13:46:27 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[deluge]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[flexget]]></category>
		<category><![CDATA[serie]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=1945</guid>
		<description><![CDATA[&#60;Avertissement&#62; Cet article démontre la faisabilité d&#8217;automatiser le téléchargement de séries et explique la mise en œuvre de Flexget. Il n&#8217;est en aucune façon une incitation au téléchargement. &#60;/Avertissement&#62; Cet article est la mise à jour de l&#8217;article Flexget : &#8230; <a href="http://voidandany.free.fr/index.php/telechargement-automatise-de-series-avec-flexget-torrents/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/nrkbeta/2305831708/"><img class="alignleft size-medium wp-image-2098" style="margin-left: 10px; margin-right: 10px;" title="Download" src="http://voidandany.free.fr/wp-content/uploads/download_2305831708_435f4081a3-300x199.jpg" alt="" width="300" height="199" /></a></p>
<p style="font-weight: bold; font-style: italic; color: red;">&lt;Avertissement&gt;</p>
<p>Cet article démontre la faisabilité d&#8217;automatiser le téléchargement de séries et explique la mise en œuvre de Flexget.</p>
<p><span style="font-weight: bold;">Il n&#8217;est en aucune façon une incitation au téléchargement</span>.</p>
<p style="font-weight: bold; font-style: italic; color: red;">&lt;/Avertissement&gt;</p>
<p><br class="spacer_" /></p>
<p>Cet article est la mise à jour de l&#8217;article <a title="Flexget : téléchargement automatique de torrents" rel="bookmark" href="../index.php/flexget-telechargement-automatique-de-torrents/">Flexget  : téléchargement automatique de torrents</a>, il se propose de décrire l&#8217;<span style="font-weight: bold;">installation et la configuration de flexget</span> pour surveiller un flux RSS et y télécharger le fichier torrent associé à une/des séries paramétré(s).</p>
<p>Ce mécanisme associé avec un client torrent permettant la surveillance d&#8217;un répertoire pour le démarrage automatique des téléchargement, permet d&#8217;automatiser la récupération de série télé au fur et à mesure de leur diffusion.</p>
<p><br class="spacer_" /></p>
<h2>Présentation de Flexget</h2>
<p>Flexget se base sur divers  sources de données, le script traite cette source, filtre son contenu et produit une sortie.</p>
<p>Flexget est entièrement configurable via un fichier de configuration où l&#8217;on défini le/les plugins à utiliser pour la source, le traitement et la sortie</p>
<p>Pour exemple voici quelques plugins (<a href="http://flexget.com/wiki/Plugins">liste complète des plugins flexget</a>) :</p>
<ul>
<li>Plugins sources : csv, html, rss, etc.</li>
<li>Plugins de filtre : serie, imdb, etc.</li>
<li>Plugins de sortie : dowload, deluge, email, etc.</li>
</ul>
<p>Dans la cas du sujet de cet article, les plugins utilisés pour télécharger un fichier torrent seront :</p>
<p style="font-style: italic; padding-left: 30px;">rss, serie, download, email</p>
<p><br class="spacer_" /></p>
<h2>Installation de Flexget</h2>
<p>En version 0.9 l&#8217;installation se résumait à une simple décompression d&#8217;une archive zip, depuis la version 1.0, il est fournis un package egg qui contient le programme mais qui gère aussi les dépendances.</p>
<p><br class="spacer_" /></p>
<p>Pour prendre en charge les <span style="font-weight: bold;">packages python egg</span>, il faut que le programme easy_install soit installé pour cela :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> python-setuptools</pre></div></div>

<p><br class="spacer_" /></p>
<p>On <span style="font-weight: bold;">télécharge </span>la dernière version du fichier egg sur le<a href="http://flexget.com/"> site Flexget</a> puis on l&#8217;<span style="font-weight: bold;">installe </span>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> easy_install FlexGet-1.0r1197-py2.6.egg</pre></div></div>

<p><br class="spacer_" /></p>
<p>On peut simplement tester que l&#8217;installation s&#8217;est correctement effectuée par :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">flexget <span style="color: #660033;">-V</span></pre></div></div>

<p>Qui devrait donner la version installée :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">FlexGet 1.0r1197</pre></div></div>

<p><br class="spacer_" /></p>
<h2>Configuration</h2>
<p>Par défaut flexget charge sa configuration d&#8217;un fichier <span style="font-weight: bold;">config.yml </span>dans le répertoire .flexget du répertoire home de l&#8217;utilisateur l&#8217;exécutant.</p>
<p>Il est tout fait possible de réaliser cette configuration dans un autre fichier, mais dès lors il faudra indique le nom et chemin de ce fichier dans la ligne de commande.</p>
<p><br class="spacer_" /></p>
<p>Le fichier de configuration doit respecter le formalisme du <span style="font-weight: bold;">langage YAML</span> (<a href="http://fr.wikipedia.org/wiki/YAML">lien Wikipédia</a>), où la hiérarchisation des données se fait via des doubles espaces, en aucun façon un fichier yml doit avoir des tabulation.</p>
<p>(Pour faciliter l&#8217;édition de ce genre de fichier on pourra utiliser VIM avec le paramétrage indiqué ici<a title="Afficher les caractères invisibles dans VIM" rel="bookmark" href="../index.php/afficher-les-caracteres-invisibles-dans-vim/"> Afficher  les caractères invisibles dans VIM</a>)<a title="Afficher les caractères invisibles dans VIM" rel="bookmark" href="../index.php/afficher-les-caracteres-invisibles-dans-vim/"><br />
 </a></p>
<p><br class="spacer_" /></p>
<p>Lors du passage à la version 1.0 de Flexget, le format du fichier de configuration à été complétement revu.</p>
<p><br class="spacer_" /></p>
<p>Prenons un <span style="font-weight: bold;">exemple simple</span> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">feeds:
  Series_torrent:
    rss: <span style="color: #7a0874; font-weight: bold;">&#91;</span>URL flux RSS<span style="color: #7a0874; font-weight: bold;">&#93;</span>
    series:
      - Une belle Serie
      - Une autre serie
    download: ~<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>torrentfiles</pre></div></div>

<p>La configuration doit contenir au moins un conteneur feed qui possède en son sein autant de flux (RSS ou autre) que voulu</p>
<p>Chaque flux est nommé via un texte libre (ici Serie_torrent) et contient la définition/configuration des plugins à utiliser par le flux.</p>
<p>Chaque flux utilise couramment 3 plugins :</p>
<ul>
<li>1 plugin source : <span style="font-weight: bold;">rss </span>pour lequel on indique l&#8217;adresse du flux RSS</li>
<li>1 plugin filtre : <span style="font-weight: bold;">serie</span>, ce plugin analyse le contenu de la source (le flux RRS) et ne retient dans ce flux que les entrées dont le nom correspond à une des séries indiqués (ici &laquo;&nbsp;une belle serie&nbsp;&raquo; et &laquo;&nbsp;une autre serie&nbsp;&raquo;)</li>
<li>1 plugin de sortie : <span style="font-weight: bold;">download</span>, ce plugin télécharge le fichier torrent associé avec les séries filtrés dans le répertoire indiqué</li>
</ul>
<p><br class="spacer_" /></p>
<p>Le <span style="font-weight: bold;">plugin serie</span>, est très puissant :</p>
<ul>
<li> Il gère le multiple format  de nom que peut avoir une série : &laquo;&nbsp;Une belle Serie&nbsp;&raquo; ou &laquo;&nbsp;Une.belle.Serie&nbsp;&raquo; ou &laquo;&nbsp;une belle serie&nbsp;&raquo;</li>
<li>Il gère les repost d&#8217;un épisode, il compris si le nom change, ainsi si l&#8217;épisode &laquo;&nbsp;Une.belle.Serie.S01E10.LOL&nbsp;&raquo; à été téléchargé et que quelques heures plus tard, l&#8217;épisode est reposté par une autre team &laquo;&nbsp;Une.belle.Serie.S01E10.titre.de.l&#8217;episode.VQM&nbsp;&raquo; ce dernier ne sera pas re-téléchargé</li>
<li>Il gère les repost pour cause de proper/repack (c&#8217;est à dire qu&#8217;un épisode est re-posté car la première version avait un problème) en re-téléchargeant l&#8217;épisode</li>
<li>Il existe des options pour ne télécharger préférentiellement les épisode répondant à une qualité donné.</li>
</ul>
<p>Voir les autres caractéristiques ici : <a href="http://flexget.com/wiki/Plugins/series">http://flexget.com/wiki/Plugins/series</a></p>
<p><br class="spacer_" /></p>
<p>Autre exemple utilisant la notion de <a style="font-weight: bold;" href="http://flexget.com/wiki/Plugins/series#Quality">qualité</a><span style="font-weight: bold;"> de l&#8217;épisode</span> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">feeds:
  Series_torrent:
    rss: <span style="color: #7a0874; font-weight: bold;">&#91;</span>URL flux RSS<span style="color: #7a0874; font-weight: bold;">&#93;</span>
    series:
      Series_qualite:
        - Une belle Serie
            timeframe: <span style="color: #000000;">3</span> hours
            quality: hdtv
        - Une autre Serie
            timeframe: <span style="color: #000000;">3</span> hours
            quality: hdtv
    download: ~<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>torrentfiles</pre></div></div>

<p>La  qualité est définie par le mot clé quality qui peut prendre les  valeurs suivantes :</p>
<p style="font-style: italic; padding-left: 30px;">1080p, 1080, 720p, 720, hr, dvd, hdtv, pdtv, dsr,  dsrip</p>
<p><br class="spacer_" /></p>
<p>Le mot-clé <a href="http://flexget.com/wiki/Plugins/series#Timeframe">timeframe</a> indique que lorsqu&#8217;un nouvel épisode est trouvé  et que celui-ci ne satisfait pas aux critères de qualité, on ne le  télécharge pas tout de suite mais on attend le temps spécifié afin de  s&#8217;assurer qu&#8217;un nouveau post avec la qualité voulu arrive.</p>
<p><br class="spacer_" /></p>
<p>Il faut définir ces options pour chaque séries, à moins d&#8217;utiliser la<span style="font-weight: bold;"> notion de </span><a style="font-weight: bold;" href="http://flexget.com/wiki/Plugins/series#Groupsettings">groupe </a>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">feeds:
  Series_torrent:
    rss: <span style="color: #7a0874; font-weight: bold;">&#91;</span>URL flux RSS<span style="color: #7a0874; font-weight: bold;">&#93;</span>
    series:
      settings:
        Series_qualite:
          timeframe: <span style="color: #000000;">3</span> hours
          quality: hdtv
      Series_qualite:
        - Une belle Serie
        - Une autre Serie
    download: ~<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>torrentfiles</pre></div></div>

<p>On utilise ici les options de qualités et la notion de groupe.</p>
<p>Less options timeframe et quality sont définies dans un groupe que l&#8217;on peut nommer comme on le souhaite (ici Serie_qualite) l, lui-même défini dans un &laquo;&nbsp;noeud&nbsp;&raquo; settings</p>
<p>Le nom du groupe est ensuite réutilisé pour définir les séries sur lesquelles les option doivent s&#8217;appliquer.</p>
<p><br class="spacer_" /></p>
<p>On peut ainsi définir <span style="font-weight: bold;">plusieurs groupes</span> pour des séries différentes :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">feeds:
  Series_torrent:
    rss: <span style="color: #7a0874; font-weight: bold;">&#91;</span>URL flux RSS<span style="color: #7a0874; font-weight: bold;">&#93;</span>
    series:
      settings:
        Series_hdtv:
          timeframe: <span style="color: #000000;">3</span> hours
          quality: hdtv
        Series_1080:
          timeframe: <span style="color: #000000;">3</span> hours
          quality: 1080p
      Series_1080:
        - Une belle Serie
      Series_hdtv:
        - Une autre serie
    download: ~<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>torrentfiles</pre></div></div>

<p><br class="spacer_" /></p>
<p>Nous avons ici 2 groupes pour 2 niveaux de qualité (hdtv et 1080p), la série &laquo;&nbsp;Une belle serie&nbsp;&raquo; sera donc téléchargée en favorisant le niveau de qualité 1080p tandis que la série &laquo;&nbsp;une autre serie&nbsp;&raquo; elle sera téléchargée en qualité hdtv.</p>
<p><br class="spacer_" /></p>
<p>Toujours plus compliqué, si on dispose de plusieurs sources de données il faudra redéfinir les groupes dans chacun des flux, sauf si on utilise la<span style="font-weight: bold;"> notion de </span><a style="font-weight: bold;" href="http://flexget.com/wiki/Plugins/preset">preset</a><span style="font-weight: bold;"> </span>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">presets:
  tv:
    download: ~<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>torrentfiles
    series:
      settings:
        Serie_hdtv:
          timeframe: <span style="color: #000000;">4</span> hours
          quality: hdtv
      Serie_hdtv:
        - Dexter
        - Dollhouse
&nbsp;
feeds:
  Series_flux_1:
    rss: <span style="color: #7a0874; font-weight: bold;">&#91;</span>URL <span style="color: #c20cb9; font-weight: bold;">du</span> flux RSS n°<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
    preset: tv
&nbsp;
  Series_flux_2:
    rss: <span style="color: #7a0874; font-weight: bold;">&#91;</span>URL <span style="color: #c20cb9; font-weight: bold;">du</span> flux RSS n°<span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#93;</span>
    preset: tv</pre></div></div>

<p><br class="spacer_" /></p>
<h2>Test</h2>
<p>Lorsque l&#8217;on a fait son fichier de configuration il faut le tester, pour cela il existe un mode test :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">flexget <span style="color: #660033;">-c</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>fichier YML<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #660033;">--test</span> <span style="color: #660033;">-v</span></pre></div></div>

<p><br class="spacer_" /></p>
<p>L&#8217;option &laquo;&nbsp;-c&nbsp;&raquo; est facultative si vous avez fait votre configuration dans le fichier /.flexget/config.yml</p>
<p>L&#8217;option &laquo;&nbsp;-v&nbsp;&raquo; indique à flexget qu&#8217;il doit afficher le détail des opérations qu&#8217;il réalise (pratique pour comprendre son fonctionnement, ses choix, débugger sa configuration)</p>
<p><br class="spacer_" /></p>
<p>La sortie de cette commande sera du type :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">2010</span>-03-<span style="color: #000000;">15</span> <span style="color: #000000;">22</span>:08 INFO     manager                       Test mode,  creating a copy from database ...
<span style="color: #000000;">2010</span>-03-<span style="color: #000000;">15</span> <span style="color: #000000;">22</span>:08 INFO     manager                       Test database  created
<span style="color: #000000;">2010</span>-03-<span style="color: #000000;">15</span> <span style="color: #000000;">22</span>:08 INFO     feed          Series_torrent  Produced <span style="color: #000000;">20</span>  entries.
...
+ filter   seen         Rejected Serie A S06E17 PROPER  HDTV XviD-2HD
+ filter   seen         Rejected Serie B S06E07 HDTV XviD-FQM
...
+ filter   series       Rejected Serie A  S06E17 HDTV  XviD-XII <span style="color: #7a0874; font-weight: bold;">&#40;</span>already downloaded<span style="color: #7a0874; font-weight: bold;">&#41;</span>
+ filter   series       Rejected Serie B S06E01 HDTV XviD-P0W4 <span style="color: #7a0874; font-weight: bold;">&#40;</span>already  downloaded<span style="color: #7a0874; font-weight: bold;">&#41;</span>
...
+ filter   series       Accepted Serie A  S06E20 HDTV XviD-2HD <span style="color: #7a0874; font-weight: bold;">&#40;</span>quality met, timeframe unnecessary<span style="color: #7a0874; font-weight: bold;">&#41;</span>
+ filter   series       Accepted Serie A  S06E21 HDTV XviD-2HD <span style="color: #7a0874; font-weight: bold;">&#40;</span>quality met, timeframe unnecessary<span style="color: #7a0874; font-weight: bold;">&#41;</span>
...
<span style="color: #000000;">2010</span>-03-<span style="color: #000000;">15</span> <span style="color: #000000;">22</span>:08 INFO     feed          Series_torrent  Accepted: <span style="color: #000000;">0</span>  <span style="color: #7a0874; font-weight: bold;">&#40;</span>Rejected: <span style="color: #000000;">18</span> Undecided: <span style="color: #000000;">2</span> Failed: <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
...
<span style="color: #000000;">2010</span>-03-<span style="color: #000000;">15</span> <span style="color: #000000;">22</span>:08 INFO     download      Series_torrent  Would download: Serie A S06E20 HDTV XviD-2HD
<span style="color: #000000;">2010</span>-03-<span style="color: #000000;">15</span> <span style="color: #000000;">22</span>:08 INFO     download      Series_torrent  Would download: Serie A S06E21 HDTV XviD-2HD
...
<span style="color: #000000;">2010</span>-03-<span style="color: #000000;">15</span> <span style="color: #000000;">22</span>:08 INFO     download      Series_torrent  Would <span style="color: #c20cb9; font-weight: bold;">write</span>: Serie A S06E20 HDTV XviD-2HD
<span style="color: #000000;">2010</span>-03-<span style="color: #000000;">15</span> <span style="color: #000000;">22</span>:08 INFO     download      Series_torrent  Would <span style="color: #c20cb9; font-weight: bold;">write</span>: Serie A S06E21 HDTV XviD-2HD
...
+ undecided              Serie C S04E19 HDTV XviD-LOL
+ undecided              Serie C S04E18 HDTV XviD-LOL
...
<span style="color: #000000;">2010</span>-03-<span style="color: #000000;">15</span> <span style="color: #000000;">22</span>:08 INFO     manager                       Removed <span style="color: #7a0874; font-weight: bold;">test</span>  database</pre></td></tr></table></div>

<p><br class="spacer_" /></p>
<p>Ligne 1-2 : on voit que l&#8217;on est en test puisque flexget créé une base de données de test (dans il stock les séries déjà téléchargés, entre autre)</p>
<p>Ligne  3 : le nombre d&#8217;entrées (épisodes) détecté dans le flux</p>
<p>Ligne 5-6 : les entrées rejetées car déjà présente lors du lancement de flexget précédent</p>
<p>Ligne 8-9 : les entrées rejetés car l&#8217;épisode à déjà été téléchargé (repost d&#8217;un épisode par une autre team)</p>
<p>Lignes 11-12 : les entrées acceptées</p>
<p>Lignes 14 : récapitulatif des traitements</p>
<p>Lignes 16-17, 19-20 : Les 2 entrées acceptées, sont téléchargées et le fichiers est écrit sur le disque</p>
<p>Lignes 22-23 : des entrées/épisodes trouvés dans le flux RSS, mais la série correspondante n&#8217;est pas configurée</p>
<p>Linge 25 : purge de la base de test.</p>
<p><br class="spacer_" /></p>
<h2>Exécution et plannification</h2>
<p>Le moyen le plus efficace d&#8217;utiliser flexget est de le <span style="font-weight: bold;">plannifier via Cron</span> :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">flexget <span style="color: #660033;">-c</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>fichier YML<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #660033;">--cron</span></pre></div></div>

<p><br class="spacer_" /></p>
<p>L&#8217;option &laquo;&nbsp;&#8211;cron&nbsp;&raquo; indique que l&#8217;on est dans le cas d&#8217;une utilisation en batch, ce qui pour conséquence de désactiver l&#8217;affichage des logs sur la sortie standard, de les rediriger vers un fichier de log et de diminuer la verbosité de ces dernières.</p>
<p><br class="spacer_" /></p>
<p>Attention lors de la plannification cron à mettre un interval d&#8217;exécution du job en adéquation avec le paramétrage du timeframe.</p>
<p>Si votre tache s&#8217;exécute toutes les 3 heures mais que votre timeframe est de 4 heures</p>
<p>Exécution 1 : un épisode ne satisfait pas le niveau de qualité, flexget doit attendre 4 heure avant de s&#8217;en satisfaire.</p>
<p>L&#8217;exécution  suivante (n°2) arrive 3h après, si l&#8217;épisode de bonne qualité n&#8217;existe toujours pas, flexget ne fait rien.</p>
<p>L&#8217;exécution  suivante (n°3) arrive 3h après, soit 6h après la première, c&#8217;est uniquement à ce moment que flexget téléchargera l&#8217;épisode de qualité moindre.</p>
<p>En soi ce n&#8217;est pas grave mais le paramétrage n&#8217;est pas optimal, on préférera mettre un timeframe de 3 ou 6h.</p>
<p><br class="spacer_" /></p>
<h2>Utilisation conjointe avec un client Torrent</h2>
<p>Flexget se contente de télécharger le fichier torrent, mais il ne télécharge par la vidéo, pour ce faire il suffit d&#8217;avoir un client torrent prenant en charge la surveillance d&#8217;un répertoire.</p>
<p>En paramétrant le client torrent pour qu&#8217;il surveille le répertoire dans lequel flexget télécharge les fichier torrent, le téléchargement démarre de façon automatique.</p>
<p><br class="spacer_" /></p>
<p style="text-align: center;"><a href="http://voidandany.free.fr/wp-content/uploads/Serie-Workflow.png"><img class="size-medium wp-image-2111 aligncenter" title="Serie Workflow" src="http://voidandany.free.fr/wp-content/uploads/Serie-Workflow-300x252.png" alt="" width="300" height="252" /></a></p>
<p>Dans Deluge ce paramétrage se fait en renseignant le paramètre &laquo;&nbsp;autoadd .torrent files from&nbsp;&raquo; :</p>
<p style="text-align: center;"><a href="http://voidandany.free.fr/wp-content/uploads/2010-01-12_1709551.png"><img class="size-medium wp-image-1623 aligncenter" title="Deluge WebUI - downloads" src="http://voidandany.free.fr/wp-content/uploads/2010-01-12_1709551-290x300.png" alt="" width="290" height="300" /></a></p>
<p>Cf.<a title="Configuration du client torrent Deluge via  l’interface WebUI" rel="bookmark" href="../index.php/configuration-du-client-torrent-deluge-via-linterface-webui/"> Configuration du client torrent Deluge via  l’interface WebUI</a></p>
<p><br class="spacer_" /></p>
<p style="font-weight: bold; font-style: italic; text-decoration: underline;">Remarque :</p>
<p>Flexget dispose d&#8217;un plugin <a href="http://flexget.com/wiki/Plugins/deluge">deluge</a> permettant  de piloter directement Deluge de façon assez puissante, je n&#8217;ai pas  encore pris le temps de m&#8217;y pencher..</p>
<p><br class="spacer_" /></p>
<h2>Méthode certifiée Hadopi proof</h2>
<p>L&#8217;utilisation des protocoles P2P, dont fait partie Bittorrent n&#8217;est pas du tout Hadopi compatible (mais bon Hadopi n&#8217;est pas encore arrivé), par contre les newsgroups eux le sont (pour l&#8217;instant)</p>
<p>Et fort heureusement Flexget dispose d&#8217;un plugin <a href="http://flexget.com/wiki/Plugins/sabnzbd">sabnzbd</a> qui peut piloter<a href="http://sabnzbd.org/"><em> SABnzbd</em>, un client de newsgroup.<br />
 </a></p>
<p>Bref à garder sous coude pour dans quelques mois (peut être)</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p style="font-weight: bold; font-style: italic; text-decoration: underline;">Sources :</p>
<p>Le wiki de flexget : <a href="http://flexget.com/wiki">http://flexget.com/wiki</a></p>
<p><a href="http://havetheknowhow.com/Install-the-software/Sample-FlexGet-Config-File.html">Sample FlexGet config.yml file for Deluge</a></p>
<p><a href="http://blog.niamu.com/automating-home-entertainment/">Automating Home Entertainment • Niamu by Brendon Walsh</a></p>
<p><a href="http://1000umbrellas.com/2010/04/23/how-to-configure-flexget-on-ubuntu-server">How to Configure FlexGet to Automatically Download TV Torrents on Ubuntu 10.04 Lucid Lynx Server &#8211; 1000umbrellas.com</a></p>
<p>Image par <a href="http://www.flickr.com/photos/nrkbeta/"><strong>nrkbeta</strong></a></p>
<p><strong><br />
 </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/telechargement-automatise-de-series-avec-flexget-torrents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subdl &#8211; Téléchargement automatique des sous-titres</title>
		<link>http://voidandany.free.fr/index.php/subdownload-telechargement-automatique-des-sous-titres/</link>
		<comments>http://voidandany.free.fr/index.php/subdownload-telechargement-automatique-des-sous-titres/#comments</comments>
		<pubDate>Sat, 25 Apr 2009 08:44:58 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[serie]]></category>
		<category><![CDATA[sous-titres]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=185</guid>
		<description><![CDATA[Edit 26/07/2010 : Le logiciel subdl n&#8217;étant plus maintenu et le site n&#8217;existant plus, les informations ci-dessous ne sont plus correctes, si quelqu&#8217;un est intéressé je peux héberger le script Toujours dans la série de l&#8217;automatisation des taches, voici comment &#8230; <a href="http://voidandany.free.fr/index.php/subdownload-telechargement-automatique-des-sous-titres/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight: bold; font-style: italic;">Edit 26/07/2010 :</span> Le logiciel subdl n&#8217;étant plus maintenu et le site n&#8217;existant plus, les informations ci-dessous ne sont plus correctes, si quelqu&#8217;un est intéressé je peux héberger le script</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Toujours dans la série de l&#8217;automatisation des taches, voici comment faire pour récupérer de façon automatique les sous-titres des différents épisode d&#8217;une série.</p>
<p>Le tout évidemment sans aucune intervention ni interface graphique.</p>
<p><br class="spacer_" /></p>
<p>Pour cela j&#8217;ai utilisé un script python <a href="http://www.cubewano.org/subdl" target="_blank">Subdl</a>.</p>
<p><br class="spacer_" /></p>
<p>Ce script prend en paramètre le nom du fichier dont on veut trouver les sous-titre, calcul une clé hash identifiant ce fichier et fait une requête sur le site  <a href="http://www.opensubtitles.org" target="_blank">openSubtitle</a>.</p>
<p>Si plusieurs fichiers de sous-titres sont trouvé pour la langue voulu, subdl télécharge celui qui à la meilleur note.</p>
<p>Subdl renomme aussi le fichier de sous-titres pour lui donner le même nom que le fichier vidéo correspondant.</p>
<p><br class="spacer_" /></p>
<h3>Installation</h3>
<p>Vu qu&#8217;il s&#8217;agit d&#8217;un script l&#8217;installation est super simple, il suffit de <strong>télécharger l&#8217;archive</strong> contenant le script :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.cubewano.org<span style="color: #000000; font-weight: bold;">/</span>subdl<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>1.0.2<span style="color: #000000; font-weight: bold;">/</span>subdl-1.0.2.tar.gz</pre></div></div>

<p><br class="spacer_" /></p>
<p>Comme on peut le constater cette version date de plus d&#8217;un an mais elle fonctionne parfaitement.</p>
<p><br class="spacer_" /></p>
<p>On <strong>extrait</strong> ensuite le script :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> -xvf subdl-1.0.2.tar.gz</pre></div></div>

<p><br class="spacer_" /></p>
<p>Et voila.</p>
<p><br class="spacer_" /></p>
<h3>Utilisation</h3>
<p>Subdl à besoin de 2 paramètres :</p>
<ul>
<li>la langue pour laquelle on cherche des sous-titres</li>
<li>le fichier dont on cherche les sous-titres</li>
</ul>
<p><br class="spacer_" /></p>
<p>On ajoutera un paramètre supplémentaire indiquant le comportement à adopter si le fichier de sous-titres existe déjà (on passe)</p>
<p><br class="spacer_" /></p>
<p>Ce qui donne :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">python subdl <span style="color: #660033;">--lang</span>=fre <span style="color: #660033;">--existing</span>=bypass mon_fichier.avi</pre></div></div>

<p><br class="spacer_" /></p>
<p><strong>Bonus</strong> :</p>
<p>Voici une ligne de commande qui lance la recherche des sous-titres sur tous les fichier avi d&#8217;un répertoire :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #000000; font-weight: bold;">*</span>.avi <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #660033;">-t</span> <span style="color: #660033;">-I</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> python ~<span style="color: #000000; font-weight: bold;">/</span>subdl<span style="color: #000000; font-weight: bold;">/</span>subdl <span style="color: #660033;">--lang</span>=fre <span style="color: #660033;">--existing</span>=bypass <span style="color: #7a0874; font-weight: bold;">&#123;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span> </pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h3>Alternative</h3>
<p>Il existe un autre outil ligne de commande pour télécharger de façon automatique des sous-titres en utilisant les service de openSubtitle.org, il s&#8217;agit de <a href="http://subdownloader.net/" target="_blank">Subdownloader</a>.</p>
<p><br class="spacer_" /></p>
<p>Ce dernier est plus complet puisqu&#8217;il propose une interface graphique en plus de la ligne de commande, il est disponible sous forme de paquet Debian installant ainsi toutes les dépendances nécessaires.</p>
<p>(Rque : il est aussi disponible sous Windows et Mac !!)</p>
<p><br class="spacer_" /></p>
<p>Bref il est plus complet mais aussi beaucoup plus lourd (gros).</p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/subdownload-telechargement-automatique-des-sous-titres/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flexget : téléchargement automatique de torrents</title>
		<link>http://voidandany.free.fr/index.php/flexget-telechargement-automatique-de-torrents/</link>
		<comments>http://voidandany.free.fr/index.php/flexget-telechargement-automatique-de-torrents/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 11:14:21 +0000</pubDate>
		<dc:creator>voidAndAny</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[serie]]></category>

		<guid isPermaLink="false">http://voidandany.free.fr/?p=150</guid>
		<description><![CDATA[Edit 6/05/2010 : Si vous utilisez Flexget v1.0x, cet article est osolète, se référer à  Téléchargement automatisé de séries avec Flexget Avertissement : Le but de ce post est de montrer comment il est possible d&#8217;automatiser le téléchargement de torrents. &#8230; <a href="http://voidandany.free.fr/index.php/flexget-telechargement-automatique-de-torrents/">Continuer la lecture <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Edit 6/05/2010 : Si vous utilisez Flexget v1.0x, cet article est osolète, se référer à <a title="Téléchargement automatisé de séries avec Flexget" rel="bookmark" href="../index.php/telechargement-automatise-de-series-avec-flexget-torrents/"><span style="font-weight: bold;"> </span>Téléchargement  automatisé de séries avec Flexget</a></p>
<div>
<div></div>
</div>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p style="border: #ff0000 thin solid;"><span style="color: #ff0000;"><strong>Avertissement : </strong></span></p>
<p>Le but de ce post est de montrer comment il est possible d&#8217;automatiser le téléchargement de torrents. Ce n&#8217;est en aucun cas l&#8217;apologie du piratage.</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Cet avertissement effectué passons à la description du problème.</p>
<p>Comment faire pour automatiser le téléchargement de séries via un flux RSS ?</p>
<p>Au moment où j&#8217;ai mis ce système en place la version de Deluge utilisé ne permettait pas de s&#8217;abonner à un flux RSS. J&#8217;ai donc dû trouver une alternative qui à l&#8217;usage se révèle non seulement efficace mais aussi supérieure.</p>
<p><br class="spacer_" /></p>
<p>Cette alternative s&#8217;appelle <a href="http://flexget.com/" target="_blank">Flexget</a>.</p>
<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>La phrase d&#8217;introduction du site de Flexget décrit bien son usage et son rôle :</p>
<p><br class="spacer_" /></p>
<p>&laquo;&nbsp;FlexGet is a program aimed to automate downloading or processing content (torrents, podcasts, etc.) from different sources like RSS-feeds, html-pages, various sites and more. &laquo;&nbsp;</p>
<p><br class="spacer_" /></p>
<p>Soit grosso-modo en Français :</p>
<p><br class="spacer_" /></p>
<p>&laquo;&nbsp;Flexget est un programme ayant pour rôle d&#8217;automatiser le téléchargement ou le traitement de contenus (torrents, podcasts) à partir de différentes source comme les flux RSS, les pages HTML, de nombreux sites et plus encore&nbsp;&raquo;</p>
<p><br class="spacer_" /></p>
<p>Bref ce qu&#8217;il nous faut pour répondre à la problématique posée.</p>
<p>Flexget va à partir d&#8217;un flux RSS nous informant en quasi temps réél de la mise à disposition d&#8217;un torrent, télécharger ce même torrent.</p>
<p>Là où il surpasse les clients torrent ayant la capacité à s&#8217;abonner à ces même flux RSS, c&#8217;est qu&#8217;on pourra lui indiquer ses préférence (en terme de qualité de release) et qu&#8217;il ne téléchargera qu&#8217;un seul torrent pour un même épisode d&#8217;une même saison d&#8217;une série donnée.</p>
<p><br class="spacer_" /></p>
<p>En pré-requis il nous faut un flux RSS nous informant de la mise à disposition d&#8217;un torrent. Dnas le but de ne pas trop inciter au priatage je n&#8217;indiquerais volontairement pas ici où trouver ce genre de site&#8230;</p>
<p><br class="spacer_" /></p>
<h3>Installation de flexget</h3>
<p><br class="spacer_" /></p>
<p>Flexget à besoin du package permettant à Python de parser le YAML et de feedparser permettant de parser les flux RSS, on installera donc  :</p>
<p><br class="spacer_" /></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> python-yaml python-feedparser</pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<p>Téléchargement de la dernière version de flexget (la 0.9.3.2 dans mon cas) :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>download.flexget.com<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.9</span><span style="color: #000000; font-weight: bold;">/</span>FlexGet_0.9.3.2.zip</pre></div></div>

<p><br class="spacer_" /></p>
<p>Dézippage de l&#8217;archive téléchargée :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">unzip</span> FlexGet_0.9.3.2.zip</pre></div></div>

<p><br class="spacer_" /></p>
<p>Et voila flexget est installé, reste à le paramétrer.</p>
<p><br class="spacer_" /></p>
<h3>Paramétrage de flexget</h3>
<p><br class="spacer_" /></p>
<p>Le paramétrage se fait dans un fichier yml, ce dernier peut avoir le nom que l&#8217;on veut et être placé où l&#8217;on veut, dans mon cas ce fichier de configuration se nomme configFlexget.yml et est placé dans le répertoire de flexget (lui même dans le home de mon user).</p>
<p><br class="spacer_" /></p>
<p>Ouvrir le fichier et copier une configuration ressemblant à ceci :</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">global:
  download: ~<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>torrentfiles
&nbsp;
settings:
  series:
    timeframe:
      enough: hdtv
&nbsp;
feeds:
  Serie1:
    rss: http:<span style="color: #000000; font-weight: bold;">//</span>xxxxx.net<span style="color: #000000; font-weight: bold;">/</span>serie1.xml
    series:
      - Serie1
&nbsp;
   Serie2:
    rss: http:<span style="color: #000000; font-weight: bold;">//</span>xxxxx.net<span style="color: #000000; font-weight: bold;">/</span>serie2.xml
    series:
      - Serie2</pre></td></tr></table></div>

<p><br class="spacer_" /></p>
<p><strong><span style="text-decoration: underline;">Point important</span></strong> :</p>
<p>Le YML (ou YAML) est un language structuré (comme le XML) mais il est beaucoup moins verbeux (pas de balise ouvrante et fermante)</p>
<p>En contrepartie la hierarchie des éléments est réalisé via l&#8217;indentation à base d&#8217;espace (surtout pas de tabulation).</p>
<p>Il convient donc d&#8217;être très rigoureux sur l&#8217;edition des fichiers yml.</p>
<p><br class="spacer_" /></p>
<p>La <strong>section global</strong> permet comme son nom l&#8217;indique le paramètrage global de flexget quelque soit le plugin utilisé par la suite, elle sert uniquement à définir le répertoire où les téléchargements vont êtres stockés.</p>
<p>La ruse consiste ici à mettre le même chemin que celui paramétré dans Deluge paramètre &laquo;&nbsp;Auto Add folder&nbsp;&raquo; (cf. mon article <a href="http://voidandany.free.fr/index.php/installation-dun-client-torrent-deluge/" target="_blank">Installation d’un client torrent &#8211; Deluge</a>), ainsi flexget télécharge les torrents et Deluge commence automatiquement le téléchargement.</p>
<p><br class="spacer_" /></p>
<p><strong>Section settings</strong>, on met ici le paramétrage spécifique au plugins utilisés, dans le ca présent pour le plugin series il existe 2 paramètrages :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">&nbsp;</pre></div></div>

<ul>
<li>timeframe \ hour : pas utilisé encore mais ça ne devrait pas tarder. Cela permet d&#8217;indiquer à flexget qu&#8217;il faut attendre un certain temps entre la mise à disposition d&#8217;un torrent et son téléchargement. L&#8217;utilité : attendre qu&#8217;une nouvelle release soit disponible.</li>
<li>timeframe \enough : ce paramètre est l&#8217;une des force de Flexget, il indique quelle qualité de release est suffisante. Les valeurs possibles sont 1080p, 1080, 720p, 720, hr, dvd, hdtv, dsr, dsrip. Ainsi quand on a pas de télé HD il est inutile de télécharger du 1080p.</li>
</ul>
<p> </p>
<p>Vient ensuite la section de <strong>paramétrages</strong> de chacune des <strong>séries</strong> où l&#8217;on indique le nom de la série (Serie1) et le flux RSS associé.</p>
<p>Le paramètre feeds \ Serie1 \ series, qui a dans mon cas Series1 comme valeur, permet d&#8217;indiquer quelle est la série à télécharger dans le cas d&#8217;un flux recensant plusieurs séries.</p>
<p> </p>
<p>Et voila concernant mon paramétrage, il ne faut pas hésiter à aller sur le site de Flexget pour voir les nombreuses possibilités de ce logiciel (téléchargement de comics, génération de flux RSS) et plus particulièrement les autres paramétrage du <a href="http://flexget.com/wiki/FilterSeries" target="_blank">plugin serie</a></p>
<p> </p>
<p>Pour tester votr fichier de configuration :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>flexget.py <span style="color: #660033;">-c</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svc<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>flexget<span style="color: #000000; font-weight: bold;">/</span>configFlexGet.yml <span style="color: #660033;">--check</span></pre></div></div>

<p><br class="spacer_" /></p>
<p><br class="spacer_" /></p>
<h3>Exécution de flexget</h3>
<p><br class="spacer_" /></p>
<p>Pour exécuter flexget il suffit de faire :</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>flexget.py <span style="color: #660033;">-c</span> ~<span style="color: #000000; font-weight: bold;">/</span>flexget<span style="color: #000000; font-weight: bold;">/</span>configFlexGet.yml</pre></div></div>

<p>On peut alors evidemment ajouter cette ligne de commande dans une tache Cron&#8230;.</p>
<p><br class="spacer_" /></p>
]]></content:encoded>
			<wfw:commentRss>http://voidandany.free.fr/index.php/flexget-telechargement-automatique-de-torrents/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
