HenrikDK/youtube-xbmc-plugin — pull request #17 by jmbreuer (2013-08-24 08:03:25+00:00)
Title: Fix playback of "possibly inappropriate" videos

Here, watching "possibly inappropriate" videos has never worked - that's with XBMC + YouTube plugin versions from about December 2012 on.

Example video: http://www.youtube.com/watch?v=8n1OJoHpDSc

Lately, the "Cannot play video" error toast has changed to "This video may be inappropriate for some users"; i.e. it shows the message returned by YT.

I've taken this as an excuse to look into the issue, YouTube delivers a page with some markup in place of the video which contains an "I understand and wish to proceed" submit button.
After some redirects, this leads to the original `watch?v=...` page, with another parameter added.

I've added this parameter to request URLs in the appropriate case, now those videos play correctly.

I noticed that the re-login which used to be performed by the code is not necessary here - does this take care of a specific (other) scenario?

A preventive "sorry" for the code quality - Python is not one of my native languages ;-)
Feel free to clean it up in any way or tell me how it can be improved.