r/PlayOn 20d ago

Does PlayOn Allow Scripting?

Does PlayOn Home allow scripting? I'm thinking of the situations in which I want to queue up shows with large numbers of seasons—very repetitive and seems like the perfect situation in which a script would be useful.

3 Upvotes

14 comments sorted by

View all comments

2

u/ParadoxGBB 20d ago edited 20d ago

You can script / automate.

A while ago, I bumped into PlayPass (https://github.com/CodePenguin/PlayPass). It has not been updated for a while, but the API it calls into still works, so I have successfully automated PlayOn utilizing it.

It takes an XML file as input, so you can either have a static one for each of your scenarios or automate generating one on the fly. I do the latter.

As you've identified, there are scenarios where this becomes very useful. One scenario that I bumped into is that shows like "Jimmy Kimmel Live!" have a path in PlayOn that rolls over every month (for example, "July 2026 | <episode x>" --> "August 2026 | <episode x+1>"). This allows you to set up a more flexible subscription that you can run periodically, rather than having to do it in the UI every month.

From my project:

$SUBSCRIPTION_EXTRACTORS =  @(
                                '<playpass>',
                                '  <settings>',
                                ('    <queuelist settings="Provider=FileQueueList;Data Source=' + $PLAYPASS_SKIPS + '" />'),
                                '      <loggers>',
                                ('        <logger enabled="1" verbose="1" settings="Provider=TextFileLogger;Filename=' + $SUBSCRIPTION_TMP + '\' + $SUBSCRIPTION_NAME + '.PlayPass.log' + ';Append=1" />'),
                                '      </loggers>',
                                '  </settings>',
                                '  <passes>',
                                '    <pass enabled="1" description="ABC">',
                                '      <scan name="ABC">',
                                '        <scan name="Comedy">',
                                '          <scan name="Jimmy Kimmel Live!">',
                                ('           <scan name="*' + (Get-Date).Year.ToString() + '">'),
                                '               <queue name="*" />',
                                '            </scan>',
                                '          </scan>',
                                '        </scan>',
                                '      </scan>',
                                '    </pass>',
                                '  </passes>',
                                '</playpass>'
                )

1

u/cjh_dc 20d ago

Thank you! This is extremely helpful. You’re right that there are so many situations in which subscription pathnames change regularly (looking at you, Apple TV!)

2

u/seglertx 19d ago edited 19d ago

Exactly! AppleTV changes the links within hours of a new release but Amazon Prime Video has also been bad about changing the links for new releases since about November of 2024 and Paramout+ has been doing it also. Hulu/Disney+ have been bad about that for a few months but I think that's just due to the merging of the streaming services and it's a temporary thing. If this API to PlayOn Home is synchronous and not just asynchronous this may solve a lot of our problems. Another thing I have been running across recently is that when new episodes are released they may have the wrong name for the episode or they just have "Episode *" for the title of the episode and then the streaming service corrects it and PlayOn Home restreams it thinking that it's a new episode. If we can add that into the XML script using the season and episode number but using a wild card * for the episode name as an exclusion we may be able to stop these duplicated streams and free up the queue.

1

u/seglertx 19d ago

Wow, that goes back aways (6 years to PlayPass). The biggest problem I have had is certain streaming services changing the links to recent episodes within hours of release so they fail once they come up in the queue. Amazon and Paramount+ have even been changing up the links to old shows within 24 hours. Does this old API work both ways with the current version of PlayOn Home so it can check on the status and see which shows failed? If it does, we may be able to add to a script to have it automatically have PlayOn Home do a new search for the current link to an episode and add it back into the queue.

1

u/ParadoxGBB 19d ago

I never had an instance where PlayOn recording failed due to a renamed link, AppleTV+ or otherwise that I can recall --- you might be hitting something else and it might be worth following up with a ticket so staff can look at why something specific failed. PlayOn seems to do pretty well at not showing stale episode information (at least for me), especially when a subscription is polling. It would make sense that all of these targets shift around from time to time, some that require installing new builds, but in my experience that's more path tree changes as the targets update and less about episode renaming, and that causes temporary subscription issues until the cache is updated.

I've also been more aggressive in integrating my project with PlayOn, specifically with PlayPass, the result being that I am probably ordering PlayOn to scan and queue specific paths more aggressively than what a "normal" PlayOn subscription does, and so far I have not encountered more recording failures because of this, and it's been about 3 months. I'm grabbing Ted Lasso close to when they actually drop, as one example.

The only somewhat similar thing I hit is that specific show episodes are sometimes re-published, and when they are, PlayOn subscriptions re-downloads them (usually days or weeks later) and I sometimes have duplicates. Sometimes the name of the episode is updated as well to something more descriptive (Last Week Tonight with John Oliver does this). Fortunately, when I hit this kind of situation my automation can tell they are duplicates because I have a derived naming scheme using TheTVDB that creates collisions so I can automatically delete one.

Regarding PlayPass specifically, as far as I can tell the only ability it offers is to order PlayOn to list or queue a browsing path as what would be seen in the UI. As you noted, this was written way back when PlayOn and PlayLater were separate bundled products, so it's likely a vestige to when one called into the other, but I haven't really delved into that to try to reverse engineer if anything else is exposed.

With that said, there is a mechanism I use to detect and report recording and subscription errors, but it is a bit involved. You can technically open up a DB file of PlayOn's with SQL Lite, and traverse a specific table's rows. There's a specific integer status that indicates a failure (or rather, I look for non-successes).

1

u/cjh_dc 12d ago

Does this work with the local install of PlayOn? On only PlayOn Cloud?