# Making PseudoTV functionality in Plex

**URL:** <https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868>\
**Category:** General Discussions\
**Created:** [August 25, 2014, 7:09pm UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868 "2014-08-25T19:09:08Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackandjohn](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jackandjohn/32/500_2.png) [@jackandjohn](https://forums.plex.tv/u/jackandjohn)\
**Post date:** [August 25, 2014, 7:09pm UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/1 "2014-08-25T19:09:08Z")

</div>

Hopefully this can be a master thread for all the work that goes in to making PseudoTV work in Plex.

&nbsp;

&nbsp;

Here's the plan so far:

&nbsp;

1. Have PseudoTV read the library from Plex
2. Create a playlist just like it does in XBMC, then update that playlist live in Plex
3. When you want to watch "TV", simply choose the appropriate playlist

&nbsp;

Examples:

- Plex \> Server \> Playlist \> AMC
- Plex \> Server \> Playlist \> Action Movies
- Plex \> Server \> Playlist \> Children's TV

&nbsp;

To keep up with scheduling, the PseudoTV backend could update the playlist regularly, therefore serving the "scheduled" video when the user chooses it.

&nbsp;

&nbsp;

&nbsp;

**Work to be done:**

- Decipher how Playlists work in Plex #It looks like this is all handled in the database
- Connect Library and Playlists to a PseudoTV backend
- Have a way to configure the PseudoTV backend #The obvious choice for this is web, but we're not limited

&nbsp;

&nbsp;

I'm open to moving this discussion to [http://raspberrypihtpc.wordpress.com](http://raspberrypihtpc.wordpress.com) if we get noisy, and in that spirit, anyone who's interested in helping post anything that interesting to you and once the pieces are all on the table, we'll put them together!

&nbsp;

_Edit: When creating a playlist, **there is a wait before the playlist is written to the database file** , so give it 2 minutes or so just to be safe before looking in to it._

---

<div class="post-metadata">

**Author:** ![jackandjohn](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jackandjohn/32/500_2.png) [@jackandjohn](https://forums.plex.tv/u/jackandjohn)\
**Post date:** [August 25, 2014, 7:25pm UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/2 "2014-08-25T19:25:48Z")

</div>

Notes:

Using the same process to access the database as shown on&nbsp;[http://raspberrypihtpc.wordpress.com/how-to/how-to-plex-media-server-change-the-section-icons/](http://raspberrypihtpc.wordpress.com/how-to/how-to-plex-media-server-change-the-section-icons/) , I started digging around the database and found these tables:

- play\_queue\_generators
- play\_queue\_items
- play\_queues

I did not find any files in the Application Support folder that contained the name of the playlist, nor were there any filesystem changes detected when creating a playlist.

Here's an example of an entry for the play\_queue\_generators table where the playlist\_id matches the id from the plex url (in this case "/playlist/5688"):

```
"id","playlist_id","metadata_item_id","url","limit","continuous","order","created_at","updated_at"
"135","5688","1691","",,,"3000","2014-08-25 15:07:08","2014-08-25 15:07:08"
```

Each entry in the playlist seems to have it's own row in this table.

Note: the "metadata\_item\_id" of 1691 looked up in the "metadata\_items" tables matches the episode that is in the playlist.

---

<div class="post-metadata">

**Author:** ![jackandjohn](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jackandjohn/32/500_2.png) [@jackandjohn](https://forums.plex.tv/u/jackandjohn)\
**Post date:** [August 26, 2014, 1:42am UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/3 "2014-08-26T01:42:52Z")

</div>

Since this is all in the database, there are two challenges coming up on the horizon:

1. The PseudoTV backend, if it accesses the database directly, will have to check if the database is locked by Plex, and if it is, to wait until the database is unlocked before locking it to do it's work
2. on XBMC, PseudoTV lets you channel flip through different parts of the show. Plex may not support this yet

---

<div class="post-metadata">

**Author:** ![jackandjohn](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jackandjohn/32/500_2.png) [@jackandjohn](https://forums.plex.tv/u/jackandjohn)\
**Post date:** [August 28, 2014, 2:56am UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/4 "2014-08-28T02:56:36Z")

</div>

One caveat:

It's very easy to corrupt the database while testing things out, and a corrupt database is not always obvious.

-Stopped Plex, added an entry to the play\_queue\_generators table, double-checked the file permissions, and started Plex again

-Plex never complained

-The WebUI and iOS app did not show the deck, but other than that they seemed to work

-No videos played through Plex/Web, iOS, or PlexHT. The Roku app was fine.

I looked for insight in the logs before simply assuming that the DB was corrupt and replacing it with the backup.

Of course, everything was back to normal after that.

---

<div class="post-metadata">

**Author:** ![tobiashieta](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/tobiashieta/32/82153_2.png) [@tobiashieta](https://forums.plex.tv/u/tobiashieta)\
**Post date:** [August 28, 2014, 1:33pm UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/5 "2014-08-28T13:33:14Z")

</div>

A friendly hint. You should not use direct access to the database, we have a API that you can use to create the playlists. You can either 1) watch network traffic from Plex/Web when modifying the playlist to get a sense of it. 2) Look at PHT's source code when it starts supporting playlists (it currently only supports playQueues, which are tied to playlists).

---

<div class="post-metadata">

**Author:** ![agregjones](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@agregjones](https://forums.plex.tv/u/agregjones)\
**Post date:** [August 28, 2014, 2:47pm UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/6 "2014-08-28T14:47:52Z")

</div>

You may also notice that PseudoTV is mentioned in a number of threads in the feature request forum...

---

<div class="post-metadata">

**Author:** ![jackandjohn](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jackandjohn/32/500_2.png) [@jackandjohn](https://forums.plex.tv/u/jackandjohn)\
**Post date:** [September 2, 2014, 2:40pm UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/7 "2014-09-02T14:40:16Z")

</div>

> A friendly hint. You should not use direct access to the database, we have a API that you can use to create the playlists. You can either 1) watch network traffic from Plex/Web when modifying the playlist to get a sense of it. 2) Look at PHT's source code when it starts supporting playlists (it currently only supports playQueues, which are tied to playlists).

Aha! Exactly the kind of information that I was hoping for by posting the first few fumbling steps.

Using the Chrome web tools to watch network traffic while manipulating a playlist, it seems to be fairly straightforward.

In the interests of sharing, here's an example of adding an item to a playlist:

```
items?uri=library%3A%2F%2FPRIVATE%2Fitem%2F%252Flibrary%252Fmetadata%252F5297  
192.168.0.100/playlists/5848  
?X-Plex-Client-Identifier=PRIVATE&X-Plex-Product=Plex+Web&X-Plex-Device=OSX&X-Plex-Platform=Chrome&X-Plex-Platform-Version=39.0&X-Plex-Version=2.2.4&X-Plex-Device-Name=Plex+Web+(Chrome)&X-Plex-Token=PRIVATE&X-Plex-Username=jackandjohn  
162.243.67.114  
3 requests ❘ 1.1 KB transferred  
HeadersPreviewResponseTiming  
Remote Address:192.168.0.100:32400  
Request URL:[http://192.168.0.100:32400/playlists/5848/items?uri=library%3A%2F%2FPRIVATE%2Fitem%2F%252Flibrary%252Fmetadata%252F5297](http://192.168.0.100:32400/playlists/5848/items?uri=library%3A%2F%2FPRIVATE%2Fitem%2F%252Flibrary%252Fmetadata%252F5297)  
Request Method:PUT  
Status Code:200 OK  
Request Headersview source  
Accept:text/plain, _/_; q=0.01  
Accept-Encoding:gzip,deflate,sdch  
Accept-Language:en-US,en;q=0.8  
Connection:keep-alive  
Content-Length:0  
Host:192.168.0.100:32400  
Origin:[http://plex.tv](http://plex.tv)  
Referer:[http://plex.tv/web/app](http://plex.tv/web/app)  
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10\_9\_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2138.3 Safari/537.36  
X-Plex-Client-Identifier:PRIVATE  
X-Plex-Device:OSX  
X-Plex-Device-Name:Plex Web (Chrome)  
X-Plex-Platform:Chrome  
X-Plex-Platform-Version:39.0  
X-Plex-Product:Plex Web  
X-Plex-Token:PRIVATE  
X-Plex-Username:jackandjohn  
X-Plex-Version:2.2.4  
Query String Parametersview sourceview URL encoded  
uri:library://PRIVATE/item/%2Flibrary%2Fmetadata%2F5297  
Response Headersview source  
Access-Control-Allow-Origin:\*  
Access-Control-Expose-Headers:Location  
Cache-Control:no-cache  
Connection:close  
Content-Encoding:gzip  
Content-Length:320  
Content-Type:text/xml;charset=utf-8  
X-Plex-Content-Compressed-Length:320  
X-Plex-Content-Original-Length:489  
X-Plex-Protocol:1.0&nbsp;
```

And here's removing an item from the same playlist:

```
Remote Address:192.168.0.100:32400
Request URL:http://192.168.0.100:32400/playlists/5848/items/194
Request Method:DELETE
Status Code:200 OK
Request Headersview source
Accept:text/plain, */*; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Host:192.168.0.100:32400
Origin:http://plex.tv
Referer:http://plex.tv/web/app
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2138.3 Safari/537.36
X-Plex-Client-Identifier:PRIVATE
X-Plex-Device:OSX
X-Plex-Device-Name:Plex Web (Chrome)
X-Plex-Platform:Chrome
X-Plex-Platform-Version:39.0
X-Plex-Product:Plex Web
X-Plex-Token:PRIVATE
X-Plex-Username:jackandjohn
X-Plex-Version:2.2.4
Response Headersview source
Access-Control-Allow-Origin:*
Access-Control-Expose-Headers:Location
Cache-Control:no-cache
Connection:close
Content-Encoding:gzip
Content-Length:301
Content-Type:text/xml;charset=utf-8
X-Plex-Content-Compressed-Length:301
X-Plex-Content-Original-Length:441
X-Plex-Protocol:1.0
```

And here's deleting a whole playlist:

```
5848
192.168.0.100/playlists
?X-Plex-Client-Identifier=PRIVATE&X-Plex-Product=Plex+Web&X-Plex-Device=OSX&X-Plex-Platform=Chrome&X-Plex-Platform-Version=39.0&X-Plex-Version=2.2.4&X-Plex-Device-Name=Plex+Web+(Chrome)&X-Plex-Token=PRIVATE&X-Plex-Username=jackandjohn
162.243.67.114
2 requests ❘ 202 B transferred
HeadersPreviewResponseTiming
Remote Address:192.168.0.100:32400
Request URL:http://192.168.0.100:32400/playlists/5848
Request Method:DELETE
Status Code:200 OK
Request Headersview source
Accept:text/plain, */*; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Host:192.168.0.100:32400
Origin:http://plex.tv
Referer:http://plex.tv/web/app
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2138.3 Safari/537.36
X-Plex-Client-Identifier:PRIVATE
X-Plex-Device:OSX
X-Plex-Device-Name:Plex Web (Chrome)
X-Plex-Platform:Chrome
X-Plex-Platform-Version:39.0
X-Plex-Product:Plex Web
X-Plex-Token:PRIVATE
X-Plex-Username:jackandjohn
X-Plex-Version:2.2.4
Response Headersview source
Access-Control-Allow-Origin:*
Access-Control-Expose-Headers:Location
Cache-Control:no-cache
Connection:close
Content-Length:0
Content-Type:text/html
X-Plex-Protocol:1.0
```

It looks like the basics for PseudoTV would be:

1. Grab a list of items that are going to be in the playlist, keeping track of the ID of each item
2. Wipe the current Playlist, since it would contain an old schedule (&nbsp;[http://server:32400/playlists/PseudoTVPlaylistID](http://server:32400/playlists/PseudoTVPlaylistID) , Request method DELETE )
3. Recreate the playlist, and populate it with the current schedule (&nbsp;[http://server:32400/playlists/PseudoTVPlaylistID/items?uri=library%3A%2F%2FPRIVATE%2Fitem%2F%252Flibrary%252Fmetadata%252FItemID](http://server:32400/playlists/PseudoTVPlaylistID/items?uri=library%3A%2F%2FPRIVATE%2Fitem%2F%252Flibrary%252Fmetadata%252FItemID) , Request method PUT )

---

<div class="post-metadata">

**Author:** ![crablin](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/crablin/32/84463_2.png) [@crablin](https://forums.plex.tv/u/crablin)\
**Post date:** [September 15, 2014, 9:58pm UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/8 "2014-09-15T21:58:27Z")

</div>

I'm keen to help with this however possible. I've run PseudoTV (and the Live fork) quite extensively in the past and have a good working knowledge of it and Plex. Not sure where this is at just now or if the purpose of this is to feed back to Plex devs, but it's a really great potential addition.

---

<div class="post-metadata">

**Author:** ![FrostyWolf](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/frostywolf/32/83481_2.png) [@FrostyWolf](https://forums.plex.tv/u/FrostyWolf)\
**Post date:** [April 11, 2015, 5:31pm UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/9 "2015-04-11T17:31:17Z")

</div>

So, now that playlists seem to be in full swing in Plex, is anyone working on reviving this?&nbsp;

---

<div class="post-metadata">

**Author:** ![Nick\_Jorens](https://avatars.discourse-cdn.com/v4/letter/n/f1d935/32.png) [@Nick\_Jorens](https://forums.plex.tv/u/Nick_Jorens)\
**Post date:** [February 8, 2016, 3:34pm UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/10 "2016-02-08T15:34:27Z")

</div>

+1  
i second this

---

<div class="post-metadata">

**Author:** ![jackandjohn](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/jackandjohn/32/500_2.png) [@jackandjohn](https://forums.plex.tv/u/jackandjohn)\
**Post date:** [August 31, 2016, 4:48pm UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/11 "2016-08-31T16:48:17Z")

</div>

> @crablin said:  
> I’m keen to help with this however possible. I’ve run PseudoTV (and the Live fork) quite extensively in the past and have a good working knowledge of it and Plex. Not sure where this is at just now or if the purpose of this is to feed back to Plex devs, but it’s a really great potential addition.

Are you still keen to help?  
If so, what do you think would be a good method for how it would work?

---

<div class="post-metadata">

**Author:** ![ampadmos](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@ampadmos](https://forums.plex.tv/u/ampadmos)\
**Post date:** [November 1, 2016, 2:35am UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/12 "2016-11-01T02:35:36Z")

</div>

Really hope this still has traction, would be a killer feature for Plex!

---

<div class="post-metadata">

**Author:** ![warrentc3](https://avatars.discourse-cdn.com/v4/letter/w/91b2a8/32.png) [@warrentc3](https://forums.plex.tv/u/warrentc3)\
**Post date:** [April 27, 2017, 8:18pm UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/13 "2017-04-27T20:18:40Z")

</div>

The way PMS does channels is by web based m3u playlists. The way existing Channels functionality is defined, it doesn’t lend itself to a traditional EPG. The DVR side does have it’s own program guide methodology, but since the conventional cable box program guide layout and functionality is copy-written… it wasn’t used.  
However, it seems to me, the logical thing would be to add some code to leverage existing playlist logic and existing program guide logic, have a streamlined means to a smashing new feature.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 21, 2019, 2:49am UTC](https://forums.plex.tv/t/making-pseudotv-functionality-in-plex/74868/14 "2019-12-21T02:49:56Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
