You need Plex Media Server and Tautulli setup as well as a Facebook Group (you do not need to be a group admin). The script requires python2 and the python modules
argparse
ConfigParser
os
pickle
re
requests
sys
time
Place facebook.py and fbsettings.ini in the same folder where you execute Tautulli custom scripts from. This path must be readable and writable by the Tautulli process so that the script can store your Facebook login session.
Edit fbsettings.ini and provide your Facebook username, password and the group_id of the Facebook Group you want to post to. Do not use the vanity name of the group. To find your group_id, navigate to the group in your browser and View Source, then search for "group_id". You will find strings like the following throughout the source code with your numeric group_id:
?group_id=123456789101112&
You can easily test the script from the CLI to ensure your credentials are working.
usage: facebook.py [-h] -c POST_CONTENT [-u POST_URL] [-d]
optional arguments:
-h, --help show this help message and exit
-c POST_CONTENT, --content POST_CONTENT
Post Content - use \n for line breaks
-u POST_URL, --url POST_URL
Link to Include in Post
-d, --debug Enable Debugging Output - This may reveal Facebook
login details
For example
python facebook.py -c 'This is a test post' -u 'http://www.superbad.com/' -d
This step should help you correct any setup or configuration issues prior to integrating into Tautulli.
- In Tautulli > Settings > Notification Agents click Add a new notification agent.
- Select Script.
- Enter the folder where you saved facebook.py and fbsettings.ini and select facebook.py for your script file.
- Select any triggers you wish to use.
- Provide any notification conditions you require.
- Provide the script arguments using the same conditional tags and metadata variables you would use for other notification agents.
For example, a Recently Added trigger argument might look like
<movie>-c "Added to {library_name}\n{title} ({year})" -u '{imdb_url}'</movie><episode>-c "Added to {library_name}\n{show_name} - S{season_num00}E{episode_num00} - {episode_name}" -u '{trakt_url}'</episode><season>-c "Added to {library_name}\n{show_name} - Season {season_num}" -u '{trakt_url}'</season><album>-c "Added to {library_name}\n{album_name} ({year}) - {artist_name}" -u '{lastfm_url}'</album> -d
Remember when using the Test feature in Tautulli, the conditional tags and metadata variables are not processed so use simple test strings.
-c 'This is a test post' -u 'http://www.superbad.com/' -d
You will find errors output in the Tautulli logs. Be sure to look in both the Notification Logs and Tautulli Logs to get a complete picture of what is occuring. If you need additional log output, use the -d argument to enable debugging mode.
You can message me @spuniun on Discord if you need additional assistance.
- u/djzang for giving me the idea
- Pablo on stackoverflow for writing the original code
- KennyX for tying it together for me
- SwifthPanda16 and Arcanemagus for all the tremendous support
- Nag for script updates based on gist hash
hey @spuniun thanks for this man!
I had this working for a few weeks, but I was out of town and my server was down. When I came back I updated a lot shit on it - Windows, PLEX, Tautulli, Python ... just a bunch of shit and now I'm getting the error below.
Running Windows 10E w/ Python 2.7.14
Here is my output when I run a test, I've tested a lot of different combinations, but can't get past the
NO MODULE NAMED ORDERED_DICT
Any ideas?
BTW: you have a type in "VERSION"