Configuring conky to display the number of new TV shows

    In this article I will show how to configure the system so that new episodes of your new TV shows are automatically downloaded as torrents, and Konki displays the number of these downloaded torrents.


    First of all we need pytvshows, we take here . The principle of her work is as follows: she crawls on tvrss.net, looks for those shows that you need there, and, if there are torrents with new series, uploads them.
    Install:
    1) Go to the folder with the downloaded archive
    2) Unzip
    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
    cd folder ... && rm -R pytvshows-0.2

    Great, pytvshows is installed. Now create the configuration file
    1) Go to the home folder
    cd ~
    2) We create the configuration file
    vim .pytvshows.cfg
    3) Now we enter the names of the shows of interest to the file. To do this, go to tvrss.net and look for the correct name for the desired show. We replace the spaces with pluses in it and add square brackets on the sides. For example, like this:
    [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 episode and season set the last episode you saw. If a new series comes out, then pytvshows downloads the torrent and changes episode and season accordingly

    . This completes the configuration of pytvshows. Now we will automate the whole thing
    1) First of all, we will create a separate folder for torrents so as not to clutter up our home folder with torrents
    mkdir shows
    2) Create a script called pytvshows
    vim pytvshows
    3) Put the following
    #! / Bin / bash
    pytvshows -o / home into it / 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 episodes once a day (if any, of course) to the shows folder in your home directory.

    Now configure conky to display all of this on your desktop.
    1) Install conky, if it is not already installed.
    To debian / ubuntu: sudo apt-get install conky
    2) Create the file pshow.py
    vim pshow.py
    3) Put the following
    #! / Usr / bin / python
    from os import system in it
    system ('ls /home/user/.shows/> /tmp/.shows')
    f = file (' / tmp / .shows')
    s = f.readlines ()
    f.close ()
    system ('rm / tmp /.shows')
    print len ​​(s)
    ALWAYS replace user in the third line with your username
    4) Make the script executable
    chmod + x pshow.py
    5) Let's 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 sets up conky. Add the following to the .conkyrc file:
    $ {execi 120 pshow}
    Now Konki will display the number of torrents in the shows folder.

    Well, that’s all, thanks for watching

    Also popular now: