Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
wpinkman
Visitor

roPosterScreen / roSlideshow can't load Instagram images

My channel, Rokagram, started having trouble yesterday. I think I've debugged it down to the fact that the URL's returned from the Instagram API for images are now all HTTPS, but it's not just that. The CDN they are hosted on seems to cause problems for components like roPosterScreen and roSlideShow even if I call SetCertificatesFile and InitClientCertificates on them. The same image URL in question loads fine in a browser. I even tried an experiment of using roUrlTransfer to download the image into "tmp://" and then using the temp file as the posterUrl and that worked! Here's some sample code that demonstrates the problem.

Running the code shows a poster screen with one item, but the cover image never loads. I have a photo.. but I can't figure out how to attach it to a forum post. Trust me.. it doesn't work.


Sub Main()

port = CreateObject("roMessagePort")
screen = CreateObject("roPosterScreen")

screen.SetMessagePort(port)
screen.SetCertificatesFile("common:/certs/ca-bundle.crt")
screen.InitClientCertificates()
screen.SetListStyle("arced-square")

posterUrl = "https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s150x150/e15/11049316_1583549288528575_1352209504_n.jpg"
meta = {}
meta.HdPosterUrl = posterUrl
meta.SdPosterUrl = posterUrl

contentList = []
contentList.Push(meta)

screen.SetContentList(contentList)
screen.Show()

wait(0, port)

End Sub
--andy (channel: Rokagram)
15 REPLIES 15
belltown
Roku Guru

Re: roPosterScreen / roSlideshow can't load Instagram images

It will work if you change the "https" in the image url to "http". Not sure why. The https image url downloads just fine using roUrlTransfer, but not with the BS screen components. Again, not sure why.
0 Kudos
Veeta
Visitor

Re: roPosterScreen / roSlideshow can't load Instagram images

Are you listening for http events on roSystemLog? If so, you should be getting an error code which will better explain what is happening.
0 Kudos
belltown
Roku Guru

Re: roPosterScreen / roSlideshow can't load Instagram images

"Veeta" wrote:
Are you listening for http events on roSystemLog? If so, you should be getting an error code which will better explain what is happening.

There is no roSystemLogEvent when using the https url, only when using the http url.
0 Kudos
wpinkman
Visitor

Re: roPosterScreen / roSlideshow can't load Instagram images

Thanks @belltown. Yes.. roUrlTransfer works fine. This is a head scratcher. I might try that https -> http trick, but I'm afraid that won't work forever.
--andy (channel: Rokagram)
0 Kudos
Veeta
Visitor

Re: roPosterScreen / roSlideshow can't load Instagram images

I got a timeout during testing.

** SystemLog http.error: Status = connectiontimeout
** SystemLog http.error: LogType = http.error
** SystemLog http.error: TargetIp = 31.13.73.10
** SystemLog http.error: HttpCode = -1
** SystemLog http.error: Datetime = 03/25/2015 20:11:10.836
** SystemLog http.error: OrigUrl = https://scontent.cdninstagram.com/hphot ... 9504_n.jpg
** SystemLog http.error: Url = https://scontent.cdninstagram.com/hphot ... 9504_n.jpg
** SystemLog http.error: Method = GET
0 Kudos
wpinkman
Visitor

Re: roPosterScreen / roSlideshow can't load Instagram images

Thanks Veeta! I hope someone knows the root cause.
--andy (channel: Rokagram)
0 Kudos
belltown
Roku Guru

Re: roPosterScreen / roSlideshow can't load Instagram images

"Veeta" wrote:
I got a timeout during testing.

** SystemLog http.error: Status = connectiontimeout
** SystemLog http.error: LogType = http.error
** SystemLog http.error: TargetIp = 31.13.73.10
** SystemLog http.error: HttpCode = -1
** SystemLog http.error: Datetime = 03/25/2015 20:11:10.836
** SystemLog http.error: OrigUrl = https://scontent.cdninstagram.com/hphot ... 9504_n.jpg
** SystemLog http.error: Url = https://scontent.cdninstagram.com/hphot ... 9504_n.jpg
** SystemLog http.error: Method = GET

I'm seeing the same thing. I didn't wait the full 30 seconds when I tried it before.

My first thought was it was something to do with the certificates, although presumably roUrlTransfer and roPosterScreen both handle them the same way through the ifHttpAgent interface.
0 Kudos
Veeta
Visitor

Re: roPosterScreen / roSlideshow can't load Instagram images

I just traced the network and there are differences in the SSL handshaking from roUrlTransfer to roPosterScreen. Just speculating, it appears that the SSL handshaking doesn't work in roPosterScreen and the server side just stops responding.
0 Kudos
wpinkman
Visitor

Re: roPosterScreen / roSlideshow can't load Instagram images

roSlideShow also has the issue FWIW
--andy (channel: Rokagram)
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.