fix: started relying on own error handling instead of none
This commit is contained in:
		| @@ -43,7 +43,7 @@ class SponsorBlock: | ||||
|  | ||||
|         self.logger: logging.Logger = logging.Logger("SponsorBlock") | ||||
|  | ||||
|     def _get_video_id(self, video: str) -> Optional[str]: | ||||
|     def _get_video_id(self, video: str) -> str: | ||||
|         if re.match(r"^[a-zA-Z0-9_-]{11}$", video): | ||||
|             return video.strip() | ||||
|  | ||||
| @@ -56,9 +56,7 @@ class SponsorBlock: | ||||
|                  | ||||
|         query_stuff = parse_qs(url.query) | ||||
|         if "v" not in query_stuff: | ||||
|             if not self.silent: | ||||
|                 raise SponsorBlockIdNotFoundError("No video id found in the url") | ||||
|             return None | ||||
|             raise SponsorBlockIdNotFoundError("No video id found in the url") | ||||
|         else: | ||||
|             return query_stuff["v"][0] | ||||
|  | ||||
| @@ -91,8 +89,6 @@ class SponsorBlock: | ||||
|     @error_handling(default=[]) | ||||
|     def get_segments(self, video: str) -> List[Segment]: | ||||
|         video_id = self._get_video_id(video) | ||||
|         if video_id is None: | ||||
|             return [] | ||||
|          | ||||
|         # build query parameters | ||||
|         query = { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user