Twitter profile picture images now blocked on most domains

帅比萌擦擦* 提交于 2020-06-29 04:14:11

问题


Based upon this answer here: Building Twitter profile image url with Twitter user id

I implemented some functionality for a client's website that showed a Twitter profile picture's img so it could be displayed on our site. ( https://twitter.com/[screen_name]/profile_image?size=original )

Unfortunately after coming back to the project after a couple weeks it looks like Twitter has now blocked this functionality. Looking at the response headers I see:

After poking around a bit it looks like the content-security-policy and perhaps also the x-frame-options settings are preventing the functionality from working now. Am I correct in my assumption and are there any workarounds (other than using the API to get the profile image url via this API: https://developer.twitter.com/en/docs/accounts-and-users/user-profile-images-and-banners )


回答1:


The API is the correct way to obtain these URLs and images. The way you were doing it was never a documented or supported manner of getting profile images. There’s no workaround for your current method, you should use the official API.



来源:https://stackoverflow.com/questions/60330354/twitter-profile-picture-images-now-blocked-on-most-domains

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!