Kodi Community Forum

Full Version: Title stripping
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to build a scraper for my movies. They are formated like:
Back to the Future II (1989) -DEuEN.mkv
Where the last section gives the language of the available soundtracks.
XBMC seems to strip the title, so that:
$$1 = Back%20to%20the%20Future%20II
$$2 = 1989
Now my question. Is there a way to prevent the striping, so that:
$$1 = Back to the Future II (1989) -DEuEN
Any help would be appreciated.
What's happening is that cleandatetime is basically splitting the file name into three pieces:

(everything before the year)(year)(everything after the year)

The "everything after" is dropped straight away, the "everything before" is further filtered by cleanstrings before being URL-encoded and passed to the scraper as $$1 (with the year as $$2).

Where does that leave you?
Well, you can't get around the URL-encoding step for starters, so bear that in mind. You can probably replace the cleandatetime with something like (.+)()() (not tested) so that everything is captured as the "before" and the year never captured; this will affect everything, though, including TV shows. (You probably won't have to change cleanstrings). You could then perform the necessary separation in the scraper itself (in CreateSearchUrl), keeping the audio info safe by not cleaning the buffers. Something like that.
thanx a lot for the answer. It was really helpful.
I changed the cleandatetime so, that:
$$1: full title
$$2: date
and in the beginning of the scrapper I clean the file name again.
(.+[^ _\,\.\(\)\[\]\-][ _\.\(\)\[\]\-]+((19|20)?([0-9x][0-9x]))([ _\,\.\(\)\[\]\-][^0-9]|$).*-n?((DE|EN|SP|FR|IT)(u?))*)