[REL] TwitchMod - Twitch.TV with extra features


TwitchMod - Twitch.TV with extra features

Donate btc: 1JJD5i4jL5qmbMKCy1sNVGgQzx1Jh37rFH

I did some work on the Twitch channel, since it was pretty lacking in features compared to Kodi.

Extra features from default channel:
* Quality Selection
* Source quality
* Past Broadcasts/Highlights support
* Followed channels
* Search streams/channels/games
* Play subscriber-only VODs.

Tested on:
* PMS Window and Linux
* PHT Windows 8.1, Windows 10
* Android
* iOS
* Plex Media Player

Channel Preferences:
see https://github.com/coryo/TwitchMod.bundle/blob/master/README.md

* Different clients handle quality selection differently.
* Plex for iOS v4 doesn't have inputDirectoryObjects so you cant search.
* Plex Web Client doesn't play streams on certain browsers on certain OSes.
* Plex Web Client doesn't have inputDirectoryObjects so you cant search.

get the zip, extract the bundle to the PMS Plug-ins folder, and rename it to TwitchMod.bundle

latest version: https://github.com/coryo/TwitchMod.bundle/releases/latest
source: https://github.com/coryo/TwitchMod.bundle


So it gets me the list of streams just fine, but it seems to have trouble actually initiating the streams. It loads for a while then tells me "Playback failed"


So I've tracked the error down to being related to the quality settings. If I pick anything but automatic, it doesn't work. I've looked around the code a bit, but I can't seem to find anything that would specifically cause the problem.


@Fireprufe15 What client are you using? I just checked Source and Low quality, which loaded fine on Plex Home Theater.


@coryo123 said:
Fireprufe15 What client are you using? I just checked Source and Low quality, which loaded fine on Plex Home Theater.

My PMS is currently Version, was testing from both Rasplex 0.7.0 and the PHT Desktop client on Windows 10 (should be latest). It does however work on the Android app...so I really have no idea what is going on.


I see this when trying to watch a VOD...

"Cannot load M3U8: crossdomain access denied"

Also,I don't see how to view followed channels, but you mention it above. Maybe I'm missing something?



@chris230291 is that with the web client?

I get "Cannot load M3U8: crossdomain access denied" in google chrome on my win10 pc and macbook. This also happens with the official twitch channel so it isn't just my code. It actually loads in chrome on my iPad and safari on mac, so this is probably just some stupid bug in the web client.

The web client also doesn't have inputDirectoryObjects for some reason. So you can't add a username or use the search feature.


Hi, thanks for the reply.

I just got rid of all the 3rd party Twitch channels I have been trying and reinstalled yours. I still get the error in Chrome (Windows 10) but It works in Edge browser. It also works in Safari on my MacBook. However, on my Xbox it doesn't work. I get this message, "There was an error communicating with your Plex Media Server. Make sure it's turned on and accessible and try again." I am able to navigate through your channel and I only get that message when I try to go into a stream. I assume after this step I would then select to play it (like in the web client)? If so it seems I hit a wall before I even try playing the streams.

I still see no way to view my followed channels. You mention the feature above and I see the icon for it in the .bundle, but I only see "Featured Streams", "Games" and "Search" as options when I open the channel.



I updated the channel so the username entry is in the channel preferences instead of how I was previously doing it. On the web client you can click the Gear icon and enter your username there, then go to Followed Streams in the main menu.

Also for the xbox, you can try changing the quality options in the channel preferences. I wasn't sure how certain clients would handle quality selection. You could try 'automatic' or 'source' instead of 'manual' and that might get them to load. Let me know if one works.


This is working great on my Roku.

Is it possible to add a channels section listing all channels by viewer count like on the site?


I just added a new item in the main menu called 'Top Streams' which will list the current live streams sorted by viewer count. redownload it and let me know if that works.


@coryo123 said:
I just added a new item in the main menu called 'Top Streams' which will list the current live streams sorted by viewer count. redownload it and let me know if that works.

Works great. Thanks!


Awesome. Followed channels etc all working perfectly now. It still throws up errors in in Google Chrome but that doesn't really bother me.

As for the Xbox, no matter which quality I select I still get the same error message as before. Is there anything I can send you that might tell us what the problem is? A log or something?



The relevant logs on the server for the channel would be in Plex Media Server\Logs\PMS Plugin Logs, com.plexapp.plugins.twitchtvmod.log and com.plexapp.system.log.

Try playing both a live stream and a vod on the xbox. On the new iOS client, streams don't work but vods do. If the same kind of thing happens on xbox then it's just a client issue.


Yep. The VOD's play fine it's just the live streams.
So do we just have to wait patiently until Plex updates the client or is there a work around?



I don't think it can be worked around.

Every Plex client needs to properly implement HTTP Live Streaming, which is what Twitch is using for its video. I'm guessing it's a lower priority for the client developers because it's only really used in Channels.


Hi, I have done some improvements myself and are happy with what I have atm, but I was wondering if you have noticed any quality difference between auto and source? Or rather do you feel that source give better quality over auto?


So I still have this problem where my Plex on Android can play quality selected streams perfectly, but on PC and Rasplex it doesn't work at all.

I've checked the logs, the logs when it works on mobile are identical to the logs when it doesn't work on PC. It's like the PC gets the m3u8, but just can't play it. But the mobile can. It doesn't make any sense.


The way HLS works is you first get a 'Master Playlist' m3u8 file. That one has an address to the playlists for each individual quality. 'Auto' mode on my channel returns the Master Playlist. If a client has HLS well implemented it could do adaptive streaming and change the quality depending on network conditions.

I think some of the clients just pick the first quality playlist from the master playlist. My explicit quality options 'source, high,etc..' take the specific playlist from the Master Playlist and give that to the client. This forces it to use only that quality. So the difference between 'auto' and 'source' will depend on how a plex client handles the 'Master Playlist' when its set to auto mode.

It seems like Android is the best so far.
Everything loads fine for me on PHT on Windows. Maybe check the client log on pc and Rasplex?
on windows its at ...\AppData\Roaming\Plex Home Theater on rasplex ~/.plexht/plexhometheater.log


@coryo123 thank you for the technical answer. I'm using the Samsung TV client and it seems to switch between quality automatically. But I will try your version and test for myself.