LeonardoCardoso / SwiftLinkPreview

It makes a preview from an URL, grabbing all the information such as title, relevant texts and images.
https://leocardz.com/swift-link-preview-5a9860c7756f
MIT License
1.37k stars 196 forks source link

Unable to parse #61

Closed SourabhSharotria closed 6 years ago

SourabhSharotria commented 7 years ago

"https://goo.gl/maps/8cu9dtwedbn" is a shared link from google maps. In most of the cases we getting "This URL cannot be opened" and localised description as "The operation couldn’t be completed. (SwiftLinkPreview.PreviewError error 2.)". And if it successful then also we are unable to get image.

SourabhSharotria commented 7 years ago

For apple map link as: https://maps.apple.com/?ll=30.676222,76.740431&q=Sourabh%20Sharotria%E2%80%99s%20Location&t=m

Iam getting response

SwiftLinkPreview.SwiftLinkResponseKey.canonicalUrl: "www.google.com", SwiftLinkPreview.SwiftLinkResponseKey.title: "Google Maps"

LeonardoCardoso commented 6 years ago

Links like those have many redirections, sometimes they block scraping, most of the times they load images dynamically (by javascript), etc. Those behaviors cannot be predicted by the app, since the app gets the static HTML code.