TypeError: 'NoneType' for 'channel ID' when constructing channel link in youtubesearchpython (componenthandler.py)
Greetings,
I am experiencing an issue when trying to search for and play videos using Yewtube. For any search, the app throws a TypeError traceback instead of displaying results. This issue has been occurring since two days.
Environment:
- OS: Windows 11 Version 25H2 (OS Build 26200.8246)
- Python Version: Python 3.13.13
- Pip Version: pip 26.1 from C:\Users\sonay\AppData\Local\Programs\Python\Python313\Lib\site-packages\pip (python 3.13)
Required Library Versions:
yewtube 2.13.1
yewtube-search-python 1.6.7
yt-dlp 2026.3.17
pafy 0.5.5
Error Traceback:
Traceback (most recent call last):
File "C:\Users\sonay\AppData\Local\Programs\Python\Python313\Lib\site-packages\mps_youtube\main.py", line 78, in matchfunction
func(*matches)
~~~~^^^^^^^^^^
File "C:\Users\sonay\AppData\Local\Programs\Python\Python313\Lib\site-packages\mps_youtube\commands\search.py", line 310, in search
wdata = pafy.search_videos(term, int(config.PAGES.get))
File "C:\Users\sonay\AppData\Local\Programs\Python\Python313\Lib\site-packages\mps_youtube\pafy.py", line 76, in search_videos
videosSearch.next()
~~~~~~~~~~~~~~~~~^^
File "C:\Users\sonay\AppData\Local\Programs\Python\Python313\Lib\site-packages\youtubesearchpython\search.py", line 152, in next
return self._next()
~~~~~~~~~~^^
File "C:\Users\sonay\AppData\Local\Programs\Python\Python313\Lib\site-packages\youtubesearchpython\core\search.py", line 94, in _next
self._getComponents(*self.searchMode)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "C:\Users\sonay\AppData\Local\Programs\Python\Python313\Lib\site-packages\youtubesearchpython\core\search.py", line 114, in _getComponents
self.resultComponents.append(self._getVideoComponent(element))
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "C:\Users\sonay\AppData\Local\Programs\Python\Python313\Lib\site-packages\youtubesearchpython\handlers\componenthandler.py", line 32, in _getVideoComponent
component['channel']['link'] = 'https://www.youtube.com/channel/' + component['channel']['id']
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate str (not "NoneType") to strSteps to reproduce the issue:
- Opened my terminal.
- Navigate to my desired directory cd c:\Users\sonay\Documents) (to save the error output).
- Executed a search query in Yewtube. For example: yt /sevsen ne olur AI cover
- Observed the TypeError traceback. Note: I have already tried updating Yewtube and all of it's components, but the issue persists. Expected behavior: Yewtube should display search results for the query, allowing me to select and play a video.
Actual behavior:
Instead of search results, a TypeError: can only concatenate str (not "NoneType") to str traceback is displayed, and no videos are loaded.
Regards, Mert.
Source: mps-youtube/yewtube