📜 ⬆️ ⬇️

Configure conky to display the number of new TV shows

In this article I will show how to set up the system so that the new series of your new TV shows are automatically uploaded as torrents, and the horseback shows the number of these uploaded torrents.


First of all, we need pytvshows, take it here . The principle of its work is as follows: she climbs on tvrss.net, searches for those shows that you need, and, if new torrents with new series appeared there, upload them.
Install:
1) Go to the folder with the downloaded archive
2) Unarchive
tar xf pytvshows-0.2.tar.gz
3) Delete the archive
rm pytvshows-0.2.tar.gz
4) Go to the newly created folder
cd pytvshows-0.2
5) Install
sudo python setup --install
6) Go back and delete the folder.
cd ... && rm -R pytvshows-0.2

Great, pytvshows is installed. Now create a configuration file
1) Go to the home folder
cd ~
2) Create a configuration file
vim .pytvshows.cfg
3) Now we will enter in the file the names of the shows of interest. To do this, go to tvrss.net and look for the correct name of the desired show. Replace spaces with pluses and add square brackets to the sides. For example:
[The + Simpsons]
[Family + Guy]
[South + Park]
4) Run pytvshows
pytvshows
5) Now pytvshows will process your configuration file in a special way. If you look at this file, you will see something like this:
[South + Park]
episode = 3
season = 13
show_type = seasonepisode
human_name = South Park
time = 2009-03-19 04:49:40
')
Here the episode and season set the last episode you saw. If a new series comes out, pytvshows will download the torrent and change the episode and season accordingly

This completes the pytvshows setup. Now we automate the whole thing.
1) First of all, create a separate folder for torrents, so as not to litter our home folder with torrents
mkdir shows
2) Create a script called pytvshows
vim pytvshows
3) Put the following in it
#! / bin / bash
pytvshows -o / home / user / shows
here user needs to be replaced with your username
4) Make the script executable
chmod + x pytvshows
5) Put the script in /etc/cron.daily
sudo mv pytvshows /etc/cron.daily/
Now pytvshows will upload new series (if any, of course) once a day to the shows folder in your home directory.

Now we’ll configure conky to display this whole thing on your desktop.
1) Install conky if it is not already installed
In debian / ubuntu: sudo apt-get install conky
2) Create a pshow.py file
vim pshow.py
3) Put the following in it
#! / usr / bin / python
from os import system
system ('ls /home/user/.shows/> /tmp/.shows')
f = file ('/ tmp / .shows')
s = f.readlines ()
f.close ()
system ('rm /tmp/.shows')
print len ​​(s)
MUST replace user in the third line with your username
4) Make the script executable
chmod + x pshow.py
5) Move it and rename it.
sudo mv pshow.py / usr / bin / pshow
The task of the script is pretty simple: it counts the number of torrents in the shows folder

And set up conky. Add the following to the .conkyrc file:
$ {execi 120 pshow}
Now Konka will display the number of torrents in the shows folder

Well, that's all, thank you for your attention

Source: https://habr.com/ru/post/55702/


All Articles