Kodi Community Forum

Full Version: Unescape url
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Il need help to parse thumbs url in my scraper: how can I unescape this :


I can't find a better way than using an '<expression repeat="yes">' to match between backslashes and append the results to a buffer ? Is there a way to do it using only a regexp ?


Trois Six
Something like:
<RegExp input="$$1" output="\1" dest="2">
    <expression repeat="yes">\\?(.)</expression>

Or is that more-or-less what you're already using? I can't quite tell from your question.

That would be the simplest way I can think of, unless you want to tailor the expression specifically to that specific URL format
(i.e. (http:)\\/\\/(images\.myurl\.com)\\/(..)etc. and output "\1//\2/\3/\4etc.").
That's what I was thinking about, but I just wanted to known if there was another way.
I finally did like that :

<RegExp input="$$6" output="\1" dest="8+">
   <expression noclean="1">([^\\]*)\\/</expression>
<RegExp input="$$6" output="/\1" dest="8+">
   <expression noclean="1" repeat="yes">\\/([^\\]*)</expression>

$$6 contains the URL and $$8 is my destination's buffer.