twlite / youtube-sr

A dead-simple youtube metadata scraper
https://npmjs.com/package/youtube-sr
MIT License
113 stars 16 forks source link

Playlist id validator regex has hardcoded prefixes #34

Closed Andy1210 closed 2 years ago

Andy1210 commented 3 years ago

My favorite list is starting with "FL" so it's not considered as a valid playlist url by the isPlaylist function

You have hardcoded values in the playlist id regex: (PL|UU|LL|RD|OL)[a-zA-Z0-9-_]{16,41}

What is the reason for checking explicitly for those character pairs?

twlite commented 2 years ago

I took these regex from node-ytpl while developing this module. Keep in mind, this library was developed only for personal use back then when ytsr and ytpl were not working and we could not use our music bot.

You are free to open a pull request with enhanced regex if you want. I am not so free to update this library 24/7 hope you understand :)

If you can't contribute, no problem I will try it myself when I get time.

:tada: Thank you for using youtube-sr :D

twlite commented 2 years ago

@Andy1210 Could you provide the playlist id?

Andy1210 commented 2 years ago

yes, the id is the following: FLkR-TXquM08WJ3mL0Amq-Yw

twlite commented 2 years ago

I've added support for FL prefix on the latest version (4.1.15). Let me know if there are other such ids which can relate to this issue.