def __searchParser(self, query):
ret = dict()<EOL>parse_params = True<EOL>buf = "<STR_LIT>"<EOL>ptr = "<STR_LIT>"<EOL>p_avail = ("<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>")<EOL>opts = dict()<EOL>par_open = False<EOL>translate = {<EOL>'<STR_LIT:a>': '<STR_LIT>',<EOL>'<STR_LIT:v>': '<STR_LIT>',<EOL>'<STR_LIT:f>': '<STR_LIT>',<EOL>'<STR_LIT:s>': '<STR_LIT>',<EOL>'<STR_LIT:P>': '<STR_LIT>',<EOL>'<STR_LIT:m>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT:q>'<EOL>}<EOL>for i in query+'<STR_LIT:U+0020>':<EOL><INDENT>if parse_params:<EOL><INDENT>if not par_open:<EOL><INDENT>if i == '<STR_LIT:U+0020>': <EOL><INDENT>try:<EOL><INDENT>if ret.get(translate[ptr]):<EOL><INDENT>ret[ translate[ptr] ] += '<STR_LIT:U+0020>'<EOL><DEDENT>else:<EOL><INDENT>ret[ translate[ptr] ] = '<STR_LIT>'<EOL><DEDENT>ret[ translate[ptr] ] += buf<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>ptr = "<STR_LIT>"<EOL>buf = "<STR_LIT>"<EOL><DEDENT>elif i == '<STR_LIT::>' and buf in p_avail:<EOL><INDENT>ptr = buf<EOL>buf = "<STR_LIT>"<EOL><DEDENT>elif not buf and i == '<STR_LIT:[>': <EOL><INDENT>parse_params = False<EOL>ptr = "<STR_LIT>"<EOL><DEDENT>elif i != '<STR_LIT:(>':<EOL><INDENT>buf += i<EOL><DEDENT><DEDENT>elif not (par_open == <NUM_LIT:1> and i == '<STR_LIT:)>'):<EOL><INDENT>buf += i<EOL><DEDENT>if i == '<STR_LIT:(>': par_open += <NUM_LIT:1><EOL>if par_open > <NUM_LIT:0> and i == '<STR_LIT:)>': par_open -= <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>if i == '<STR_LIT:]>':<EOL><INDENT>parse_params = True<EOL>par_open = False<EOL>ptr = "<STR_LIT>"<EOL>buf = "<STR_LIT>"<EOL><DEDENT>elif ptr and not par_open and i == '<STR_LIT:(>':<EOL><INDENT>par_open = True<EOL><DEDENT>elif par_open:<EOL><INDENT>if i == '<STR_LIT:)>':<EOL><INDENT>try:<EOL><INDENT>opts[ translate[ptr] ] = buf<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT>par_open = False<EOL>buf = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>buf += i<EOL><DEDENT><DEDENT>elif i.isalpha():<EOL><INDENT>ptr = i<EOL>try:<EOL><INDENT>opts[ translate[ptr] ] = not i.isupper()<EOL><DEDENT>except KeyError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return (ret, opts)<EOL>
Parse `query` for advanced search options.

Parameters
----------
query : str
    Search query to parse. Besides a search query, user can specify additional search parameters and YTFS
    specific options. Syntax:
    Additional search parameters: ``option:value``. if `value` contains spaces, then surround it with
    parentheses; available parameters: `channel`, `max`, `before`, `after`, `order`.
    YTFS options: specify options between ``[`` and ``]``; Available options: `a`, `v`, `f`, `P`, `s`, `m`.
    If an option takes a parameter, then specify it beetween parentheses.

    Examples: ``channel:foo search query``, ``my favourite music [a]``,
    ``channel:(the famous funny cats channel) [vf(240)P] funny cats max:20``.

    Invalid parameters/options are ignored.

Returns
-------
params : tuple
    Tuple: 0 - dictionary of url GET parameters; 1 - dictionary of YTStor options.