Skip to content

Commit bd51238

Browse files
ryanopilysigma67
andauthored
playlist search result "itemCount" field cast to int (sigma67#589)
* playlist search result "itemCount" field cast to int * use to_int --------- Co-authored-by: sigma67 <[email protected]>
1 parent 1f4332a commit bd51238

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ytmusicapi/parsers/search.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from ..helpers import to_int
12
from ._utils import *
23
from .songs import *
34

@@ -97,7 +98,9 @@ def parse_search_result(data, search_result_types, result_type, category):
9798
elif result_type == "playlist":
9899
flex_item = get_flex_column_item(data, 1)["text"]["runs"]
99100
has_author = len(flex_item) == default_offset + 3
100-
search_result["itemCount"] = get_item_text(data, 1, default_offset + has_author * 2).split(" ")[0]
101+
search_result["itemCount"] = to_int(
102+
get_item_text(data, 1, default_offset + has_author * 2).split(" ")[0]
103+
)
101104
search_result["author"] = None if not has_author else get_item_text(data, 1, default_offset)
102105

103106
elif result_type == "station":

0 commit comments

Comments
 (0)