Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not follow redirects on Apple News links #130

Open
chrysb opened this issue Jan 6, 2021 · 6 comments
Open

Does not follow redirects on Apple News links #130

chrysb opened this issue Jan 6, 2021 · 6 comments
Labels
good first issue This issue is good for beginners to start contributing. help wanted investigation-needed

Comments

@chrysb
Copy link

chrysb commented Jan 6, 2021

Thanks for making this. Certainly saved me a lot of time!

Unfortunately, it doesn't seem to follow redirects.

Example: https://apple.news/Ak2IoOEp8Qdi6JVs8p-Jj_A

It should return the og:image from here: https://abcnews.go.com/Politics/capitol-breached-protesters/story?id=75081629

The impact is that it does not return the image from the news article, but rather a big Apple News logo.

@LeonardoCardoso LeonardoCardoso added good first issue This issue is good for beginners to start contributing. help wanted investigation-needed labels Feb 1, 2021
@LeonardoCardoso
Copy link
Owner

Thanks for the report. I will add it to investigation needed.

@chrysb
Copy link
Author

chrysb commented Feb 23, 2021

Just tried the library again and found it also doesn't work for Spotify urls:

Example: https://open.spotify.com/artist/39ywlwtGw8RTGobakgb11L?si=As8Ynf-RS12yFu8jckzhYQ

@chrysb
Copy link
Author

chrysb commented Feb 23, 2021

Just tried the library again and found it also doesn't work for Spotify urls:

Example: https://open.spotify.com/artist/39ywlwtGw8RTGobakgb11L?si=As8Ynf-RS12yFu8jckzhYQ

I spoke too soon. I updated from 3.2.0 to 3.3.0 and that Spotify URL worked. Hurrah!

@isharing0726
Copy link

The reason is that Apple news' OG:image doesn't have a file extension.

<meta property="og:image" content="https://c.apple.news/AgEXQWsySW9PRXA4UWRpNkpWczhwLUpqX0EAMA" /><meta name="twitter:card" content="summary_large_image" />

The supported imagePattern is

static let imagePattern = "(.+?)\\.(gif|jpg|jpeg|png|bmp)$"

@chrysb
Copy link
Author

chrysb commented Mar 2, 2021

Would it make sense to pass along the image URL regardless of extension? That would allow clients to try to parse the image and we can rely on iOS to examine the content headers and try to create UIImages from the URLs.

@JD10NN3
Copy link

JD10NN3 commented May 26, 2021

Any news on this one? Any way to ignore the imagePattern ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue This issue is good for beginners to start contributing. help wanted investigation-needed
Projects
None yet
Development

No branches or pull requests

4 participants