diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/components/UploadImage/UploadImage.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/components/UploadImage/UploadImage.tsx b/src/components/UploadImage/UploadImage.tsx index e9f2168..238d5cd 100644 --- a/src/components/UploadImage/UploadImage.tsx +++ b/src/components/UploadImage/UploadImage.tsx @@ -25,9 +25,9 @@ const UploadImage: React.FC<PropTypes> = ({ setIsOpen, isOpen, callback }) => { const handleSubmit = () => { let result = url; if (url.startsWith('https://www.instagram.com/')) { - const appendixIndex = url.indexOf('/?utm_source='); - const baseUrl = url.slice(0, appendixIndex); - result = `${baseUrl}/media/?size=l`; + const match = url.match('/p/(.*)/'); + const id = match && match[1]; + result = `https://www.instagram.com/p/${id}/media/?size=l`; } else if (url.startsWith('https://drive.google.com/')) { const match = url.match('/d/(.*)/'); const fileId = match && match[1]; |