Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelly Christensen committed Feb 29, 2024
1 parent fe88355 commit 358de5a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions test/youtube_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@
YoutubeShort(id="U5Bn8mMxj4o"),
"https://www.youtube.com/shorts/U5Bn8mMxj4o",
),
(
"https://www.youtube.com/shorts/",
None,
"https://www.youtube.com/shorts/",
),
]


Expand Down
5 changes: 4 additions & 1 deletion ural/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,10 @@ def parse_youtube_url(url, fix_common_mistakes=True):
elif path.startswith("/shorts/"):
splitted_path = pathsplit(path)

v = pathsplit(path)[1]
if len(splitted_path) < 2:
return None

v = splitted_path[1]

if fix_common_mistakes:
v = v[:11]
Expand Down

0 comments on commit 358de5a

Please sign in to comment.