markitdown icon indicating copy to clipboard operation
markitdown copied to clipboard

fix: support YouTube short URLs and Shorts in YouTubeConverter

Open Jah-yee opened this issue 7 months ago • 0 comments

Good day,

I noticed that the YouTubeConverter.accepts() method only matches URLs that begin with https://www.youtube.com/watch? and silently rejects:

  • Short URLs like https://youtu.be/dQw4w9WgXcQ
  • Shorts URLs like https://www.youtube.com/shorts/...

This means these URLs were never converted through the YouTube converter — they would fall through to a generic HTML converter, producing noisy output instead of a clean transcript.

Changes

  • Extended the accepts() method to recognize short URLs and shorts URLs
  • Updated the video ID extraction in convert() to handle all URL formats

This fix is related to issue #1730 which mentions this problem.

Thank you for your work on this project. I hope this small fix is helpful. Please let me know if there's anything to adjust.

Warmly, RoomWithOutRoof

Jah-yee avatar Apr 14 '26 23:04 Jah-yee