Thursday, September 19, 2013

XBMC Free Cable CBS

As I've mentioned earlier, I like XBMC and the Free Cable plugin,
but it looks like the CBS python script is in a bad place right now.

It's the inevitable future of all HTML scraping code, to be broken.

Attempting to navigate to the CBS channel has a script error with:

File "...\XBMC\addons\plugin.video.free.cable\resources\lib\cbs.py", line 66, in rootlist
categories=menu.findAll('a')
AttributeError: 'NoneType' object has no attribute 'findAll'
The CBS script is looking for a specific element id (daypart_nav) for the menu to build the directory listing options using the 'a' elements under it.

But the cbs.com/video page now redirects to cbs.com/watch with a completely different layout.
So none of the expected elements are found and thus errors.

I looked back in the Wayback Machine archive, to see the original HTML matching the current script (from a month ago).
Since the page has completely changed, the CBS script seems like it needs a major rewrite.

Fall TV shows are starting up soon, so I spent a little time trying to get it working.
So far I did some HTML tree traversal hacking in the python script and got the initial menus.

UPDATE:
Listings of episodes are now working in this version of the script:
http://pastebin.com/xMiF1qV4

UPDATE 9/20:
Apparently I've missed the latest updates on the forum here.
The Free Cable scripts including cbs.py are being maintained and I was able to update to another working version.
At https://home.no/xbmc/shop.html, I grabbed repository.xbmcplus.xbmc-plugins-1.2.zip, under the link for repository.xbmcplus.xbmc-plugins.
Then I just needed to Install from Zip under System - Add-ons, and then update Free Cable (replacing older).

This version includes a loading dialog instead of just hanging while loading the episode list.
But what I don't like is the episode list itself.
For one of the newer CBS shows, I see all episodes listed even though most are not able to play. This same Full Episodes list contains clips (I removed these by checking type and duration starting with 0).
And the display names include 0x0 (I avoided adding if either is 0). Which is partly a problem of where the data is coming from (not from the JSON, but from page parsing). CBS removes videos from being playable (now only through third parties) and their urls redirect back to the show's homepage. Ideally the page parsing would determine if the video is actually playable before adding to listing.

UPDATE Mar 29 2014:
Free Cable is gone, as mentioned on the Free Cable forum, it is now the USTV VoD plugin. Go grab it.

UPDATE Sept 9 2014:
I was using an old version of the xbmcplus addon repository, causing USTV VoD plugin to not be updating (stuck at version 1.0.2).
To fix VoD, I upgraded to the latest xbmcplus repo version from here:
https://github.com/moneymaker365/repository.xbmcplus.xbmc-plugins/releases

Wednesday, July 31, 2013

Mobile gaming, Dead Space

I've gotten really into mobile gaming on my iPhone,
especially the free Dead Space game.

It's good and definitely impressive for a free mobile game. 
This is the type of game I would have expected only for platform or PC not that long ago.
Great graphics and story with cut-scenes, plenty of weapons and upgrades, surprisingly long and without prompts to upgrade to continue playing. Maybe I'm just jaded from the pay-to-play mobile gaming dominating today. All in all, this game is awesome.

At first I wasn't sure about it. I wasn't used to the controls and with a limited weapon I felt helpless.
Thankfully I was on easy mode and so my health was forgiving.

I finally finished the game recently. All went smooth until the last big boss.
I had no idea what to do and found online to hit the yellow spots. After a while of that, it was over, I had won (I guess, sort of).

But then it only got better.

The second time through I kept my weapons and items. I hadn't been able to get up to 200k the first time but easily did the second time through. At the first store I picked up the heavy pulse rifle after selling peng.
Shortly after I had enough to upgrade the suit (RIG). I thought I could take the 90k best, but instead I had to get the first two 30k and 60k upgrades first.
So I had to start saving up again and late in this second run I finally had enough to get the best suit/armor.

Early in the game:


First two suit upgrades (up to level 3) and heavy pulse rifle:



Cut-scene late in the game:




Final (level 4) suit upgrade:

Monday, July 29, 2013

Comic Lover App

I just installed the Comic Book Lover app on my iphone.
I don't have a tablet but this is one of the big reasons I could see getting one, as a convenient digital comic reader. But for now, this is better than sitting at a laptop or desktop.

I was planning to use Google Drive, but when I saw how easy the FTP appeared to be, I tried that first.
Under Transfer -> FTP I found the connection settings for my phone over my wireless router, as IP 192.168.1.2 and port 20000. I left the phone on this view.
In Filezilla, I connected to this IP/port and found an empty directory.
(If failing to connect, disabling and reenabling wireless on iphone seems to help)
I transferred over a test CBR file with drag/drop.
On the iphone, the "Add To Library" button was now enabled.
After clicking it, I saw the message "Finished, 1 comic added to library". Easy as that.

Under the Library, I found the comic listed as (Unknown Series). The metadata tag icon allows setting the title, series, issue #, etc.

The comic reader view looks ok, especially good in landscape view and zoomed in.
Although in this view, when turning the page, it zooms out and then back in on the next page. I don't really like the zoom out and back in, i'd rather have it stay zoomed in and just go to the top of the next page.
Otherwise, I'd say its a nice reader and definitely convenient for me.

Wednesday, July 24, 2013

Star Wars legacy

I finally finished the Star Wars Legacy series.
In the end, I really enjoyed it, especially how all the different story lines came together.

I wasn't quite happy with the final confrontation, a bit anti-climatic. I just expected a longer and more grueling one-on-one battle. But despite that, it was still satisfying. Especially with the tons of action leading up to it.

Wednesday, July 17, 2013

PA DLC USB

Recieved my Penny Arcade usb drive in the mail from the Downloadable Content kickstarter.
It has a flexible rubber-feel cover with the PA DLC logo.
It's 8GB and a little over half filled with:
  • 40 mp3 from the DLC archives (2006-2009)
  • 2 albums from Paul and Storm (Do You Like Star Wars and Learning Town)
  • 1 album from MC Frontalot (Favoritism)
  • 20 mp3 of PAX Q&A from almost all
  • 1 PDF of Book 3 The Warsun Prophecies (circa 2002)
  • 9 sizes of the DLC wallpaper jpg
I think I'll be busy for a while absorbing all of this material.

I've already been keeping up with the new DLC podcasts.
After Google Reader shutdown, I moved over to Feedly and I've been following my usual list of xkcd, penny arcade, table titans, trenches, and blastr. I have a few others that I check occasionally like zero punctuation, lifehacker, and slashdot.

Sunday, July 7, 2013

XBMC DVD

I usually use XBMC on a PC hooked up to the TV with HDMI, usually for streaming or local TV shows.
But with the lull over the summer, I'm popping in a few DVDs from the library.

My first impression with XBMC playing DVDs was
  'Great, a new menu option just appeared to watch DVDs'
and my second impression was
  'This is so slow and choppy it's unwatchable'.

After some internets searching I stumbled across this XBMC forum.
And the solution of changing the audio settings also worked for me.

I had Audio Output set at HDMI and it needed to be Analog.
I did also set the Audio output device to WASAPI - HDMI.

All was well with the world again.
Well other than the fact that I ended up playing DVDs on the PC because the DVD player is only pushing sound and not video.

Wednesday, July 3, 2013

Latest Distractions

Got back to reading more of the Star Wars Legacy comics, finished volume 8.
I've had this on hold for months at the library and didn't get it shipped until I cancelled and re-requested.
Now back to waiting for the remaining issues in the series.

I also finished the Blackest Night hardcover collection, which was just awesome.
Zombified and revived characters, spectrums of rings/corps including black and white lanterns, and well tons of characters.

Gaming on my iphone with Dead Ahead. Outrun and shoot zombies on a scooter.
I'm working on rank 15 savior and just did 18,440m on bridge/nightmare location.
I'm was using just the upgraded super scooter, except for the one challenge i needed to use the quad. Same thing with always using the grenade launcher except for rank challenges where i need to use others (like submachine). The double ammo and fast reload definitely help along with the 2nd chance.

Finished getting caught up in Game of Thrones, Being Human and Californication.
Now watching Defiance on Hulu and starting into Arrow.

Thursday, June 20, 2013

Amazon EC2, Bash, Python, Cloud-Init

I've been messing with Amazon Free Tier services,
spinning up a t1 micro EC2 instance using the Amazon AMI and dumping files in S3.

Originally I was writing up some bash deployment scripts, but today I rewrote that in Python (using the 2.6 version on the AMI). And I tested out running this Python script on startup using cloud-init and pulling the latest version of the script from S3.
This involved setting a bash script as User Data that would download the python script from S3 (aws s3 get-object) and run it as a specific user (with su and -c).

I'm not much of a Python programmer, so I ended up needed to read through the docs a lot, and then re-read through them for the older 2.6 version.

I had intended to use subprocess.check_output, but when this wasn't available I had to switch back to subprocess.Popen. I also found out that the recommendation of sending in a string command (instead of array) for shell=True is more of a requirement.

Although I'm sure the Amazon SDK is available in Python, it's super easy to call from the shell (aws s3 get-object --bucket bname --key kname fileout). This is especially true with a S3 read access IAM role associated with the EC2 instance (so no access/secret keys are needed).

I also found out that zipfile.extractall does not preserve file permissions, so I had to reset with os.chmod.
All in all, just minor issues. And I really appreciated the error handling over writing in bash.
Not that I really got away from bash completely.

I was going to use the #include with S3 HTTP url to the py script in the user-data, until I realized I could just call the same shell Amazon SDK as a bash script. This let me customize where to install the script, setting its owner/permissions, and running it as a specific user.

Now the final hurtle was getting this script to actually run on every boot, which was not the case at first. When I would stop/start the instance, nothing happened.
My impression was that cloud-init was supposed to handle this, parsing the user-data and running scripts there.
I tried to wade through the documentation on cloud-init, but really was getting nowhere until I traced back from the /etc/init.d/cloud-init* scripts.

 

How I got Cloud-Init to run User-Data on every startup:


First I changed the /usr/bin/cloud-init, changing "once-per-instance" to "always" for "consume_userdata".
This didn't work until I noticed the file at /var/lib/cloud/sem/consume_userdata.<instance>. Once I removed that file and restarted, it was recreated with the .always extension.
This at least caused my user-data to be downloaded as a script and stored in the new scripts dir in /var/lib/cloud/data,
But still it wasn't run.
I also had to edit /etc/init.d/cloud-init-user-scripts, again changing "once-per-instance" to "always" but this time for /usr/bin/cloud-init-run-module and user-scripts.
And removed /var/lib/cloud/sem/user-scripts.<instance>.
Finally after stop/start, my Python script was downloaded from S3 and run on startup. Deploy success!


Wednesday, May 8, 2013

Chiptunes

So I was linked to this awesome song, I heard it previously playing Zombie Master.
Now it has made its way onto my phone as a ringtone.

That got me wanting to mod out the old original GameBoy I have sitting around collecting dust.
Since I'm not ready for that yet, I found this cool website PulseBoy to emulate and allow creating tunes online.

Here is my testing mp3 and the source file (for reloading and editing).
It exports as wav, I just made the mp3 using a really old version of Cool Edit Pro I had lying around.

Saturday, April 20, 2013

DC IPhone Game

I'm hooked on the Injustice: Gods Among Us game for IPhone.
I know I look like a madman playing it, furiously tapping the screen, as I was earlier at a craft fair.
It's free to play, a pretty simple matchup fighting game.
Starts off as 3 vs 3 for various DC comics characters.
I have Green Lantern, Sinestro, Nightwing, Catwoman, and Cyborg so far.
At levels between 10 and 13.
And only about 30k credits so far.
I'd like to have Batman and Superman, but I don't feel like dropping the $20-50 to have enough credits for them.
If I played long enough, I should build up enough credits, but that sounds like a while.
Looks like the game is really popular right now, and is making some good money on the style of pay system.
Can't argue that it's fun and well done, nice graphics and released on a variety of platforms (except Android).
I never imagined I'd be gaming so much on my phone, but that changed with SpaceTeam and now this.


UPDATE 4/23:
So my continued playing finally paid off with about the best outcome I could have hoped.
I've been playing a few of the same rounds over, building up my credits and experience.
Then I finally went back and finished the first bonus round.
I'd skipped it once I saw the health on Grundy was too much for me (when teamed up with two other chars).
But I came back and won, getting a bunch of credits (7K) in the process.
It also gave me a new card, the Flash.
I played a few rounds, building up experience for Flash and the remaining credits I needed.
Then I had enough to get the daily discounted Gold booster pack for 75K.
Which gave me one of my top Gold picks of Batman!








UPDATE 4/29:
Picked up my second 25% off (75k) Gold pack today, got Wonder Woman. Not my top pick (I agree her model looks weird). But still a Justice Leaguer, and she can help me advance through the 2nd level. Would be good if I ended up getting Superman as a third. Now to level her up first, which should go fast. Batman is on level 19 now.
NOTE: I had to restart the app to have the discounted Gold pack option reappear.