discourse/onebox — pull request #223 by riking (2014-08-18 21:22:03+00:00)
Title: Mostly rewrite the YouTube oneboxing

Instead of a honking giant regex to extract the video URL, it is now URI.parse()d and the formats are handled separately.
This makes it tolerant of extra parameters, and less likely to take the fallback path.

The returned URLs are now always HTTPS, instead of http for the preview and protocol-agnostic for the embed.

Playlists are now passed through, though it still fails on the playlist pages themselves (even though embedding those is actually supported).

Both start and end parameters are now supported, as well as the #t= format for start times.

Additionally, it will give the proper options to loop the video if &loop is provided.