<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __search(self, pt=""):
 """ Method responsible for searching using YouTube API. Parameters pt : str Token of search results page. If ``None``, then the first page is downloaded. Returns ------- results : dict Parsed JSON returned by YouTube API. """


        if not self.search_params.get('q') and not self.search_params.get('channelId'):
            return {'items': []} # no valid query - no results.

        api_fixed_url = "https://www.googleapis.com/youtube/v3/search?part=snippet&type=video&fields=items(id%2Ckind%2Csnippet)%2CnextPageToken%2CprevPageToken&"

        d = {"key": self.api_key, "pageToken": pt}
        d.update(self.search_params)
        url = api_fixed_url + urlencode(d)

        try:
            get = requests.get(url)
        except requests.exceptions.ConnectionError:
            raise ConnectionError

        if get.status_code != 200:
            return {'items': []} # no valid query - no results.

        return get.json()