[REQUEST] CTV/TSN/Comedy Network Plugin?
#46
This is a greatly appreciated plugin. Thanks andre_pl! looking forward to seeing more Canadian content.
Reply
#47
Thumbs Up 
Eldorado Wrote:Woo hoo!

Maybe a new repository should be setup specifically for Canadian content addons?

I second that motion! Big Grin
Reply
#48
mcpish Wrote:It works, except the FULL GAMES. All of the highlights sections work, but not "Championship Curling on demand" nor "Canada Games 2011 On demand", even though there is stuff in those sections on the TSN broadband website, on XBMC when you go into those particular menus they are empty.

Oops, I was cleaning up my code before I put it on googlecode and I guess I cleaned it up a little too much. I just fixed the bug and updated the plugin. Uninstall, and re-install, and the curling ondemand and canada games on demand should work.
Reply
#49
Hey guys,
I have an alpha version of the plugin ready.

http://www.brosemer.org/~odin/repository.andrepl.zip

the above zip file will add a repository to XBMC from which you can install the CTV Plugin.

It works for CTV and most of TSN, you might be able to watch some stuff on the comedy network too, however, there are a lot of broken videos and I could use some help with them.. the problem is in the "mangling" of the urls which are returned from the esi script into something that can be played by xbmc. for CTV the translation looks something like this:

Code:
rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2011/02/17/BLEEPMYDADSAYS-2J5668-EP-CLIP01.mp4?auth=dbEaLduacaddXc3aKbkacb4boa2b1did9at-bnCSh3-eS-iYG-vxE1plGDw&aifp=v001&slist=/s_!ctv/shows/2011/02/17/

TO
rtmp://cp45924.edgefcs.net/ondemand?ovpfv=2.1.4&auth=dbEaLduacaddXc3aKbkacb4boa2b1did9at-bnCSh3-eS-iYG-vxE1plGDw&aifp=v001&slist=/s_!ctv/shows/2011/02/17/ playpath=mp4:s_!ctv/shows/2011/02/17/BLEEPMYDADSAYS-2J5668-EP-CLIP01

an example of a problematic video can be found at The Comedy Network -> The Daily Show -> Correspondents -> Lewis Black. the url we get back is quite different, and passing it through the same mangling process as the above url doesn't appear to work:

Code:
rtmpe://cp21596.edgefcs.net/ondemand/mtvnorigin/gsp.comedystor/com/dailyshow/TDS/season_16/episode_018/ds_16018_03_512x288_825.mp4?__gda__=1299366820_cec480a63105d30674534a6093360762

TO

rtmp://cp21596.edgefcs.net/ondemand?ovpfv=2.1.4&__gda__=1299366820_cec480a63105d30674534a6093360762 playpath=mp4:mtvnorigin/gsp.comedystor/com/dailyshow/TDS/season_16/episode_018/ds_16018_03_512x288_825

^^ Doesn't work

If anyone's able to figure out the proper way to mangle these urls we can get a lot more video's playing.
Reply
#50
andre_pl Wrote:Hey guys,
you might be able to watch some stuff on the comedy network too, however, there are a lot of broken videos and I could use some help with them.. the problem is in the "mangling" of the urls which are returned from the esi script into something that can be played by xbmc

Check out a quick Perl hack at http://pastebin.com/bk25b575 and you'll see you're doing it right except you have to pass swfUrl as well, otherwise the other end shoots back an access denied. I don't know how to do that in python or XBMC's plugins library, but I hope that's as straightforward as it is with rtmpdump.

-Dan
Reply
#51
Eldorado Wrote:Woo hoo!

Maybe a new repository should be setup specifically for Canadian content addons?

There is one that works for Plex. I wonder if it would also work for XBMC? It has a lot of options including the Food network, Global, etc ....

philip
Reply
#52
bolverk Wrote:Check out a quick Perl hack at http://pastebin.com/bk25b575 and you'll see you're doing it right except you have to pass swfUrl as well, otherwise the other end shoots back an access denied. I don't know how to do that in python or XBMC's plugins library, but I hope that's as straightforward as it is with rtmpdump.
-Dan

Thanks Dan,
That works perfectly, new version of the plugin is ready to be pulled to your repository.
Reply
#53
Version 1.1.3 is up with working ComedyNetwork. Thanks, andre_pl!
Reply
#54
I've started a thread for my CTV Properties plugin, please direct support/feature requests there.

http://forum.xbmc.org/showthread.php?tid=96076
Reply
#55
I can't believe I didn't notice this earlier!! I just spent two hours playing around with it, and only managed to figure out about half of that.

Thanks a ton. I'm definitely planning to implement CBC and Global, at which point I'll probably have to rename the plugin.

teefer22 Wrote:Wow, that sure didn't take you long. Good work andre_pl. I was working on the TSN.ca one a little bit yesterday but definitely didn't finish.

Since you were so good at that, I'm going to post how to get the links for cbc.ca and globaltv.ca.. Just in case you feel like making any more plugins. Smile


Here is how to get the rtmp for globaltv.com:
First, we need the link from your browser:
http://www.globaltv.com/video/full+episo...1812768546

Inside the html of that page you will find this piece of code. What we want is the PID:
<script type="text/javascript">
var embed_vars = {
pid: "_X8TGqDQ62nnBowQOnYA5kcHIuS58lRv",
contentID: "1812768546",
show: "Survivor",
season: "22",
episode: "2",
se: "S22E2:",
cliptitle: "you+own+my+vote"
};
</script>


Put the pid into this link:
http://release.theplatform.com/content.s...cHIuS58lRv

and that will return a document with this in it:
<switch>
<video src="rtmp://cp90709.edgefcs.net/ondemand/video/Survivor2202_lowest_16x9.mp4" system-bitrate="447277" width="400" height="224" type="video/mp4"/>
<video src="rtmp://cp90709.edgefcs.net/ondemand/video/Survivor2202_low_16x9.mp4" system-bitrate="647304" width="400" height="224" type="video/mp4"/>
<video src="rtmp://cp90709.edgefcs.net/ondemand/video/Survivor2202_medium_16x9.mp4" system-bitrate="850244" width="852" height="480" type="video/mp4"/>
<video src="rtmp://cp90709.edgefcs.net/ondemand/video/Survivor2202_high_16x9.mp4" system-bitrate="1252684" width="852" height="480" type="video/mp4"/>
<video src="rtmp://cp90709.edgefcs.net/ondemand/video/Survivor2202_highest_16x9.mp4" system-bitrate="2419958" width="1280" height="720" type="video/mp4"/>
<ref src="rtmp://cp90709.edgefcs.net/ondemand/video/Survivor2202_lowest_16x9.mp4" title="You Own My Vote" author="Global" abstract="On Ometepe, Phillip tries to repair the damage after his outburst at the last Tribal Council. So he tells Rob that he will do whatever and vote for whoever he says. Later, Rob sees Matt with Andrea and plans to break up the duo knowing how powerful a couple can go." copyright="© Canwest Broadcast Entertainment" dur="2579736ms" width="400" height="224" guid="h1OBBD79dDfp345_knDVPM5y4KT5ebY7" provider="Canwest Broadcast Entertainment" categories="GlobalTV,GLOBVC3,GLOBVC3/Shows/Survivor/Full Episodes,MOBGLOB/Survivor%3A Redemption Island,MOBGLOB/Survivor%3A Redemption Island/Full Episodes,z/Global Show - Survivor,z/Global Video Centre,z/Mobile GlobalTV" keywords="Entertainment;Programming" type="video/mp4" tp:ChapterEndTimes="00:07:36,00:12:39,00:21:49,00:31:17,00:42:12" tp:ChapterStartTimes="00:07:36,00:12:39,00:21:49,00:31:17,00:42:12" tp:Clip_Type="episode" tp:Episode="2" tp:MobileRotatorActionType="Show" tp:Network="Global" tp:Season="22" tp:Show="Survivor" tp:Subject="Entertainment" tp:Web_Exclusive="No" tp:dpcjobid="142304" tp:isHD="true" tp:mDialogIngestSuccess="true" tpConfusedyndRODO="true"/>
</switch>
<switch>

The rtmp links are right there for you, no auth codes or anything tricky. And those links will stay valid for months (even after globaltv.com removes the link from their website).


Here is how to get the rtmp for cbc.ca/video

we will use this link as an example:
http://www.cbc.ca/video/#/Shows/12212543...1817810978

first we need to get the "ID" (1817810978 in this example) from the original http browser location. Then we need to put that ID in the next link. This will give us the real PID.
NOTE: the PID below (_DyE_l....) is the same for every cbc.ca link, it does not identify the video
http://cbc.feeds.theplatform.com/ps/JSON...1817810978

that will return this line: (What we want is the PID (this is the real PID this time))
{"context":"","listInfo":{"itemCount":1,"totalCount":1},"items":[{"PID":"MBboAGCCmaL97NWHlbkucTYjEVwfC5Uz","title":"Episode 102"}],"removedIDs":[]}

#We now have the real PID, we can now enter that PID into the url below to get the rtmp and playpath locations
http://release.theplatform.com/content.s...YjEVwfC5Uz

That will give us this:
<meta base="rtmp://cp37429.edgefcs.net/ondemand/?auth=daFaEaBa6cXdxd2bKaHbwbvdFcPcvcrccaz-bnz8oN-b4-lks_Ksw1xmGpDAy&amp;aifp=v0001&amp;slist=netstorage" />
</head>
<body>
<ref src="netstorage/George_Strombo_Tonight_102_2155-2-24-2011.flv" title="Episode 102" author="George Stroumboulopoulos Tonight" abstract="Best of Show with Jim Parsons and John Leguizamo." copyright="© CBC Production" dur="1467104ms" width="640" height="360" guid="7I3gl5O1DHC9GcYIp3WGiLju3upag8NV" provider="CBC Production" categories="Shows/George Stroumboulopoulos Tonight,Shows/George Stroumboulopoulos Tonight/Guests,Shows/George Stroumboulopoulos Tonight/Season 7" keywords="George Stroumboulopoulos, George, George Tonight, Strombo, George Stroumboulopoulos Tonight, Jim Parsons, John Leguizamo," tp:Account="Entertainment" tp:AdCategory="george" tp:AdSite="cbc.george.ca" tp:Aired="true" tp:AudioVideo="Video" tp:AvailableInHD="(not specified)" tp:BylineCredit="CBC/Radio-Canada" tp:CBCPersonalities="George Stroumboulopoulos" tp:Camera="(not specified)" tp:ChapterStartTimes="10:01, 13:41" tp:ClipType="Full Program" tp:CommentsEnabled="Yes" tp:EpisodeNumber="102" tp:FeatureImage="http://thumbnails.cbc.ca/maven_legacy/thumbnails/George_Strombo_Tonight_102_2155-2-24-2011_444x250__559856.jpg" tp:Genre="Entertainment" tp:LiveOnDemand="On-Demand" tp:Region="(not specified)" tp:RelatedURL1="George Stroumboulopoulos Tonight website|http://cbc.ca/strombo/|_blank" tp:SeasonNumber="7" tp:Show="George Tonight" tp:Sport="(not specified)" tp:Subtitles="No" tp:adRules="2_2_0"/>
</body>
</smil>

what we want is:
rtmp://cp37429.edgefcs.net/ondemand/?auth=daFaEaBa6cXdxd2bKaHbwbvdFcPcvcrccaz-bnz8oN-b4-lks_Ksw1xmGpDAy&amp;aifp=v0001&amp;slist=netstorage

netstorage/George_Strombo_Tonight_102_2155-2-24-2011.flv

transform that into (notice i removed the ampWink:
rtmp://cp37429.edgefcs.net/ondemand/?auth=daFaEaBa6cXdxd2bKaHbwbvdFcPcvcrccaz-bnz8oN-b4-lks_Ksw1xmGpDAy&aifp=v0001&slist=netstorage playpath=netstorage/George_Strombo_Tonight_102_2155-2-24-2011
Reply
#56
andre_pl Wrote:I can't believe I didn't notice this earlier!! I just spent two hours playing around with it, and only managed to figure out about half of that.

Thanks a ton. I'm definitely planning to implement CBC and Global, at which point I'll probably have to rename the plugin.

Awesome! Great work on the CTV+ plugin. I'm so pumped to hear you are going to work on global and cbc next. Just a heads up on the CBC, any of the live sports have an oddball rtmp string.. If I get a chance next time there is a live streaming hockey game, I'll see if I can figure out how to get it to play in xbmc and post back.

I actually figured out the how to find the rtmp for ctv, global and cbc because I wrote a processors for navi-x for global, cbc, and ctv's family but then realized that making a scraper for navi-x was too hard (for me) and had a serious lack of documentation and examples so I then started looking at making a plugin like this in xbmc (also hard (for me at least) but at least there is tons of examples).

Again, thanks for doing this. Great work.
Reply
#57
teefer22, maybe you can help with this one:

I'm trying to get the rtmp URL to use for live streams on TSN. There's one today at 2:30pm Eastern under Championship Curling on Demand / Tim Horton's Brier Live.

Here's what I've captured that flash sends:
Code:
app: live?ovpfv=2.1.4
flashVer: WIN 10,2,152,26
swfUrl: http://watch.tsn.ca/Flash/player.swf?themeURL=http://watch.tsn.ca/themes/TSN/player/theme.aspx
tcUrl: rtmp://cp52820.live.edgefcs.net:1935/live?ovpfv=2.1.4
pageUrl: http://watch.tsn.ca/#clip428645
Playpath: TSN-LIVE33-FLASH@37547

But I'm having no luck. I've got the following rtmpdump commandline to send *exactly* that, but it's not finding the stream...

Code:
rtmpdump -z -r 'rtmp://cp52820.live.edgefcs.net/live?ovpfv=2.1.4' -y 'TSN-LIVE33-FLASH@37547' -s 'http://watch.tsn.ca/Flash/player.swf?themeURL=http://watch.tsn.ca/themes/TSN/player/theme.aspx' -o out.flv -t 'rtmp://cp52820.live.edgefcs.net:1935/live?ovpfv=2.1.4' -p 'http://watch.tsn.ca/#clip428645' -f 'WIN 10,2,152,26' -a 'live?ovpfv=2.1.4'

The key error seems to be here from the server:
Code:
DEBUG: Property: <Name:              level, STRING:     error>
DEBUG: Property: <Name:               code, STRING:     NetStream.Play.StreamNotFound>
DEBUG: Property: <Name:        description, STRING:     Failed to play TSN-LIVE33-FLASH@37547; stream not found.>
DEBUG: Property: <Name:            details, STRING:     TSN-LIVE33-FLASH@37547>
DEBUG: Property: <Name:           clientid, STRING:     5ILYZHdG>

Can you see anything that stands out at you? I'm at the beating my head against a wall stage.

-Dan
Reply
#58
bolverk Wrote:Can you see anything that stands out at you? I'm at the beating my head against a wall stage.

-Dan

Put this in an strm file (with notepad) and load it with xbmc:
rtmp://cp52820.live.edgefcs.net:443/live?ovpfv=2.1.4 playpath=TSN-LIVE33-FLASH@37547 live=true

for andre_pl:

I'm 90% sure the "live=true" at the end is what we need to add to get the live streams from tsn (such as the curling that's live on TSN right now) and the cbc live streams working in your plugin. There doesn't appear to be any auth codes with the live video.
(I haven't done a ton of testing, but the rtmp string above plays the live curling for me right now)
Reply
#59
Thanks teefer22, I've implemented it, but I have nothing to test with at the moment, the brier is still listed on TSN but its not working even on their webpage. if anyone knows when the next live stream will be available for testing let me know.
Reply
#60
andre_pl Wrote:Thanks teefer22, I've implemented it, but I have nothing to test with at the moment, the brier is still listed on TSN but its not working even on their webpage. if anyone knows when the next live stream will be available for testing let me know.

The Brier will air live on the web again at 9:30am tomorrow until Draw 9 ends, then again at 2:30pm until Draw 10 ends. (Eastern time).

Thank you very much teefer for the live tip!

-Dan
Reply

Logout Mark Read Team Forum Stats Members Help
[REQUEST] CTV/TSN/Comedy Network Plugin?0