[rtmpdump] Parsing an RTMPE URL

Anony Mous anonymous247 at gmail.com
Sat Apr 10 07:04:08 CEST 2010


Hello,

So I've been experimenting with using librtmp (the latest version from svn) integrated into XBMC. 
For the most part things work well, but I've been having a problem trying to connect to a video URL 
from a flash based TV website in Canada named CTV (only accessible from Canada I believe).  I should 
point out that I'm only having these problems because of the different URL format of the RTMPE 
streams.  RTMP streams work fine, it is only the encrypted streams that fail, and as I said, I think 
it is because of the URL format, not an encryption issue.  The complete URL looks like this (notice, 
I'm breaking it up across multiple lines to avoid 80 char line limits):

rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
?auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt
&aifp=v001
&slist=/s_!ctv/shows/2010/03/31/


So I take this URL and programatically change it to this before it is passed to librtmp:

rtmpe://cp45924.edgefcs.net/ondemand/s_!ctv/shows/2010/03/31/ALLMYCH-10344-EP.CLIP01.mp4
  swfUrl=http://watch.ctv.ca/Flash/player.swf
  swfVfy=true
  auth=dbEbzdDd4bLcKdgdwcAdKczdsdPaAdTd5dk-blWaqa-eS-iYG-txN4tmKCt
  authflag=true
  app=ondemand
  tcUrl=/s_!ctv/shows/2010/03/31/

So this results in a connect packet like this being sent out:

DEBUG: RTMP_Connect1, handshaked
DEBUG2: RTMP_SendPacket: fd=21152, size=284
   0000:  03 00 00 00 00 01 1c 14  00 00 00 00               ............
   0000:  02 00 07 63 6f 6e 6e 65  63 74 00 3f f0 00 00 00   ...connect.?....
   0010:  00 00 00 03 00 03 61 70  70 02 00 08 6f 6e 64 65   ......app...onde
   0020:  6d 61 6e 64 00 06 73 77  66 55 72 6c 02 00 24 68   mand..swfUrl..$h
   0030:  74 74 70 3a 2f 2f 77 61  74 63 68 2e 63 74 76 2e   ttp://watch.ctv.
   0040:  63 61 2f 46 6c 61 73 68  2f 70 6c 61 79 65 72 2e   ca/Flash/player.
   0050:  73 77 66 00 05 74 63 55  72 6c 02 00 19 2f 73 5f   swf..tcUrl.../s_
   0060:  21 63 74 76 2f 73 68 6f  77 73 2f 32 30 31 30 2f   !ctv/shows/2010/
   0070:  30 33 2f 33 31 2f 00 04  66 70 61 64 01 00 00 0c   03/31/..fpad....
   0000:  c3                                                 .
   0000:  63 61 70 61 62 69 6c 69  74 69 65 73 00 40 2e 00   capabilities. at ..
   0010:  00 00 00 00 00 00 0b 61  75 64 69 6f 43 6f 64 65   .......audioCode
   0020:  63 73 00 40 a8 ee 00 00  00 00 00 00 0b 76 69 64   cs. at .........vid
   0030:  65 6f 43 6f 64 65 63 73  00 40 6f 80 00 00 00 00   eoCodecs. at o.....
   0040:  00 00 0d 76 69 64 65 6f  46 75 6e 63 74 69 6f 6e   ...videoFunction
   0050:  00 3f f0 00 00 00 00 00  00 00 00 09 01 01 02 00   .?..............
   0060:  3b 64 62 45 62 7a 64 44  64 34 62 4c 63 4b 64 67   ;dbEbzdDd4bLcKdg
   0070:  64 77 63 41 64 4b 63 7a  64 73 64 50 61 41 64 54   dwcAdKczdsdPaAdT
   0000:  c3                                                 .
   0000:  64 35 64 6b 2d 62 6c 57  61 71 61 2d 65 53 2d 69   d5dk-blWaqa-eS-i
   0010:  59 47 2d 74 78 4e 34 74  6d 4b 43 74               YG-txN4tmKCt
DEBUG: Invoking connect

Unfortunately the response from the server is a connection reject message that looks like this:

DEBUG2: RTMP_ReadPacket: fd=21152
   0000:  03 00 00 00 00 00 78 14  00 00 00 00               ......x.....
   0000:  02 00 06 5f 65 72 72 6f  72 00 3f f0 00 00 00 00   ..._error.?.....
   0010:  00 00 05 03 00 05 6c 65  76 65 6c 02 00 05 65 72   ......level...er
   0020:  72 6f 72 00 04 63 6f 64  65 02 00 1e 4e 65 74 43   ror..code...NetC
   0030:  6f 6e 6e 65 63 74 69 6f  6e 2e 43 6f 6e 6e 65 63   onnection.Connec
   0040:  74 2e 52 65 6a 65 63 74  65 64 00 0b 64 65 73 63   t.Rejected..desc
   0050:  72 69 70 74 69 6f 6e 02  00 1b 5b 20 41 63 63 65   ription...[ Acce
   0060:  73 73 4d 61 6e 61 67 65  72 2e 52 65 6a 65 63 74   ssManager.Reject
   0070:  20 5d 20 3a 20 00 00 09                             ] : ...
DEBUG: RTMP_ClientPacket, received: invoke 120 bytes
DEBUG: (object begin)
DEBUG: Property: <Name:                  no-name., STRING:	_error>
DEBUG: Property: <Name:                  no-name., NUMBER:	1.00>
DEBUG: Property: NULL
DEBUG: Property: <Name:                  no-name., OBJECT>
DEBUG: (object begin)
DEBUG: Property: <Name:                     level, STRING:	error>
DEBUG: Property: <Name:                      code, STRING:	NetConnection.Connect.Rejected>
DEBUG: Property: <Name:               description, STRING:	[ AccessManager.Reject ] : >
DEBUG: (object end)


Now, I don't think the way this video service is unique in the way it uses auth, aifp, and slist 
params, I'm just hoping someone knows how to transform this URL format into a connect packet that 
will succeed.  Any advice?

Anony


More information about the rtmpdump mailing list