1. Xyplorer 12.0 or better. Previous version may work but were not tested.
2. LIVESTREAMER 1.7.2 - https://github.com/chrippa/livestreamer ... tag/v1.7.2
3. VLC.exe 2.0.0 or better. - http://www.videolan.org/vlc/
How to run this script:
1. Place Twitch 2.0.xys into the <xypath>\Data\Scripts folder.
2. Create a catalog entry or custom toolbar button to start script
For catalog entry use -> ::load Twitch 2.0
3. Complete the configuration wizard. This appears on your first launch of script
CURRENT VERSION: 2.0
Code: Select all
Twitch.xys 2.0 Changelog: + Twitch service now uses HLS http streaming for video distribution. This is supported now though livestreamer + You need to install livestreamer (portable app, just like rtmpdump) + Delete your twitch.ini and launch the script. Configuration wizard works as usual + Supports Source, High, Medium, Low, and Mobile resolutions just like the website or iOS and Android apps. - RTMPdump is no longer used
Code: Select all
Twitch.xys 2.0 Known Issues: > If you get error: "Can not find file: $g_LocationFileSWF", Delete Twitch.ini in your <xyscripts> folder and run the script again. The configuration wizard will appear and after you configure the script again it will work.
UPDATE:: 1.4 - 26
Code: Select all
Twitch.xys 1.4 Changelog: + Added support for new Twitch quality settings: Source (Live), High (720p), Medium (360p), and Low (192p).
Code: Select all
Twitch.xys 1.3 Changelog: + NEW: "List Featured Streams" allows you to pick a stream that is featured by Twitch.tv + NEW: Configuration options in section [Options] of Twitch.ini > OPTIONS: > ShowRtmpConsole= // Set value to 1 to display Rtmpdump command line window. Set value to 0 to hide window > MaxGames=50 // Set value to multiple of 50 (E.g. 150, 300). Defines amount of games retrieved by "List Top Games" function > MaxChannels=100 // Set value to multiple of 100 (E.g. 400). Defines amount of channels retrieved by "List Top Channels" function > Use "Edit Configuration" to launch notepad and edit the ini file > !!!WARNING!!!: Increasing these values above the default can drastically increase the time the script needs to retrieve your data. This depends on the speed of your internet connection and the actual load on the Twitch server. * Changed script function names from "Show..." to "List..." * Implemented correct code quoting syntax, see forum discussion here: http://www.xyplorer.com/xyfc/viewtopic.php?f=2&t=9942 - Removed deprecated/bloat code - Removed support for 144p resolution. This was due to confusion with Youtube, Twitch simply has no 144p stream.
Code: Select all
Twitch.xys 1.3 functions: 1. List Top Games - Shows a list of the current top Games on Twitch. Select a game to see the current streamers. - Amount of games shown is determined by the MaxGames option 2. List Top Channels - Shows list of the currently most viewed channels on Twitch - Amount of channels shown is determined by the MaxChannels options 3. List Featured Channels - Shows a list with the currently featured streams on Twitch 4. List Followed Channels - If you entered your username during the configuration wizard, this shows a list of channels you are following and are currently LIVE - Unintended side-effect: Enter the channel name of any streamer on Twitch to see a list of channels THEY are following 5. List Recently Watched - Shows list of channels you have recently watched and are currently LIVE 6. Enter Channel Name - Enter a channel name to watch it immediately 7. Edit Configuration - Opens the configuration file in notepad - Use this function to edit the script Options directly
Code: Select all
Twitch.xys 1.2 Changelog: + Added support for 240p and 144p resolutions + !!!Followed Channels and Recently Watched channels now only show channels that are currently LIVE!!! * Fixed problem where rtmpdump would indicate Twitch server sent error * Cleaned up code syntax to give code a uniform look * Fixed issue where bad quoting caused rtmpdump to quit - Removed support for iphonehigh and iphonelow resolutions Mobile platform resolutions are no longer supported by Twitch through their regular content delivery network
After a couple of months Twitch.xys has reached 1.1! I have implemented a few major improvements, the biggest one being the script will now work indefinitely whereas previous versions stopped working after a few weeks for a reason that has only recently been cleared up.
In all previous versions I used a hardcoded Flash URL that leads to the Twitch.tv embedded flash player. This URL is required by Rtmpdump.exe to authenticate with the Twitch video server. I did not know that these Flash URLs expired after "x" amount of uses!. This explains why the script would work fine for a week or two and then suddenly stopped working. We basically ran out of uses on the hardcoded Flash link.
1.1 contains new code that automatically retrieves a new Flash link for the script. This means the script should now run without time limitation!
Unfortunately, I found I was running into the limits of what Xy could do scripting-wise. because of this, the script will actually create a small VBS script to retrieve this Flash link and return it to Xy. The VBS code is posted below for clarity and can be found in the "_ParseConstruct" sub routine of the script. The VBS code works using Windows resources and requires no input from you as user at all.
This VBS code is used to retrieve the Twitch Flash Link
Code: Select all
Dim req Set req = CreateObject("WinHttp.WinHttpRequest.5.1") req.Option(6) = False ' No redirects' req.open "GET", "http://www-cdn.jtvnw.net/widgets/live_embed_player.swf", False req.send Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile("$g_LocationFileSWF", True) a.WriteLine(req.getResponseHeader("Location")) a.Close
- Fixed a problem with Top 100 channels only showig you Top 25
- Rtmpdump command console window is now shown again. I hid it in previous version but found it is nice to have on a slow connection where the initial buffering of the video takes time. Without the window being displayed it sometimes appeared as if nothing was happening.
- Perhaps important to note: The script can not get access to streams that are behind a pay wall. These are usually only for big events such as MLG. If these events have free lower quality version available the script will however be able to let you watch those.
- I manually hard-coded the new Flash link for Twitch.tv. The script is now fully functional. This flash link changes from time to time and I'm working on making this update automatic.
- Implemented a fail-safe data retrieval system that keeps querying the Twitch server for stream information
until it receives a valid response. This means Empty quality lists are now fixed.
- Script files will now always be stored into your Xypath scripts folder even if you use a non-standard Xyplorer folder configuration.
- Update 0.5.1 - All games are now supported including games with a colon (:) in the title.
Known issues and bugs current version: 0.5.1
- VLC starts after you select a quality setting for your desired stream. It may take a few seconds for your stream to start playing as rtmpdump is buffering the video feed in the background. The rtmpdump window does not appear giving the impression nothing is happening. Depending on the speed of your internet connection this initial buffer can be very short or a bit longer. Please do not close VLC, your video is coming!
- The Followed Stream feature shows you the first 50 streams you are following. It does not indicate if they are online. That would take too much time querying the Twitch servers.
- If you use the "Recently Played" feature to attempt to watch a stream that is currently not live the script will get stuck into an endless loop and the only way to exit it is to end the Xyplorer.exe process. This is an unfortunate side-effect that only became apparant to me after publishing 0.5.1 BUT it will be fixed when the new Xyplorer version is released that allows for downloads without byte check. In the meantime, don't use try to watch streams that are not live, it will not work.
- Script now uses a configuration file nested in the Xyplorer scripts folder.
- Configuration wizard on first start makes it easy to configure your script
- Completely redesigned regular expressions. performance increase up to 50%.
- No more duplicate entries in stream list thanks to new regex.
- The RTMPdump command prompt is no longer shown. Only VLC will appear after you select a streamer and quality. After a few seconds the stream will begin to play!
- I believe Twitch may be denying user requests to their API if they follow too quickly upon each other. When selecting a Channel through the script there is a lot of querying going on in the background to show you available quality levels. Sometimes the list of available quality levels will show up empty. This is NOT a script issue. You may have to try a few times before you get a response from Twitch.
Twitch has been pretty buggy lately. Well it has always been but more so in recent times. I believe they are implementing new features on their servers and are running into capacity problems. Unfortunately this means bugs will appear even after my script was tested and deemed stable. If you find anything let me know. I appreciate Twitch is a start-up company but their engineers certainly love to push out code and test later.
- Checking of online status for Followed streams can be very slow especially if you follow more than 50 channels. This bottleneck is with Twitch's API and beyond my control
- Rewrite of the code
UPDATE 0.2.2 (09/03/2013) - 15
- Removed orange triangles in Games and Streamer selection list
UPDATE 0.2.1 (04/03/2013)
- Small maintenance update to make script compatible with new Twitch.TV API
- Slightly faster regEx (Special thank you to forum users Highend and Marco)
- known issue: Target mode may fail for certain streams at certain qualities due to Twitch.TV using legacy API responses for some streams. This will disappear over time as all streamers are moved onto the new API system.
UPDATE 0.2 (24/02/2013)
- All files created by this script (WGET.TMP and VLC.BAT) are now deleted automatically. No more garbage
- Script now uses Xyplorer native function to download information from the Twitch API. No more wget required
- TARGET MODE implemented. Already know exactly what streamer you want to watch? Just type in the channel name and available qualities will be displayed for you automatically