Channels Helper bookmarklet for working with Manage Lineup

Sure, I should have some time this weekend - I'll see what I can come up with.

3 Likes

I just updated the bookmarklet to include a couple more options. There're now individual Show/Hide toggles for Blocked, Unblocked, Favorites, and/or Unfavorites so you can mix and match as needed.

So for example, assuming you're starting with a clean/fully visible list of channels - you can now easily filter down to only channels that you have not favorited or blocked by doing Show/Hide Blocked Channels (to hide the blocked ones) and then Show/Hide Favorites (to hide the favorites) - leaving you with a list of the ones that are neither.

I also added a reset option to Show all Channels just for convenience.

Let me know what you think-

2 Likes

Worked great, thanks for taking the time to add these options.

2 Likes

Thanks for creating this. Very Nice!

You mentioned you had to query the Pluto API to get the channel descriptions.
They are available at the Channels DVR /devices endpoint as .Description
But only when using the maddox docker, which provides it in the playlist.m3u as tvc-guide-description

/devices/M3U-Pluto/channels for mine

{
  "ID": "pluto-tv-spotlight",
  "GuideNumber": "9001",
  "GuideName": "Pluto TV Spotlight",
  "HD": 1,
  "Station": "pluto-tv-spotlight",
  "Logo": "https://images.pluto.tv/channels/5ba3fb9c4b078e0f37ad34e8/colorLogoPNG.png",
  "Art": "https://images.pluto.tv/channels/5ba3fb9c4b078e0f37ad34e8/featuredImage.jpg?fill=blur&fit=fill&fm=jpg&h=562&q=75&w=1000",
  "Categories": ["Movies"],
  "Title": "Pluto TV Spotlight",
  "Description": "Roll out the red carpet and turn down the lights, because the biggest movies are here on Pluto TV Spotlight."
},

Using the jgomez docker, it's not there.
/devices/M3U-Plutojg/channels

{
  "ID": "pluto-tv-spotlight",
  "GuideNumber": "9000",
  "GuideName": "Pluto TV Spotlight",
  "HD": 1,
  "Station": "5ba3fb9c4b078e0f37ad34e8",
  "Logo": "https://images.pluto.tv/channels/5ba3fb9c4b078e0f37ad34e8/colorLogoPNG.png"
},

Using the maddox docker, the tooltips don't appear for me in Brave, Edge or Firefox, but the Category badges do.

Using the jgomez docker, the tooltips appear, but the Category badges don't. Possibly becasue the maddox docker provides them in the playlist.m3u as group-title and the jgomez docker doesn't.

Any chance you could implement showing Blocked only channels and also Sorting by Pluto Category, then channel name?
EDIT: Duh!, figured out HIDE Unblocked shows only Blocked

1 Like

I had no idea the different dockers pulled the m3u data in different formats. I've just always used Matt Huisman's site. That's wild.

The code expects the Station property to contain the unique GUID for the channel, but it looks like the maddox one has the "slug" in both the ID and Station properties.

Based on this, and the fact that it looks like Description may potentially be there already anyway, I made a small change. It will now check for Description locally, and if it's there, it will just use it. If it's not there, it'll go ahead and try to use the Pluto API.

I don't have a way to test it, but in theory it should work and be a pretty safe/non-breaking change. Can you try it when you get a chance?

I'm still thinking about the approach with the sorting options.

Thanks-

Thank You!
Works great.
Getting tooltips now with both maddox and jgomez docker container sources showing Channel Descriptions.
Also tried on non-Pluto sources and it didn't appear to break anything!

1 Like

I hadn't included the categories as they weren't being used really before (at least not by me) Seeing this I went ahead and included them in the latest update. I can also look at adding the description as well

3 Likes

Very cool!

I added two new sorting options to the bookmarklet:
Sort by Category then Channel Name
Sort by Category then Channel Number

If there's no Category, they'll just fall back and sort only by Name/Number.

Let me know what you think-

1 Like

I'm seeing an issue with the URL for the API pull to populate the descriptions.

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://api.pluto.tv/v2/channels. (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘http://pluto.tv’).
Problem fetching pluto channels listing: TypeError: NetworkError when attempting to fetch resource.

Here's the headers with the CORS for the GET http://api.pluto.tv/v2/channels:

Status 200 OK
Version HTTP/1.1
Transferred 33.35 kB (361.55 kB size)
Referrer Policystrict-origin-when-cross-origin
DNS ResolutionSystem
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
Date: Sat, 13 Apr 2024 16:56:29 GMT
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: Accept,Authorization,Content-Type,If-None-Match,X-Requested-With,X-Request-ID,X-Log-Level-Override,X-Forwarded-For,X-Search-Transaction
Access-Control-Allow-Methods: GET,PUT,POST,DELETE
Access-Control-Allow-Origin: http://pluto.tv
Access-Control-Expose-Headers: WWW-Authenticate,Server-Authorization,ETag
Access-Control-Max-Age: 1728000
Cache-Control: max-age=600, no-cache
Content-Encoding: gzip
Etag: djEvMTcyLjkwLjY5LjEyMi8vLzE3MTMwMjYwMjI2NTkwOTQwMDA=
Vary: Accept-Encoding
X-Connection-Id: 5425ee9a-a23e-40b0-8501-50eb6de97627
X-Request-Id: 7bb51e1b-5ade-40c7-bd6c-8f4b500cf836
X-Cache: Miss from cloudfront
Via: 1.1 92360e9adbf6cc1c5721d7fbaf6aad46.cloudfront.net (CloudFront)

Awesome!
Makes it so much easier to see what I want to block or keep.

Now @joagomez just needs to add group-title to his maddox compatible playlist and i.mjh.nz for those using it

1 Like

So I was finally able to recreate this, but it's a weird one. The Pluto API responds with a different value for the Access-Control-Allow-Origin header if the originating host looks to be from a local network AND contains a port# on the end. You can test this via devtools on any website by simply pasting this into the console:
await fetch('https://api.pluto.tv/v2/channels');

I get a CORS error because Pluto responds with "http://pluto.tv" required pretty much everywhere EXCEPT a site on a local network IP with a port where it responds with current host value. For example:
https://198.168.100.100 -> CORS error; returned http://pluto.tv
https://myserver.local -> CORS error; returned http://pluto.tv
https://google.com -> CORS error; returned http://pluto.tv
https://192.168.100.100:8089 -> NO CORS error; returned https://192.168.100.100:8089

I'm guessing maybe Pluto is doing some kind of dynamic allow-origin for what it assumes is dev purposes maybe if it's a local ip + port?

So my question to you is, what kind of URL are you accessing your Channels server with? i.e. http://192.168.* or an alias, with/without a port#, etc?

1 Like

Now did you use your manners? :blush: (I have young kids can’t resist)

No, seriously did I forget to add it to the compatible version? Sorry will take care of that after my day of kids soccer

1 Like

Please Dad.
Thanks in advance.

update has been uploaded

Thanks, but I'm waiting for v1.10b that has group-title in the maddox compatible playlist

well sonuva... too many compatibles in this one. try now

1 Like

http://<MySynoDomain>.myds.me:8089/admin/settings/status

I've recently changed to use the myds.me domain with a split-horizon DNS so it resolves correctly depending on LAN or WAN access. I had previously used the bare IP address with port. And to confirm your confirmations, accessing the sources channels listings via IP address does show the channel descriptions as intended.

1 Like

Good to know! Sadly, I don't think there's much I can do about the CORS issue as it's really controlled by the API owner (Pluto). I will add a note at the top of the code indicating it's a known issue/limitation.

I'm glad you at least have the option of using the IP/port if you need it. Also, I'm not sure what you're using for your m3u source, but it sounds like some of the guys doing the docker containers are starting to include the description. If it's there locally, the code will just use it and not have to call out to the Pluto API.

Thanks for reporting the issue though!

1 Like