[rtmpdump] Need help with rtmpdump url parser

Howard Chu hyc at highlandsun.com
Thu Dec 15 04:59:02 CET 2011

Steven Penny wrote:
> On Wed, Dec 14, 2011 at 9:15 PM, Howard Chu wrote:
>> There is no specification that defines what part of the URL is the app and
>> what part is the playpath. All it can do is take a guess. Sometimes the
>> guess will be right, sometimes wrong.
> With fear of delving even further into "things i have no idea about",
> a "simple" workaround from a programming perspective would be a trial
> error approach to parsing the URL, ie:
> trial 1
> -r rtmp://vod.daserste.de
> -a ardfs
> -y videoportal/mediathek/Fernsehfilme+im+Ersten/c_200000/209593/format246444.f4v
> trial 2
> -r rtmp://vod.daserste.de
> -a ardfs/videoportal
> -y mediathek/Fernsehfilme+im+Ersten/c_200000/209593/format246444.f4v
> etc
> While this may be cringeworthy, it looks feasible

And again, you have no idea what the implications are of what you're talking 
about. Many sites use one-time-use authentication tokens. You won't get to 
take multiple tries with the same URL.

Think about it. We're not idiots writing this code. We've tackled much harder 
problems, like reverse-engineering 3 separate crypto mechanisms from scratch. 
Parsing a URL into various substrings is a no-brainer. If "fixing" the URL 
parser logic was easy it would have been done long ago. The fact remains that 
there is no deterministic way to parse every possible RTMP URL.

Heuristics are fine, for the human user to apply. The code's job is only to 
faithfully transmit what you specify. If you want to play trial and error, do 
it yourself.

If you think you're so smart, prove it, write working code that actually 
handles every case.

More information about the rtmpdump mailing list