Redirecting a URL service to a different one

Does anyone know if it is possible to redirect a URL service call to another? I've found that a number of the newer video links posted on mtv.com are actually vevo.com videos. It shouldn't be a big deal to redirect them from a plugin perspective before the URL service call, but I was thinking from a Plex It! perspective where there are only the url services.

You shouldn't have to do anything in this case to make it work.  The URL services pick up and process any URLs as specified by the Regex in the service iteslf, so if it's a vevo.com video the framework should automatically use the correct URL service (for vevo) regardless of what channel it's coming from provided that the URL you are passing matches the Regex for the vevo URL service.

In this case, the browser URL matches the Regex for the MTV URL Service, but MTV's flash player is actually pulling the video from VEVO's service. Once in ServiceCode.pys, I was looking for a way to rewrite the URL so that it instead matched the link to the VEVO URL. The only other option I could see would be to copy the VEVO video handler into the MTV ServiceCode.pys.

An example:

MTV link: http://www.mtv.com/videos/justin-timberlake/889887/mirrors.jhtml#id=1518072

Contains this javascript to locate the VEVO video id:

MTVN.Player.isVevoVideo = true;
MTVN.Player.vevoVideoId = "USRV81300104";

MTVN.Player.vevoVideoId = “USRV81300104”;

which then matches:

http://www.vevo.com/watch/justin-timberlake/mirrors/USRV81300104

I was able to look for this javascript from the plugin side (__init__.py), then rewrite the above link as http://www.vevo.com/watch/USRV81300104. The VEVO URL service didn't appear to have any problem with parsing and playing the video with that URL. I'm just trying to figure out if it is possible from within the MTV ServiceCode.pys.

Ahh ok, I see where you're talking about now.  I assume that it's possible but I'm not sure how.  I am pretty sure that some other plugins need to do this sort of thing (likely with vevo as well or possible youtube), so you might poke around a bit in the Services.bundle.

Sander found an added a workaround into the MTV URL Service (which also shows how to do this).

https://github.com/plexinc-plugins/Services.bundle/commit/e9db082058c3bfba4cf2ade9482abca2b512c6be

I'm not sure how long before that goes live on the store, but you can always make the changes yourself as needed until then (or merge that repo or whatever).