View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 47 posts ] 
Go to page 1, 2, 3, 4  Next

Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Tue Oct 03, 2006 2:52 pm 
Offline
Joined: Sat Jul 23, 2005 4:15 pm
Posts: 28
Location: Calgary, Canada
Hey i don't know if this is the right place to put this but i just integrated streaming XM Radio through my myth box.
It works through XM's online stream and connects using the username and password specified in the setup. I found the script to connect to the XM service and modified menues to get it working. Not too complicated.

It is ment to work with the Titivillus theme but it could work with any, it just wouldn't get the channel logos.

Here's the link to my install script:
http://mythtv.controlaltdeleted.com/mythXM_installer.sh

Let me know what you think.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 2:14 pm 
Offline
Joined: Thu Sep 30, 2004 11:29 am
Posts: 2419
Location: Mechanicsburg, PA
First of all, THANK YOU for contributing something like this. I didn't even know XM radio had online streaming, and all at once now I know about it and know that it can work in MythTV :) I don't have XM radio, so I can't really test it, but I hope every KM user who has XM radio tries this out and provides feedback.

_________________
KnoppMyth R5.5
MythiC Dragon v2.0
Join the KnoppMyth Frappr!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 2:26 pm 
Offline
Joined: Sat Jul 23, 2005 4:15 pm
Posts: 28
Location: Calgary, Canada
you can get a free 3 day trial on their webpage. I know its not much but its enough to test it out. :lol:


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 2:31 pm 
Offline
Joined: Thu Sep 30, 2004 11:29 am
Posts: 2419
Location: Mechanicsburg, PA
rocky007 wrote:
you can get a free 3 day trial on their webpage. I know its not much but its enough to test it out. :lol:

Cool. Well, maybe we'll do it like a relay race. One tester could sign up for the 3 day trial while the rest of us try it out, then the next person does it, etc.

Have you looked at mythstream? I wonder how easily the XM stuff could be built into it.

_________________
KnoppMyth R5.5
MythiC Dragon v2.0
Join the KnoppMyth Frappr!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 3:27 pm 
Offline
Joined: Fri Nov 18, 2005 9:22 am
Posts: 777
Location: spencerport, ny (USA)
Human wrote:
Cool. Well, maybe we'll do it like a relay race. One tester could sign up for the 3 day trial while the rest of us try it out, then the next person does it, etc.

As a developer of the KRP, maybe you (and others like Cecil, etc.) could petition them for a gratis copy? You deserve it, and it would definitely further their interests.

Next: get Apple to send Cecil a video iPod.....


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 3:49 pm 
Offline
Joined: Sat Jul 23, 2005 4:15 pm
Posts: 28
Location: Calgary, Canada
i did look at it but there is no way to add it dirrectly like a stream becuase it needs the cookie.

It would be really cool if someone could set it up like the recorded programs where the categories are on the left and the channels are on the right or something like that.

Oh and something like that would work im sure until XM got wire because i have 5 devices logged in at the same time at various residences. Except how would you update the login info dynamically in the script.

Here is the script that actually connects to xm and gets the cookie and launches the player:
[code]#!/bin/bash
# You must do: chmod a+rx xmonline.sh
# before you can run this script
# usage: ./xmonline.sh 22`
# usage: xine `xmonline.sh 22`
# Thanks to B. Galliart

# Please set the following variables
# The script will only work with a valid XM Online USER and PASS
USER="[REMOVED]"
PASS="[REMOVED]"
CHAN=$1
RATE="high" # setting for the bit RATE are "low" or "high"
PLAYER="xine -pfq --no-splash"
# Set NO SONG INFO below to 1 to skip getting updates on the song playing
NOSONGINFO=0
UPDATEDELAY=5

### You should not need to modify anything beyond this point

if [ "x$USER" == "xUSER" ] ; then
echo You must modify the USER variable in the script >&2
exit 1
fi

if [ "x$PASS" == "xPASS" ] ; then
echo You must modify the PASS variable in the script >&2
exit 1
fi

if [ "x$CHAN" == "x" ] ; then
echo Must provide a channel number on the command line >&2
echo Such as \"$0 22\" to play channel 22 >&2
exit 1
fi

if [ ! -d $HOME/.xmonline ] ; then
mkdir $HOME/.xmonline
fi

cd $HOME/.xmonline

rm -f xmonline.cookies xmonlinelogin.out xmonlinestream.out xmonlinesong.out xmonlinesong.old
curl -s -c xmonline.cookies -d "user_id=$USER" -d "pword=$PASS" http://xmro.xmradio.com/xstream/login_servlet.jsp > xmonlinelogin.out
EXITCODE=$?
if [ $EXITCODE -ne 0 ] ; then
echo curl error exit value $EXITCODE >&2
exit $EXITCODE
fi

egrep "Invalid email and/or password" xmonlinelogin.out > /dev/null
if [ $? -eq 0 ] ; then
echo Invalid email and/or password >&2
exit 1
fi

egrep "[(]Not .*? " xmonlinelogin.out > /dev/null
if [ $? -eq 0 ] ; then
echo -n "Logged in as: " >&2
egrep "[(]Not .*? " xmonlinelogin.out | sed 's/.*[(]Not //;s/? .*//' >&2
fi
rm -f xmonlinelogin.out

curl -s -b xmonline.cookies -d "" "http://player.xmradio.com/player/2ft/playMedia.jsp?ch=$CHAN&speed=$RATE" > xmonlinestream.out
egrep "xmmediaplayer[.]URL = '" xmonlinestream.out > /dev/null
if [ $? -eq 0 ] ; then
STREAM=`egrep "xmmediaplayer[.]URL = '" xmonlinestream.out | sed "s/.*xmmediaplayer[.]URL = '//;s/';.*//"`
else
egrep "<PARAM NAME=\"FileName\" VALUE=\"" xmonlinestream.out > /dev/null
if [ $? -eq 0 ] ; then
STREAM=`egrep "<PARAM NAME=\"FileName\" VALUE=\"" xmonlinestream.out | sed "s/.*<PARAM NAME=\"FileName\" VALUE=\"//;s/\">.*//"`
else
echo "Error parsing html to find stream URL" >&2
exit 1
fi
fi
rm -f xmonlinestream.out
echo Stream URL $STREAM >&2

$PLAYER $STREAM &
PLAYERPID=$!

if [ $NOSONGINFO -eq 1 ] ; then
exit 0
fi

while [ true ] ; do
curl -s -b xmonline.cookies -d "" -H "Pragma: no-cache" "http://player.xmradio.com/padData/pad_data_servlet.jsp?channel=$CHAN&rnd=$RANDOM" > xmonlinesong.out
egrep "<artist>|<album>|<songtitle>|<channelnumber>|<channelname>" xmonlinesong.out > /dev/null
if [ $? -ne 0 ] ; then
echo "Error parsing html to find song info" >&2
exit 1
fi
if [ -f xmonlinesong.old ] ; then
DIFF=`comm -3 xmonlinesong.out xmonlinesong.old | wc -l`
else
DIFF=1
fi
if [ $DIFF -gt 0 ] ; then
egrep "<artist>|<album>|<songtitle>|<channelnumber>|<channelname>" xmonlinesong.out | sed 's/<\/[a-z]*>//' | sed 's/^..<artist>/ Artist: /' | sed 's/^..<album>/ Album: /' | sed 's/^..<songtitle>/ Song Title: /' | sed 's/^..<channelnumber>/ Channel #: /' | sed 's/^..<channelname>/ Channel Name: /' >&2
egrep "<artist>|<album>|<songtitle>|<channelnumber>|<channelname>" xmonlinesong.out | sed 's/<\/[a-z]*>//' | sed 's/^..<artist>/ Artist: /' | sed 's/^..<album>/ Album: /' | sed 's/^..<songtitle>/ Song Title: /' | sed 's/^..<channelnumber>/ Channel #: /' | sed 's/^..<channelname>/ Channel Name: /' > xmsongnow.out
Here=`cat /home/mythtv/.xmonline/xmsongnow.out`
sleep 10
Xdialog --rc-file /home/mythtv/.xmonline/bluebox.rc --left --title "XM Radio" --no-buttons --infobox "$Here" 800x200 5000
echo
fi
sleep $UPDATEDELAY
mv xmonlinesong.out xmonlinesong.old
( kill -0 $PLAYERPID 2>&1 ) > /dev/null
if [ $? -eq 1 ] ; then
echo Player ended >&2
rm -f xmonlinesong.old
exit 0
fi
done
[/code]


Last edited by rocky007 on Thu Oct 12, 2006 10:12 pm, edited 2 times in total.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 3:54 pm 
Offline
Joined: Sat Jul 23, 2005 4:15 pm
Posts: 28
Location: Calgary, Canada
thornsoft wrote:
Human wrote:
Cool. Well, maybe we'll do it like a relay race. One tester could sign up for the 3 day trial while the rest of us try it out, then the next person does it, etc.

As a developer of the KRP, maybe you (and others like Cecil, etc.) could petition them for a gratis copy? You deserve it, and it would definitely further their interests.

Next: get Apple to send Cecil a video iPod.....


I dont know if this would fly with XM as there is a reason(to them anyway) that people have to pay for it as it is $7.99/month just for the online account(free if you have another xm unit) and im sure they would get wise to what it was being used for. But maybe....

I'm sure(here in Canada anyways) veryone know someone with an xm account that would be willing to let them use their online account.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 4:26 pm 
Offline
Joined: Fri Nov 18, 2005 9:22 am
Posts: 777
Location: spencerport, ny (USA)
rocky007 wrote:
I dont know if this would fly with XM as there is a reason(to them anyway) that people have to pay for it as it is $7.99/month just for the online account(free if you have another xm unit) and im sure they would get wise to what it was being used for. But maybe....

I was talking about doing it all above-board, with the blessing of XM. Do you think the folks building the car radios and such have to pay for the service in order to develop, or do you think maybe they have some free accounts that they hand out to developers who will allow them to futher their reach? For example, suppose Apple wants to put XM into their next iPod. Wouldn't you expect XM to give Apple a free account to use for development? That's what I'm talking about here. XM would be a nice addition to KnoppMyth, not just for us, but for XM! Giving away a few freebies paves the way for thousands of new subscribers.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 04, 2006 4:46 pm 
Offline
Joined: Sat Jul 23, 2005 4:15 pm
Posts: 28
Location: Calgary, Canada
thornsoft wrote:
I was talking about doing it all above-board, with the blessing of XM. Do you think the folks building the car radios and such have to pay for the service in order to develop, or do you think maybe they have some free accounts that they hand out to developers who will allow them to futher their reach? For example, suppose Apple wants to put XM into their next iPod. Wouldn't you expect XM to give Apple a free account to use for development? That's what I'm talking about here. XM would be a nice addition to KnoppMyth, not just for us, but for XM! Giving away a few freebies paves the way for thousands of new subscribers.


Now that you put it that way i would completly agree with you. this is a whole new market that xm could break into with the right development incentives.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 08, 2006 12:59 pm 
Offline
Joined: Sat Feb 05, 2005 3:26 pm
Posts: 121
Location: Calgary, Alberta - Canada!
Thanks Rocky007, im glad I could host your files!

Cheers
Scotty


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 08, 2006 1:03 pm 
Offline
Joined: Sat Feb 05, 2005 3:26 pm
Posts: 121
Location: Calgary, Alberta - Canada!
speaking of vouching (sp?) for the script, it works real well.. Now to get sirius to work as well!!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 09, 2006 2:15 pm 
Offline
Joined: Mon Apr 10, 2006 3:48 pm
Posts: 997
Location: Lexington, Ky
Rocky,

I installed the xm using your script! It installed without a problem. The player works great !!
Quote:
It is ment to work with the Titivillus theme but it could work with any, it just wouldn't get the channel logos.

The only thing I dont get are any channel logos, and I am using the Titivillus theme, but everything else works great. Any thoughts?

By the way if you have an XM radio (in your car or one at home) and a subscription you can use the online one for free.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 09, 2006 2:20 pm 
Offline
Joined: Sat Jul 23, 2005 4:15 pm
Posts: 28
Location: Calgary, Canada
Check your watermark dir under the theme....you should see 4.png - 244.png...they will not all be there sequentually(sp?) but there should be lots....also you must restart the frontend if you have not done so already.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 09, 2006 2:33 pm 
Offline
Joined: Mon Apr 10, 2006 3:48 pm
Posts: 997
Location: Lexington, Ky
Rocky,

Thats what it was, I hadn't restarted the frontend!
I love the visualizations included as well.

If the player wound fade away ....... so it won't burn into the screen.

Is there a switch to hide the player?

Thanks again it's great!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 12, 2006 5:16 pm 
Offline
Joined: Sat Jul 23, 2005 4:15 pm
Posts: 28
Location: Calgary, Canada
[quote]Is there a switch to hide the player? [/quote]

Make your xine line in /myth/xmonline.sh to be
PLAYER="xine -pfhq --no-splash"

That should do it.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 47 posts ] 
Go to page 1, 2, 3, 4  Next



All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu