youtube-regex icon indicating copy to clipboard operation
youtube-regex copied to clipboard

Some youtube/tv links not working

Open laggingreflex opened this issue 8 years ago • 3 comments

It doesn't work on some youtube.com/tv links

  • Doesn't work: https://www.youtube.com/tv#/watch/video/idle?v=oNXzMBA9VU4&resume
  • Doesn't work: https://www.youtube.com/tv#/watch/video/idle?v=oNXzMBA9VU4
  • Doesn't work: https://www.youtube.com/tv#/watch/video/seek?v=oNXzMBA9VU4
  • Doesn't work: https://www.youtube.com/tv#/watch/video/control?v=oNXzMBA9VU4
  • Doesn't work: https://www.youtube.com/tv#/watch/video?v=oNXzMBA9VU4
  • Doesn't work: https://www.youtube.com/tv#/watch?v=c7GVeJJcD5w&list=UUFZO6aPugMrZjUOobX7IQDA
  • Works           : https://www.youtube.com/tv#/watch?v=oNXzMBA9VU4

related: https://github.com/rg3/youtube-dl/issues/11485

laggingreflex avatar Dec 19 '16 09:12 laggingreflex

Thanks for the report.

tunnckoCore avatar Dec 19 '16 18:12 tunnckoCore

It seems like a simple fix, but I'll investigate more later tonight.

edit: http://regexr.com/3etii - just with simple (?:.*), but that with /control fails (because we search for between 6 and 11, duh)

tunnckoCore avatar Dec 19 '16 18:12 tunnckoCore

Simplest and fastest fix currently is change from above and (?!control), so

const regex = /(?:youtube\.com\/\S*(?:(?:\/e(?:mbed))?\/|watch(?:.*)\?(?:\S*?&?v\=))|youtu\.be\/)((?!control)[a-zA-Z0-9_-]{6,11})/;

http://regexr.com/3gbp9

tunnckoCore avatar Jul 14 '17 16:07 tunnckoCore