<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def __getChannelId(self):
 """ Obtain channel id for channel name, if present in ``self.search_params``. """


        if not self.search_params.get("channelId"):
            return

        api_fixed_url = "https://www.googleapis.com/youtube/v3/channels?part=id&maxResults=1&fields=items%2Fid&"
        url = api_fixed_url + urlencode({"key": self.api_key, "forUsername": self.search_params["channelId"]})
        get = requests.get(url).json()

        try:
            self.search_params["channelId"] = get['items'][0]['id']
            return # got it

        except IndexError:
            pass # try searching now...

        api_fixed_url = "https://www.googleapis.com/youtube/v3/search?part=snippet&type=channel&fields=items%2Fid&"
        url = api_fixed_url + urlencode({"key": self.api_key, "q": self.search_params['channelId']})
        get = requests.get(url).json()

        try:
            self.search_params["channelId"] = get['items'][0]['id']['channelId']

        except IndexError:
            del self.search_params["channelId"]