def __init__(self, search_query):

        if not isinstance(search_query, str):
            raise ValueError("Expected str for 1st parameter (search_query).")

        self.avail_files = OrderedDict()
        self.visible_files = None
        self.adj_tokens = {False: None, True: None}

        self.vf_iter = None

        self.search_params = {"maxResults": 10,
                "order": self.preferences["order"]} # relevance by default
        self.yts_opts = dict()

        parsed = self.__searchParser(search_query)

        # search params
        self.search_params.update(parsed[0])

        # YTa options
        _pref = deepcopy(self.preferences) # new object, just to not affect other intances.
        if 'metadata' in parsed[1]:
            try:
                meta_list = parsed[1]['metadata'].split(',')
            except __HOLE__:
                meta_list = []

            if 'desc' in meta_list: _pref['metadata']['desc'] = True
            else: _pref['metadata']['desc'] = False

            if 'thumb' in meta_list: _pref['metadata']['thumb'] = True
            else: _pref['metadata']['thumb'] = False

        self.preferences = _pref

        # YTs options
        self.yts_opts = parsed[1]

        if 'audio' in parsed[1] and 'video' not in parsed[1]: self.yts_opts['video'] = False
        if 'video' in parsed[1] and 'audio' not in parsed[1]: self.yts_opts['audio'] = False

        try:
            self.__getChannelId()
        except requests.exceptions.ConnectionError:
            raise ConnectionError

        if parsed[0].get("publishedBefore"): self.search_params["publishedBefore"] += "T00:00:00Z"
        if parsed[0].get("publishedAfter"): self.search_params["publishedAfter"] += "T00:00:00Z"
dataset/ETHPy150Open rasguanabana/ytfs/ytfs/actions.py/YTActions.__init__