mirror of
https://github.com/FakeTV/pseudo-channel.git
synced 2026-01-06 18:23:15 +00:00
Added documentation to XML / defaults to strict-time / time-shift. Also removed overlap-max for now until it's fully implemented.
This commit is contained in:
@@ -378,9 +378,9 @@ class PseudoChannel():
|
||||
|
||||
day_of_week = child.tag
|
||||
|
||||
strict_time = time.attrib['strict-time'] if 'strict-time' in time.attrib else ''
|
||||
strict_time = time.attrib['strict-time'] if 'strict-time' in time.attrib else 'false'
|
||||
|
||||
time_shift = time.attrib['time-shift'] if 'time-shift' in time.attrib else ''
|
||||
time_shift = time.attrib['time-shift'] if 'time-shift' in time.attrib else '1'
|
||||
|
||||
overlap_max = time.attrib['overlap-max'] if 'overlap-max' in time.attrib else ''
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ plexClients = ['RasPlex']
|
||||
plexLibraries = {
|
||||
"TV Shows" : ["TV Shows"],
|
||||
"Movies" : ["Movies"],
|
||||
"Music" : ["Music"],
|
||||
"Commercials" : ["Commercials"],
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- Welcome to PseudoChannel!
|
||||
|
||||
This will be the most difficult part in the process of setting up your PseudoChannel (but it is not hard,
|
||||
just be sure to read this and you will be set).
|
||||
|
||||
There are a few things to keep in mind when setting up this XML.
|
||||
|
||||
1) What exactly is this file for?
|
||||
|
||||
The whole idea behind "PseudoChannel.py" is to create your own channel(s) to mimick real TV,
|
||||
using your own "TV Shows", "Movies" and "Commercials". You are not supposed to intervene too often,
|
||||
rather you are supposed to set it up (here) and just let it go as it advances in series episodes, playing
|
||||
commercials to fill up gaps between scheduled content and playing movies where specified. That being said,
|
||||
this particular file is where you map out what your channel looks like. I have my own schedule
|
||||
below so you can reference it when building your own channel.
|
||||
|
||||
2) How do I make sense of these '<time></time>' blocks / '<weekdays></weekdays' blocks?
|
||||
|
||||
Since the whole concept of the channel is to have repeating blocks of content that changes throughout the
|
||||
week depending on the day / time of day (like a real channel) you specify your "TV Shows" and "Movies" schedule
|
||||
by adding a '<time></time>' block within the part of the week you want it to be scheduled for. For instance,
|
||||
below I have "Looney Tunes" scheduled to play "everyday" starting at "6:00 AM", whereas I have "Garfield & Friends"
|
||||
playing only on "weekday" mornings scheduled for after Looney Tunes starting at "8:00 AM". Also notice that
|
||||
"Garfield & Friends" below is actually written as, "Garfield & Friends". This is especially important
|
||||
to those new to editing XML. In XML, "UTF-8", you are forbidden from using certain characters like the "&"
|
||||
character. It is important to convert your titles to XML friendly text (this is also important for non-english characters).
|
||||
You can find all of this information by googling "xml ascii character conversion".
|
||||
|
||||
3) Setting the available parameters: "title=", "type=", "strict-time=", "time-shift=", "xtra="
|
||||
|
||||
There are two required parameters: "title" and "type". The "title" value should be either the title of your series
|
||||
(i.e. "Friends") or if you are scheduling a movie it should only be set to, "random". The "type" parameter should be set
|
||||
to either "series" or "movie". The attribute "strict-time" can either be "true" or "false" and refers to
|
||||
whether or not the particular "<time>" block will be scheduled for the exact time you specify or if it will
|
||||
shift around to fill up gaps. This is useful as sometimes episodes are as short as 5 minutes (cartoons) while
|
||||
other episodes that are normally ~25 minutes are an hour or so long. Setting "strict-time" to "false" will
|
||||
tell the app to movie that time block closer to the previous episode. The corrisponding, "time-shift" attribute
|
||||
tells the app how to shift the item. Its value can be "1" or more and will help the scheduler determine when to schedule the
|
||||
shifting time according to that value. So for instance, if you'd like no gaps between your content, then you want
|
||||
to set "strict-time='false'" and "time-shift='1'". However if you want your content to shift but would rather
|
||||
it 'hook' on to a pretty time, like "2:45 PM" versus "2:41 PM" then you would set "time-shift" to a value like "5".
|
||||
This will shift content around and schedule it within 5 minutes of the previous item but hook it on to the
|
||||
nearest multiple of "5". You could use "15" or "30" too for even prettier times. Experiment.
|
||||
|
||||
4) Movies. How do I schedule "Billy Madison" to play on Saturday afternoon?
|
||||
|
||||
Well, since the app is supposed to work like a real TV Channel, you aren't supposed to have that kind of
|
||||
control. If you want to watch "Billy Madison" then why not just turn on your Plex TV app and play it? Instead
|
||||
here you want to always use "random" tor the "title=" value. But let's say you have a ton of Adam Sandler
|
||||
movies and want to schedule a "random" Adam Sandler movie on Saturday afternoon? That makes more sense, that way
|
||||
you aren't playing the same movie every Saturday afternoon! For movies specifically, you have a new
|
||||
attribute called "xtra". There you can add various parameters to narrow in on the random movie type you
|
||||
want scheduled every Saturday afternoon. So if for some reason you are set on playing an Adam Sandler comedy
|
||||
every Saturday, then you might have a <time> block that looks like this:
|
||||
|
||||
<time title="random" type="movie" strict-time="true" xtra='actor:adam sandler genre:comedy contentRating:PG'>12:45 PM</time>
|
||||
|
||||
The available "xtra" paramters are as follows (http://python-plexapi.readthedocs.io/en/latest/_modules/plexapi/library.html#LibrarySection.search):
|
||||
|
||||
* unwatched: Display or hide unwatched content (True, False). [all]
|
||||
* duplicate: Display or hide duplicate items (True, False). [movie]
|
||||
* actor: List of actors to search ([actor_or_id, ...]). [movie]
|
||||
* collection: List of collections to search within ([collection_or_id, ...]). [all]
|
||||
* contentRating: List of content ratings to search within ([rating_or_key, ...]). [movie,tv]
|
||||
* country: List of countries to search within ([country_or_key, ...]). [movie,music]
|
||||
* decade: List of decades to search within ([yyy0, ...]). [movie]
|
||||
* director: List of directors to search ([director_or_id, ...]). [movie]
|
||||
* genre: List Genres to search within ([genere_or_id, ...]). [all]
|
||||
* network: List of TV networks to search within ([resolution_or_key, ...]). [tv]
|
||||
* resolution: List of video resolutions to search within ([resolution_or_key, ...]). [movie]
|
||||
* studio: List of studios to search within ([studio_or_key, ...]). [music]
|
||||
* year: List of years to search within ([yyyy, ...]). [all]
|
||||
|
||||
Currently the "xtra" attribute is only available to be used with movies.
|
||||
|
||||
5) Commercials?
|
||||
|
||||
If you are planning on using "time-shift" with a value greater than "1", then you will have empty gaps
|
||||
in between your scheduled content. A neat feature is to fill those gaps with commercials, music videos,
|
||||
or whatever you can come up with. All you have to do is set the commercial flag in the "pseudo_config.py"
|
||||
file to tell the app to use "commercial injection" and make sure you have a "Commercials" library in your
|
||||
plex media library. In that library, fill it with as many commercials or short videos as you can. The more
|
||||
the better! I have close to a thousand commercials in mine - this helps the app fill up the gaps with a
|
||||
wide variety of video content of different durations. (hint: use a tool like 'youtube-dl' to download full
|
||||
playlists from yourtube. You can fill up your "Commercials" library quick). Once you have your commercials library
|
||||
setup, make sure to run, "python PseudoChannel.py -u" once more to update your local db with your new commercials
|
||||
library. Commercials will now be "injected" to fill up gaps upon the next days schedule (or you can manually
|
||||
generate the schedule using the "-g" flag).
|
||||
|
||||
Ok, that should be it. I've made it sound much more complicated than it actually is. Just make sure that you aren't
|
||||
accidentally overlapping times, aren't accidentally trying to use forbidden XML characters, etc. Once you have
|
||||
everything set, it should be hands off form there on out. Just go back to the cli and run "python PseudoChannel.py -xml"
|
||||
to tell the app that you have updated the XML.
|
||||
|
||||
Oh and lastly, make sure that your "series" title's are written exactly as they are in your Plex Library. So if you
|
||||
have "The Office (us)" in your Plex library, you need to have it written exactly like that here (not case sensitive) or it won't work. In
|
||||
my previous "garfield" example you might be tempted to write it as "Garfield and Friends" instead of the hassle of
|
||||
using the XML ascii character "&". Well you cannot do that. I usually like to have my Plex Server web page
|
||||
open in a tab while making my XML. That way for each "series" title I can double check the library to make sure I
|
||||
am using the series title exactly as Plex is.
|
||||
|
||||
Ok, that is it. If you have questions feel free to e-mail me at justin@pseudochannel.tv. Have fun!
|
||||
|
||||
Cheers!
|
||||
|
||||
-->
|
||||
<schedule>
|
||||
<everyday>
|
||||
<time title="Looney Tunes" type="series" strict-time="true" time-shift="1" overlap-max="">6:00 AM</time>
|
||||
<time title="Looney Tunes" type="series" strict-time="false" time-shift="1" overlap-max="">6:30 AM</time>
|
||||
<time title="Looney Tunes" type="series" strict-time="false" time-shift="1" overlap-max="">7:00 AM</time>
|
||||
<time title="Looney Tunes" type="series" strict-time="false" time-shift="1" overlap-max="">7:30 AM</time>
|
||||
<time title="Looney Tunes" type="series" strict-time="true" time-shift="1" >6:00 AM</time>
|
||||
<time title="Looney Tunes" type="series" strict-time="false" time-shift="1" >6:30 AM</time>
|
||||
<time title="Looney Tunes" type="series" strict-time="false" time-shift="1" >7:00 AM</time>
|
||||
<time title="Looney Tunes" type="series" strict-time="false" time-shift="1" >7:30 AM</time>
|
||||
</everyday>
|
||||
<mondays></mondays>
|
||||
<tuesdays></tuesdays>
|
||||
@@ -15,85 +122,85 @@
|
||||
<saturdays></saturdays>
|
||||
<sundays></sundays>
|
||||
<weekends>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" overlap-max="">8:00 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" overlap-max="">8:30 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" overlap-max="">9:00 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" overlap-max="">9:30 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:00 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:30 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >9:00 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" >9:30 AM</time>
|
||||
|
||||
<time title="Batman" type="series" strict-time="false" time-shift="5" overlap-max="">10:00 AM</time>
|
||||
<time title="Batman" type="series" strict-time="false" time-shift="5" overlap-max="">10:30 AM</time>
|
||||
<time title="Batman" type="series" strict-time="false" time-shift="5" >10:00 AM</time>
|
||||
<time title="Batman" type="series" strict-time="false" time-shift="5" >10:30 AM</time>
|
||||
|
||||
<time title="random" type="movie" strict-time="false" time-shift="5" overlap-max="">11:00 AM</time>
|
||||
<time title="random" type="movie" strict-time="false" time-shift="5" >11:00 AM</time>
|
||||
|
||||
<time title="The Adventures of Pete & Pete" type="series" strict-time="false" time-shift="5" overlap-max="">12:30 PM</time>
|
||||
<time title="The Adventures of Pete & Pete" type="series" strict-time="false" time-shift="5" overlap-max="">1:00 PM</time>
|
||||
<time title="Gilligan's Island" type="series" strict-time="false" time-shift="5" overlap-max="">1:30 PM</time>
|
||||
<time title="Gilligan's Island" type="series" strict-time="false" time-shift="5" overlap-max="">1:40 PM</time>
|
||||
<time title="The Jetsons" type="series" strict-time="false" time-shift="5" overlap-max="">2:00 PM</time>
|
||||
<time title="The Adventures of Pete & Pete" type="series" strict-time="false" time-shift="5" >12:30 PM</time>
|
||||
<time title="The Adventures of Pete & Pete" type="series" strict-time="false" time-shift="5" >1:00 PM</time>
|
||||
<time title="Gilligan's Island" type="series" strict-time="false" time-shift="5" >1:30 PM</time>
|
||||
<time title="Gilligan's Island" type="series" strict-time="false" time-shift="5" >1:40 PM</time>
|
||||
<time title="The Jetsons" type="series" strict-time="false" time-shift="5" >2:00 PM</time>
|
||||
|
||||
<time title="random" type="movie" strict-time="true" time-shift="5" overlap-max="">2:30 PM</time>
|
||||
<time title="random" type="movie" strict-time="true" time-shift="5" >2:30 PM</time>
|
||||
|
||||
<time title="The Wonder Years" type="series" strict-time="false" time-shift="5" overlap-max="">4:30 PM</time>
|
||||
<time title="The Wonder Years" type="series" strict-time="false" time-shift="5" overlap-max="">5:00 PM</time>
|
||||
<time title="The Wonder Years" type="series" strict-time="false" time-shift="5" >4:30 PM</time>
|
||||
<time title="The Wonder Years" type="series" strict-time="false" time-shift="5" >5:00 PM</time>
|
||||
|
||||
<time title="The Simpsons" type="series" strict-time="true" time-shift="5" overlap-max="">5:30 PM</time>
|
||||
<time title="The Simpsons" type="series" strict-time="false" time-shift="5" overlap-max="">6:00 PM</time>
|
||||
<time title="The Simpsons" type="series" strict-time="true" time-shift="5" >5:30 PM</time>
|
||||
<time title="The Simpsons" type="series" strict-time="false" time-shift="5" >6:00 PM</time>
|
||||
|
||||
<time title="Sherlock" type="series" strict-time="false" time-shift="5" overlap-max="">6:30 PM</time>
|
||||
<time title="Sherlock" type="series" strict-time="false" time-shift="5" >6:30 PM</time>
|
||||
|
||||
<time title="Arrested Development" type="series" strict-time="false" time-shift="5" overlap-max="">7:00 PM</time>
|
||||
<time title="Arrested Development" type="series" strict-time="false" time-shift="5" overlap-max="">7:30 PM</time>
|
||||
<time title="Arrested Development" type="series" strict-time="false" time-shift="5" >7:00 PM</time>
|
||||
<time title="Arrested Development" type="series" strict-time="false" time-shift="5" >7:30 PM</time>
|
||||
|
||||
<time title="random" type="movie" strict-time="false" time-shift="5" overlap-max="">8:00 PM</time>
|
||||
<time title="random" type="movie" strict-time="false" time-shift="5" >8:00 PM</time>
|
||||
|
||||
<time title="Band of Brothers" type="show" strict-time="false" time-shift="5" overlap-max="">10:00 PM</time>
|
||||
<time title="Beverly Hills, 90210" type="show" strict-time="false" time-shift="5" overlap-max="">10:30 PM</time>
|
||||
<time title="Band of Brothers" type="show" strict-time="false" time-shift="5" >10:00 PM</time>
|
||||
<time title="Beverly Hills, 90210" type="show" strict-time="false" time-shift="5" >10:30 PM</time>
|
||||
|
||||
<time title="The Flintstones" type="show" strict-time="false" time-shift="5" overlap-max="">11:00 PM</time>
|
||||
<time title="The Flintstones" type="show" strict-time="false" time-shift="5" overlap-max="">11:30 PM</time>
|
||||
<time title="The Flintstones" type="show" strict-time="false" time-shift="5" >11:00 PM</time>
|
||||
<time title="The Flintstones" type="show" strict-time="false" time-shift="5" >11:30 PM</time>
|
||||
</weekends>
|
||||
<weekdays>
|
||||
<default title="Seinfeld" type="series" ></default>
|
||||
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" overlap-max="">8:00 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" overlap-max="">8:30 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" overlap-max="">9:00 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" overlap-max="">9:30 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:00 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >8:30 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >9:00 AM</time>
|
||||
<time title="Garfield & Friends" type="series" strict-time="false" time-shift="5" >9:30 AM</time>
|
||||
|
||||
<time title="talespin" type="series" strict-time="false" time-shift="5" overlap-max="">10:00 AM</time>
|
||||
<time title="talespin" type="series" strict-time="false" time-shift="5" overlap-max="">10:30 AM</time>
|
||||
<time title="talespin" type="series" strict-time="false" time-shift="5" >10:00 AM</time>
|
||||
<time title="talespin" type="series" strict-time="false" time-shift="5" >10:30 AM</time>
|
||||
|
||||
<time title="macgyver" type="series" strict-time="false" time-shift="5" overlap-max="">11:00 AM</time>
|
||||
<time title="macgyver" type="series" strict-time="false" time-shift="5" >11:00 AM</time>
|
||||
|
||||
<time title="boy meets world" type="series" strict-time="false" time-shift="5" overlap-max="">12:00 PM</time>
|
||||
<time title="boy meets world" type="series" strict-time="false" time-shift="5" >12:00 PM</time>
|
||||
|
||||
<time title="full house" type="series" strict-time="false" time-shift="5" overlap-max="">12:30 PM</time>
|
||||
<time title="full house" type="series" strict-time="false" time-shift="5" overlap-max="">1:00 PM</time>
|
||||
<time title="full house" type="series" strict-time="false" time-shift="5" >12:30 PM</time>
|
||||
<time title="full house" type="series" strict-time="false" time-shift="5" >1:00 PM</time>
|
||||
|
||||
<time title="the it crowd" type="series" strict-time="false" time-shift="5" overlap-max="">1:30 PM</time>
|
||||
<time title="the it crowd" type="series" strict-time="false" time-shift="5" overlap-max="">2:00 PM</time>
|
||||
<time title="the it crowd" type="series" strict-time="false" time-shift="5" >1:30 PM</time>
|
||||
<time title="the it crowd" type="series" strict-time="false" time-shift="5" >2:00 PM</time>
|
||||
|
||||
<time title="the office (us)" type="series" strict-time="false" time-shift="5" overlap-max="">2:30 PM</time>
|
||||
<time title="the office (us)" type="series" strict-time="false" time-shift="5" overlap-max="">3:00 PM</time>
|
||||
<time title="the office (us)" type="series" strict-time="false" time-shift="5" >2:30 PM</time>
|
||||
<time title="the office (us)" type="series" strict-time="false" time-shift="5" >3:00 PM</time>
|
||||
|
||||
<time title="friends" type="series" strict-time="false" time-shift="5" overlap-max="">3:30 PM</time>
|
||||
<time title="friends" type="series" strict-time="false" time-shift="5" overlap-max="">4:00 PM</time>
|
||||
<time title="friends" type="series" strict-time="false" time-shift="5" >3:30 PM</time>
|
||||
<time title="friends" type="series" strict-time="false" time-shift="5" >4:00 PM</time>
|
||||
|
||||
<time title="seinfeld" type="series" strict-time="false" time-shift="5" overlap-max="">4:30 PM</time>
|
||||
<time title="seinfeld" type="series" strict-time="false" time-shift="5" overlap-max="">5:00 PM</time>
|
||||
<time title="seinfeld" type="series" strict-time="false" time-shift="5" >4:30 PM</time>
|
||||
<time title="seinfeld" type="series" strict-time="false" time-shift="5" >5:00 PM</time>
|
||||
|
||||
<time title="Futurama" type="series" strict-time="false" time-shift="5" overlap-max="">5:30 PM</time>
|
||||
<time title="Futurama" type="series" strict-time="false" time-shift="5" >5:30 PM</time>
|
||||
|
||||
<time title="Saved by the Bell" type="series" strict-time="false" time-shift="5" overlap-max="">6:00 PM</time>
|
||||
<time title="Saved by the Bell" type="series" strict-time="false" time-shift="5" overlap-max="">6:30 PM</time>
|
||||
<time title="Saved by the Bell" type="series" strict-time="false" time-shift="5" >6:00 PM</time>
|
||||
<time title="Saved by the Bell" type="series" strict-time="false" time-shift="5" >6:30 PM</time>
|
||||
|
||||
<time title="new girl" type="series" strict-time="false" time-shift="5" overlap-max="">7:00 PM</time>
|
||||
<time title="new girl" type="series" strict-time="false" time-shift="5" overlap-max="">7:30 PM</time>
|
||||
<time title="new girl" type="series" strict-time="false" time-shift="5" >7:00 PM</time>
|
||||
<time title="new girl" type="series" strict-time="false" time-shift="5" >7:30 PM</time>
|
||||
|
||||
<time title="random" type="movie" strict-time="false" time-shift="5" overlap-max="" xtra='actor:mike myers genre:comedy contentRating:PG-13'>7:45 PM</time>
|
||||
<time title="random" type="movie" strict-time="false" time-shift="5" xtra='actor:mike myers genre:comedy contentRating:PG-13'>7:45 PM</time>
|
||||
|
||||
|
||||
<time title="the trip" type="series" strict-time="false" time-shift="5" overlap-max="">8:30 PM</time>
|
||||
<time title="the trip" type="series" strict-time="false" time-shift="5" overlap-max="">9:00 PM</time>
|
||||
<time title="the trip" type="series" strict-time="false" time-shift="5" >8:30 PM</time>
|
||||
<time title="the trip" type="series" strict-time="false" time-shift="5" >9:00 PM</time>
|
||||
</weekdays>
|
||||
</schedule>
|
||||
|
||||
Reference in New Issue
Block a user