diff --git a/README.md b/README.md index 92d6c10..0ce3f45 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # pseudo-channel - Plex Controller for Home-brewed TV Channel This is a python based cli-app using the python-plex-api to control a plex-client and act like a real TV channel with show scheduling, commercial breaks, movie nights, etc. -This project is inspired by the [Fake TV](https://medium.com/@Fake.TV/installation-and-setup-of-faketv-e21340fbf1d4) blog post I came across on reddit a while ago. In his really cool project, the author uses a feature rich controller script called 'Python Plex Controller', located here: [https://github.com/MoeFwacky/Python-Plex-Controller](https://github.com/MoeFwacky/Python-Plex-Controller) to handle his "Fake TV" channel. I spent a few hours playing with this script and really had fun with it. It pretty much does everything you need and a lot more. There was however one thing missing that turned out to be pretty important to me: some kind of episode / movie duration calculation to shift a daily generated TV schedule so no media gets cutoff. Basically with that script, you can set a repeatable "weekday" schedule for a TV show... So every weekday the next episode in say, the 'Seinfeld' series will play at the specified time (i.e. "6:30 PM"). The problem I was having with this script is that if an episode happens to be longer than usual (say 1 hour versus the usual 30 minutes as scheduled), it won't adjust for that but will cut it off if you have something scheduled at say, "7:00 PM". It's very possible that this feature exists in that script and I missed it, but after playing with the awesome Plex API library over at: [https://github.com/pkkid/python-plexapi](https://github.com/pkkid/python-plexapi), I realized just how easy it is to control the playback of Plex media on my RasPlex client via my command line using Python and I decided to try and roll my own very simple script that does one thing really well: generate a daily TV schedule based on user defined TV Shows, time ranges, and random movies during specified movie time - injecting commercials where needed. +Joined by the author of [Fake TV](https://medium.com/@Fake.TV), this project aims at tackling one issue: creating a fake tv channel experience with your own media library (movies, tv shows, commercials, etc.). The idea is super simple... when you turn on your TV, rather than hopping straight to Netflix, you can choose to watch your own channel of curated media like a real channel, with randomized movie time blocks, weekend morning cartoons, 90's commercials to fill up gaps and more. We aim to add a ton of neat features but the basic idea is to have something that feels like a real TV channel. That being said it isn't supposed to "pause" nor are you supposed to intervene too much. Just like a real channel you are presented with a channel that you define once and let it go as it advances in series episodes, playing random movies where specified (defined by various parameters like genre, "Kevin Bacon", etc.). Think: weekday movie nights @ 8:00 PM. Or perhaps you want to further specify your weekly Wednesday evening movie be a movie in your Plex library that stars "Will Smith". Currently the latter feature among many others are being developed but this is the goal. PseudoChannel is built to interface with the Plex media server. So if you want to have your very own PseudoChannel, you first need to set up your home server using [Plex](https://www.plex.tv/). After that you can come back here to learn how to setup everything else. Please note that we just started this project so everything is evolving rapidly. Check back often. We aim to have a decent working "alpha" version within a week or so. This readme / the how-to guide will all be very user friendly. Although this app runs using Python and the command line, we aim to make all of it as easy as possible to understand for those who are intimidated by this sort of technology. -![Generated HTML schedule](http://i.imgur.com/SQaUpYM.png) +![Generated HTML schedule](http://i.imgur.com/uTGRYIp.png) ## Features So Far: @@ -11,8 +11,9 @@ This project is inspired by the [Fake TV](https://medium.com/@Fake.TV/installati - [x] Add a controller to query the local generated pseudo_tv.db to see when to trigger the next media. - [x] Add episode duration checking & adjust daily generated schedule based on these results... - [x] Generate daily html schedule (saved in ./schedules directory). Can be served via webserver. -- [ ] Add "commercial injection" to fill up gaps between content. -- [ ] Bug fixes +- [ ] Add Google Calendar integration to easily schedule your PseudoChannel. +- [ ] Add "commercial injection" & user defined "defaults" to fill up gaps between content. +- [ ] Bug fixes. - [ ] List of features from reddit. If interested in this project, check back very soon when the beta is up. It's close and a tiny bit more user friendly. :) @@ -23,25 +24,48 @@ If interested in this project, check back very soon when the beta is up. It's cl 1. Download the [Python Plex API](https://github.com/pkkid/python-plexapi) & their dependencies. Also get [yattag](http://www.yattag.org/). All these dependencies can be installed via pip. -2. Download this repository & edit the `pseudo_config.py` / `the pseudo_schedule.xml` to your liking. Find your Plex token [here](https://support.plex.tv/hc/en-us/articles/204059436-Finding-an-authentication-token-X-Plex-Token) +2. Download this repository & create a new file named, `pseudo_config.py` just outside of the project directory. Within that file add your plex server url / [plex token](https://support.plex.tv/hc/en-us/articles/204059436-Finding-an-authentication-token-X-Plex-Token) like so: -3. Run the `PseudoChannel.py` file with the following flags: +```bash +token = '' +baseurl = 'http://192.168.1.28:32400' +``` +*This file is important as it tells the pseudo-channel app how/where to connect to your Plex server. It should sit just outside of this /pseudo-channel/ directory.* + +4. Edit the `pseudo_config.py` / `the pseudo_schedule.xml` to your liking. You can specify your plex media library names within the `pseudo_config.py` file... the default assumes that you have these libraries in your Plex server named like so: "TV Shows", "Movies" & "Commercials". If you do not intend on using commercials just set the `useCommercialInjection` flag to `False`. There are a few other experimental options like using Google Calendar rather than an XML. It is an arduous process to initially set up and I've found the XML method to be the easiest method for organizing your schedule - so stick with that for now. + +5. Run the `PseudoChannel.py` file with the following flags: ```bash % python PseudoChannel.py -u -xml -g -r ``` +*You can also run `-h` to view all the options. Keep in mind not all options are operational & some are experimental. Stick with the ones above and use `-c` to find the name(s) of your Plex client(s).* -The `-u` flag will prepare & update (& create if not exists) the local `pseudo-channel.db`. The `-xml` flag will update the newly created local db with your schedule from the xml file. The `-g` file will generate the daily schedule (for today). Finally, the `-r` file will run a while loop checking the time / triggering the playstate of any media that is scheduled. It will also update the daily schedule when the clock hits 11.59. The xml schedule is a bit tempermental at the moment so if you see errors, check your entries there first. Make sure all of your movie names / TV Series names are correct. +The `-u` flag will prepare & update (& create if not exists) the local `pseudo-channel.db`, you only need to run this once in the beginning or later when you have added new media to your Plex libraries. The `-xml` flag will update the newly created local db with your schedule from the xml file - you should run this everytime you make changes to the xml. The `-g` file will generate the daily schedule (for today) based on the xml. Finally, the `-r` file will run the app, checking the time / triggering the playstate of any media that is scheduled. It will also update the daily schedule when the clock hits 11.59 (or whatever time you've configured in the config file). The xml schedule is a bit tempermental at the moment so if you see errors, check your entries there first. Make sure all of your movie names / TV Series names are correct. -To run the app in a 'poor-mans-daemon-mode', run this: +Features are being added to the xml but as of now there are a few. Within the XML `