Now also recognizing cursed amazon urls (that weird query shit)
This commit is contained in:
parent
174ceebc06
commit
fc84dde534
|
@ -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]}`
|
||||
|
|
Loading…
Reference in New Issue