Now also recognizing cursed amazon urls (that weird query shit)

This commit is contained in:
Nicolai Ort 2021-08-14 08:54:36 +02:00
parent 174ceebc06
commit fc84dde534
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
1 changed files with 1 additions and 0 deletions

View File

@ -138,6 +138,7 @@ fastify.post('/new', { newUrlSchema }, async (req, res) => {
* @returns Standard shortening response if provider recognized or null
*/
function checkKnownProviders(target) {
target=decodeURIComponent(target);
const youtubeVideoID = target.match(/(?:youtube(?:-nocookie)?\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/)
if (youtubeVideoID) {
const shortcode = `yt/${youtubeVideoID[1]}`