seedbox

whatbox related guides and setup. i highly recommend whatbox to anyone as they have given me the best value-for-money. to top it all off, their customer service is unrivalled. all commands are done on the seedbox slot. you need to have a whatbox account in order to utilise these guides/tools.

jump straight to…

ssh commands required
majority of the ssh commands requires nano or vim. my choice of a terminal editor would be nano. to find out more how to use nano, visit the following page to get the basics.

look out for notes
notes are placed in the guides, these markers requires your attention.

report inaccuracies and errors
if something in this guide is inaccurate, wrong, or outdated, report it by scanning the qr code.


πŸ‘¨πŸ»β€πŸ’» [setting up flexget] - πŸ’€ obsolete

πŸ—£ note: i am no longer using flexget and have moved onto sonarr/radarr. also this guide may not be relevant anymore or have been updated. my advice is to visit whatbox to view their updated wiki for flexget.

  1. ssh into your whatbox slot

  2. edit your .bashrc to include the following:

     export LC_ALL=en_US.UTF-8
     export LANG=en_US.TUF-8
  3. save the file and exit.

⚠️ important: you must terminate the ssh session.

  1. ssh back into your slot and review that your .bashrc is updated:

     cat ~/.bashrc
  2. follow the guide at whatbox/wiki/flexget.

  3. after installing both virtualenv/flexget make sure you install transmissionrpc.

  4. get into the bin directory:

     cd ~/flexget/bin 

8 source of flexget:

    source ~/flexget/bin/activate
  1. install transmissionrpc:

     easy_install transmissionrpc
  2. create your config file:

    cd ~/flexget
    vim config.yml

πŸ—£ note: the config.yml examples can be found at flegxget - cookbooks

  1. check your output:

    bin/flexget check

πŸ—£ note: if your config file is done correctly the output returned should be config passed.

  1. confirm it by the following:

    bin/flexget --test execute
  2. if everything checks out fine, install the crontab as advised in whatbox’s wiki for flexget.


πŸ‘¨πŸ»β€πŸ’» [forget file]

use this in the event should you need to forget series/movies which you have indexed.

  1. ssh into your slot

  2. execute following:

     cd ~/flexget/
  3. search:

     bin/flexget seen search <keyword>
  4. forget the item:

     bin/flexget seen forget 'exact title'

⚠️ important: the ’ ’ are important for the command to work.


πŸ‘¨πŸ»β€πŸ’» [creating a flexget log]

  1. ssh into your slot.

  2. execute following syntax:

     cd ~/flexget/
  3. create the file:

     bin/flexget --logfile flexget.log
  4. test it out:

     tail -f flexget.log

πŸ‘¨πŸ»β€πŸ’» [upgrading flexget]

  1. ssh into your slot.

  2. change directory to your flexget:

     cd ~/flexget/bin
  3. vm into the source:

     source ~/flexget/bin/activate
  4. start the upgrade of setuptools:

     pip install --upgrade setuptools
  5. upgrade flexget from source:

     pip install --upgrade flexget
  6. test run to validate:

     bin/flexget check

πŸ‘¨πŸ»β€πŸ’» [flexget db lockup]

πŸ—£ note: this happens when 2 instances of flexget runs concurrently, the sqllite db will get locked.

  1. ssh into your slot.

  2. run the command to kill all flexget processes:

     pkill flexget
  3. wait for your crond to run or manually execute your flexget.


πŸ‘¨πŸ»β€πŸ’» [testing crond]

πŸ—£ note: easiest way to know if crond is working. what is does is to create a file titled success in the root of your whatbox account.

  1. ssh into your slot.

  2. bring up the crontab:

     crontab -e
  3. add the following line:

     */5 * * * * touch /home/username/success

πŸ—£ note: change /home/username/ to your own slot’s path


πŸ‘¨πŸ»β€πŸ’» [purging failed downloads/items in flexget]

πŸ—£ note: every once in a while; we get wrong entries from the flexget script; some of these will be sent into a flexget backlog db. clearing the movie-queue waiting list will not help, it will still get sent for downloading even though you have already downloaded it.

  1. ssh into your slot.

  2. change to the flexget directory:

     cd ~/flexget
  3. bring up the failed list:

     bin/flexget failed list
  4. clear the list:

     bin/flexget failed clear
  5. reset the backlog plugin db:

     bin/flexget database reset-plugin backlog
  6. when done correctly, message will appear as the database for backlog as been reset.


πŸ‘¨πŸ»β€πŸ’» [downgrading flexget]

  1. ssh into your slot.

  2. change directory to the following:

     cd ~/flexget/bin
  3. activate the source:

     source ~/flexget/bin/activate
  4. execute the downgrade process:

     pip install flexget==2.x.x
  5. validate by waiting for crond or manually execute flexget to run.


πŸ‘¨πŸ»β€πŸ’» [reset episode download in flexget]

πŸ—£ note: at times you may receive fake downloads due to un-verified RSS feeds. to reset the episode’s download, follow these steps below.

  1. ssh into your slot.

  2. change directory to flexget:

     cd ~/flexget
  3. check your tv-series listing:

     bin/flexget series list
  4. locate the show in question and execute the check task:

     bin/flexget series show *name-of-tv-show*
  5. forget the episode to allow flexget to re-download it:

     bin/flexget series forget *name-of-tv-show* *s01e01*

πŸ‘¨πŸ»β€πŸ’» [upgrade flexget for trakt.tv v2 api]

πŸ—£ note: flexget needs to be updated to make use of the new trakt.tv api v2. if your flexget is 1.2.380 and below, flexget cannot be used to generate the trakt pin for token generation, hence you will need to update it before doing anything.

instructions to upgrade flexget is a few paragraphs up on this page. once you have done that, please follow these steps:

⚠️ important: upgrade your Flexget you will need to update your setup tools as well.

  1. generate a pin for flexget, copy the pin once its generated:
  1. on the whatbox slot, generate an access token:

     flexget trakt auth *trakt-username* *pin*
  2. amend the settings on your flexget config.yml file.

⚠️ important: trakt v2 api no longer users thus you will need to substitute it for which you have generated in step 1 above.

affected plug-in’s (if you have used them before) are:


πŸ‘¨πŸ»β€πŸ’» [telegram notification for flexget]

  1. download telegram for your laptop, mobile.

  2. install telegram on whatbox as well. ssh into your slot.

  3. change directory to:

     cd ~/flexget/bin
  4. source folder:

     source ~/flexget/bin/activate
  5. install telegram:

     pip install python-telegram-bot
  6. on your telegram.app, contact @botfather and follow the commands to create a new bot by invoking:

     /newbot

⚠️ important: once you setup your bot (eg. name it, etc), make sure you keep that http api code @botfather gave to you. you will need it. the bot_token will be needed to be inserted into tautulli and flexget.

  1. create a chatgroup in your telegram.app.

  2. invite your bot into the groupchat. invite @myidbot into the group chat as well.

  3. in the groupchat, issue command:

     /getgroupid@myidbot
  4. @myidbot will generate a series of numbers, these represent your groupchat’s id. copy it down.

  5. login to tautulli and activate telegram.

  6. when prompted to enter the bot_id, key in the http api that was provided by @bothfather.

  7. key in the telegram groupchat id as well, provided by @myidbot.

  8. test the notifications.

  9. in your config.yml of your fleget, you will need to key the following code in.

⚠️ important: for flexget, see the sample code. Repeat it for each task, e.g. series & movies.

code is updated for 2.7.0 (may be outdated)

    template: transmit-movies
        #    pushbullet:
        #      apikey: <apikey>
        #      device: <deviceid>
        #      title: "imdb_name"
        #      body: "title\n\nimdb_url\n\nSize: content_sizeMB"
            notify:
                to:
                    - telegram:
                        bot_token: <bot_token_generated_from_@botfather>
                            parse_mode: markdown
                                recipients:
                                    - group: <name of telegram group created>
                                        message: |
                                            {%if task in ["retreive_from_couchpotato","dynamic_imdb_actors"]%}*New movie added to list*
                                            {%else%}*Download Started from task
                                            *task%7Creplace%28%22_%22%2C%20%22-%22%29
                                            {%endif%}
                                            {% if series_name is defined -%}
                                            *series_name* - series_id - quality%7Cd%28%27%27%29
                                            *tvmaze_episode_name%7Cd%28tvdb_ep_name%29%7Cd%28%27%27%29*
                                            [Image](tvmaze_series_original_image%7Creplace%28%22_%22%2C%20%22%255F%22%29)
                                            [Show page](tvmaze_series_url%7Creplace%28%22_%22%2C%20%22%255F%22%29)
                                            {% elif imdb_name is defined -%}
                                            *imdb_name* - (imdb_year)
                                            quality%7Cd%28%27%27%29
                                            imdb_score/10 - imdb_votes votes
                                            imdb_genres%7Cjoin%28%27%2C%20%27%29%7Ctitle 
                                            *Plot:* imdb_plot_outline
                                            [Image](tmdb_posters%5B0%5D%7Creplace%28%22_%22%2C%20%22%255F%22%29)
                                            [Movie Page](imdb_url%7Cd%28%27%27%29)
                                            {% else -%}
                                            title
                                            {%- endif -%}
  1. save and exit the terminal.app

  2. wait for flexget crond to run or manually execute flexget to test.


πŸ‘¨πŸ»β€πŸ’» [cleanup on flexget]

πŸ—£ note: you need to know what is the name of your movie-list in flexget, look at your config.yml file. items below have to be run in sequence.

  1. ssh into your slot.

  2. list out the movies list:

     bin/flexget movie-list list my-movielist
  3. purge all entries:

     bin/flexget movie-list purge my-movielist
  4. list out the seen db:

     bin/flexget seen search movie
  5. check that the db is empty:

     bin/flexget seen forget fill_movie_queue
  6. clear rejected entries from config.yml:

     bin/flexget rejected clear
  7. clear backlog:

     bin/flexget backlog clear
  8. clear failed:

     bin/flexget failed clear
  9. cleanup db:

     bin/flexget database cleanup
  10. vacuum db:

    bin/flexget database vacuum
  11. exit the terminal.app


πŸ‘¨πŸ»β€πŸ’» [syncthing]

πŸ—£ note: syncthing is a tool that allows the secure and encrypted sync of the files from your seedbox to your synology.

  1. install syncthing on your synology.

  2. ensure that you have the synocommunity package added to your package center, visit the link below:

  1. after installing, access it via the following link:

     http://synology-ip:7070
  2. install syncthing on your whatbox slot. follow the instructions:

  1. once both are installed and configured, on each of your syncthing’s install, you will need to configure add folders that both synology syncthing and whatbox’s syncthing will exclusively be synchronising from.

πŸ‘¨πŸ»β€πŸ’» [syncthing ignore settings]

πŸ—£ note: .stignore files and folder settings. these are the files and folders to ignore to synced over.

    (?d)*.nfo
    (?d)*.txt
    (?d)*.mp4
    (?d)*.png
    (?d)*.md5
    (?d)*.sfv
    (?d)*.jpg
    (?i)screens
    (?i)sample
    (?i)extra

πŸ‘¨πŸ»β€πŸ’» [flexget .config-lock]

πŸ—£ note: recently after the seedbox’s upgrade, the flexget client seemed to have not been able to start, when attempting to execute bin/flexget check or execute or even a pkill flexget, you may encounter the following error: there is a FlexGet process already running for this config, sending execution there. could not start manager: [Errno 111] Connection refused.

  1. check your flexget directory using the following command:

     ls -la
  2. this would print the hidden file .config-lock. delete this file.

     rm -rf .config-lock

πŸ‘¨πŸ»β€πŸ’» [xteve setup]

πŸ—£ note: xteve (x-te-ve) is used for the plex live-tv tuner. you will need to have a valid EPG listing as well and m3u files. do note that you will not be able to share live-tv to your users, unless they are added as a home user.

  1. follow the guide from the whatbox wiki.
  1. login to your xteve gui page and navigate to settings > general:

image

⚠️ important: the tuners refer to the number of available cast-source, if you have more live-tv tuners, then add that accordingly.

  1. scroll down to streaming and select xteve for stream buffer.

image

  1. save the settings.

  2. navigate to xmltv and click on it.

image

  1. add your epg source in.

image

πŸ—£ note: the epg source is normally a .xml file which is provided by your live-tv provider. enter that url in there. (use http:// instead of https:// - using the ssl protocol will cause the guide to refresh and remove the channels by plex.)

  1. save and close.

  2. you will see the epg source’s output as shown below:

image

  1. navigate to playlist.

image

  1. add your m3u file.

πŸ—£ note: the m3u file should be supplied by your live-tv provider. you can have the m3u file uploaded into a server or enter the url of where the m3u file is stored in. tuners refer to number of live-tv stream you are allowed to have.

  1. once all done, locate the xpeg url and copy the url link, you will need this for the next part of your setup in plex.

⚠️ important: important to copy this url.

setting up the live-tv tuner in plex.

  1. login to your plex account. (via web)

  2. navigate to settings then proceed to manage > live tv & dvr.

  3. add a new dvr.

  4. key in the url of your xteve (with the port number), click on connect and then continue

image

  1. once the channels are loaded, click on continue.

image

  1. you will now need to configure your xmltv guide. click on the link have an xmltv guide on your server? click on that link.

image

image

⚠️ important: the xmltv url is the url which you had copied in step 11, above.

  1. follow-through with the rest of the setup and exit the dvr setup.

  2. when successfully loaded, you will be able to see the live-tv in your plex.

image


πŸ‘¨πŸ»β€πŸ’» [moving whatbox slots]

πŸ—£ note: recently migrated my whatbox slot. these are the items that i had to re-do. i had requested from the staff to retain the ports of my programs.

  1. sonaarr/radarr
  1. syncthing
  1. xteve
  1. you’re done.

πŸ‘¨πŸ»β€πŸ’» [unrar script]

πŸ—£ note: this is particularly useful if are downloading r01, rar files from sources.

  1. ssh into your whatbox slot and create a folder:

     mkdir ~/files/script
  2. execute nano to have the following file created:

     cd ~/files/script
     nano script.sh
  3. place the code in and save the file:

     #!/bin/bash
     #A simple script to extract a rar file inside a directory downloaded by Transmission.
    
     find /home/path-of-torrent-downloads/$TR_TORRENT_NAME -name "*.rar" -execdir unrar e -o- "{}" \;
  4. make the file executable:

     chmod +x script.sh
  5. kill your current transmission daemon:

     killall transmission-daemon
  6. edit the settings.json file for transmission:

     nano ~/.config/transmission-daemon/settings.json
  7. change the following to reflect accordingly:

     "script-torrent-done-enabled": true, 
     "script-torrent-done-filename": "/home/username/files/script/script.sh",
  8. save the file and restart your transmission through whatbox’s management panel.

  9. happiness πŸ˜„