Skip to content

Commit

Permalink
Merge pull request #176 from pidi3000/fix-enf_parts
Browse files Browse the repository at this point in the history
fix(enf_parts): remove leading/trailing whitespace from `parts` parameter values
  • Loading branch information
MerleLiuKun committed Jun 13, 2024
2 parents 7076d19 + 4c6ad59 commit 280d807
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyyoutube/utils/params_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ def enf_parts(resource: str, value: Optional[Union[str, list, tuple, set]], chec
message=f"Parameter (parts) must be single str,comma-separated str,list,tuple or set",
)
)

# Remove leading/trailing whitespaces
parts = set({part.strip() for part in parts})

# check parts whether support.
if check:
support_parts = RESOURCE_PARTS_MAPPING[resource]
Expand Down

0 comments on commit 280d807

Please sign in to comment.