Convert an HTML encoded url?

Hey guys, me again.  Quick question.  So I'm working on a channel that pulls the video link from inside a flash player iframe.  So far, my regex is working and I'm able to isolate the video link as a string.  However the url is encoded like so:

http%3A%2F%2Fs23.videofun.me%2Fvideos%2FOne-Piece%2FOne-Piece-316.flv%3Fst%3D0lvvFIxQJyRZIM0JPBiVTw%26e%3D1383146128

and playback fails when trying to redirect based on that url.  Logs show me a 302.  I'm assuming it needs to look more like this:

http://s23.videofun.me/videos/One-Piece/One-Piece-316.flv?st=0lvvFIxQJyRZIM0JPBiVTw&e=1383146128

Is there a simple way to achieve this within the url service code?  Am I doing something else wrong?  My function is as follows:

def PlayVideo(url):
iframe_url = HTML.ElementFromURL(url).xpath("//div[@id='streams']//iframe/@src")[0]
page_data = HTML.ElementFromURL(iframe_url)
string_data = HTML.StringFromElement(page_data)

find_url = RE_PLAYLIST.search(string_data).group()	

return Redirect(find_url)
String.Unquote(s, usePlus=False) 

will convert the URL into the format you are looking for.

http://dev.plexapp.com/docs/api/utilkit.html?highlight=string.unquote#String.Unquote

Thank you, that did the trick.  I had never noticed the Utilities page in the docs. :rolleyes:  There's some useful stuff there.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.