2011-05-31, 21:08
A first attempt at an HBO GO plugin for XBMC. It's very crude, it requires some editing for it to work. A lot of credit goes to XBMCFlicks and renniej for source and ideas.
I've only tested on Windows while using a Uverse login. It will require more work for providers other than Uverse. First I'll explain how this plugin works:
HBO GO requires you to login everytime you launch a browser in order to watch content. I don't know if this is the case with providers other than Uverse, but I suspect it is.
The way I handle this is very crude. I will try to quickly outline how this plugin works:
You'll need to do the following steps in order to get this plugin to work.
######
Step 1:
######
Make sure XBMC is set up to play .html files as demonstrated by XBMCFlicks here:
http://forum.xbmc.org/showpost.php?p=664064&postcount=2
If you install XBMCFlicks it will be set up.
######
Step 2:
######
Create local login html file.
I tried in vain to dynamicly add javascript to the iframe. Maybe someone else knows how to do it. In the mean time, I just used a local html file.
For users with Uverse, I've included the uverse.html login file. The section you will want to change to add your login credentials is located at:
[0,{userid:'LOGIN@EMAIL',password:'YOURPW'}]
Save the local html file to a path of your choosing, the default I use in this script is:
C:\HBOGO\HBOGO.html
If you choose another filename or path you will need to edit the default.py in your addons/plugin.video.hbogo directory and change the file path in the redirect string to match the path of your local login file.
file:///C:/HBOGO/HBOGO.html
If you have another provider; you'll need to create the autologin page. I find saving the login pages in Chrome is nice since it auto inserts the full path in the form action.
Look at the html source and find the input for the username and password, add a value="YOUR LOGIN NAME" to the username input, and value="YOUR PASSWORD" to the password input, of course replacing with your real credentials. Add any other credentials in the same fashion that your provider may require (Charter requires a zipcode). Insert some javascript at the bottom of the page to autologin. Here are some examples:
<script type="text/javascript" language="JavaScript">
document.forms[0].submit()
</script>
<script type="text/javascript" language="JavaScript">
document.forms["The Form name"].submit()
</script>
<script type="text/javascript" language="JavaScript">
(function(k,f,n){f=document.forms[k[0]];for(n in k[1])f.elements[n].value=k[1][n];f.submit();})({'': [0,{userid:'LOGIN@EMAIL',password:'YOURPW'}]}[location.host]);
</script>
*
TROUBLESHOOTING
*
The first time the plugin is used, you will need to select your provider from the popup drop down list to redirect you to the login page. This will set a cookie, you may have to do this from time to time as the cookie expires.
I've used hardcoded dumb timeouts for the various redirects in the local .html files. These have worked well for me, but you might need to pad the time if the redirects move too fast. The timeouts are in milliseconds. the first redirect waits 12 seconds; the second redirect waits 8 seconds. To change this edit the default.py in your addons/plugin.video.hbogo directory and edit 12000 and 8000 to wait longer.
https://rapidshare.com/files/1718336267/HBOGO.zip
I've only tested on Windows while using a Uverse login. It will require more work for providers other than Uverse. First I'll explain how this plugin works:
HBO GO requires you to login everytime you launch a browser in order to watch content. I don't know if this is the case with providers other than Uverse, but I suspect it is.
The way I handle this is very crude. I will try to quickly outline how this plugin works:
- XBMC scrapes HBO GO for movie information and adds it to its UI, while creating corresponding local .html files that has some javascript and the url of the media source, which is launched in the browser when selected to play through XBMC.
- The local .html file contains an Iframe that attempts to load the media source, but fails.
- HBOGO kindly checks a cookie of your previous selection of service provider and redirects you to login.
- The script uses predefined timeouts to wait and then loads a local login .html file to autologin.
- Finally, you are logged in and then are redirected to the media source which autoplays.
You'll need to do the following steps in order to get this plugin to work.
######
Step 1:
######
Make sure XBMC is set up to play .html files as demonstrated by XBMCFlicks here:
http://forum.xbmc.org/showpost.php?p=664064&postcount=2
If you install XBMCFlicks it will be set up.
######
Step 2:
######
Create local login html file.
I tried in vain to dynamicly add javascript to the iframe. Maybe someone else knows how to do it. In the mean time, I just used a local html file.
For users with Uverse, I've included the uverse.html login file. The section you will want to change to add your login credentials is located at:
[0,{userid:'LOGIN@EMAIL',password:'YOURPW'}]
Save the local html file to a path of your choosing, the default I use in this script is:
C:\HBOGO\HBOGO.html
If you choose another filename or path you will need to edit the default.py in your addons/plugin.video.hbogo directory and change the file path in the redirect string to match the path of your local login file.
file:///C:/HBOGO/HBOGO.html
If you have another provider; you'll need to create the autologin page. I find saving the login pages in Chrome is nice since it auto inserts the full path in the form action.
Look at the html source and find the input for the username and password, add a value="YOUR LOGIN NAME" to the username input, and value="YOUR PASSWORD" to the password input, of course replacing with your real credentials. Add any other credentials in the same fashion that your provider may require (Charter requires a zipcode). Insert some javascript at the bottom of the page to autologin. Here are some examples:
<script type="text/javascript" language="JavaScript">
document.forms[0].submit()
</script>
<script type="text/javascript" language="JavaScript">
document.forms["The Form name"].submit()
</script>
<script type="text/javascript" language="JavaScript">
(function(k,f,n){f=document.forms[k[0]];for(n in k[1])f.elements[n].value=k[1][n];f.submit();})({'': [0,{userid:'LOGIN@EMAIL',password:'YOURPW'}]}[location.host]);
</script>
*
TROUBLESHOOTING
*
The first time the plugin is used, you will need to select your provider from the popup drop down list to redirect you to the login page. This will set a cookie, you may have to do this from time to time as the cookie expires.
I've used hardcoded dumb timeouts for the various redirects in the local .html files. These have worked well for me, but you might need to pad the time if the redirects move too fast. The timeouts are in milliseconds. the first redirect waits 12 seconds; the second redirect waits 8 seconds. To change this edit the default.py in your addons/plugin.video.hbogo directory and edit 12000 and 8000 to wait longer.
https://rapidshare.com/files/1718336267/HBOGO.zip