monsieurvideo/get-flash-videos — pull request #105 by psycotica0 (2013-03-09 22:47:59+00:00)
Title: Fixed YouTube RegExp

When the v= argument, which contains the video ID, is at the end and a
link is posted with a timestamp the url becomes v=fhuuefurfe#t=302s or
something.
The regexp stopped at '&' but not '#', so it was fetching an invalid
video ID.

I was expected the rel="canonical" thing to fix that, but it turns out
that while curl gets the real page with its user agent, we attempt to
mimic Mozilla on Windows.

Whatever Mechanize has for this, though, Google deems too old and
instead delivers a reduced page that doesn't have rel="canonical" thing,
among other things.
This confused the HELL out of me, since curl is my go-to debugging tool.