Added process for recognizing amazn urls
This commit is contained in:
parent
8eaa52d83d
commit
35af600dba
@ -142,6 +142,17 @@ function checkKnownProviders(target){
|
|||||||
target
|
target
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const amazonID = target.match(/https?:\/\/(www|smile|)\.?(amazon|smile)\.(com|de)(?:(?:\/.*\/|\/)(?:dp|gp))(\/product\/|\/)([A-Z0-9]+)/)[5];
|
||||||
|
console.log(amazonID)
|
||||||
|
if(amazonID){
|
||||||
|
const shortcode = `a/${amazonID}`
|
||||||
|
return {
|
||||||
|
url: `${config.getBaseUrl()}/${shortcode}`,
|
||||||
|
shortcode,
|
||||||
|
target
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the server!
|
// Run the server!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user