Thursday, July 12, 2012

[YouTube-API] Youtube API Comments (Java)

I feel quite out of place here, as I'm very very new to programming. I think this is the right place to ask this question so here I go!

 I was developing a Youtube Application in Java, I thought i had the code working fine i couldn't see any problems to why it wouldn't work but its kept throwing this error when i ran the program on large queries:

java.io.IOException: Premature EOF      
        at sun
.net.[url]www.http.ChunkedInputStream.readAheadBlocking(Unknown[/url] Source)
        at sun
.net.[url]www.http.ChunkedInputStream.readAhead(Unknown[/url] Source)
        at sun
.net.[url]www.http.ChunkedInputStream.read(Unknown[/url] Source)
        at java
.io.FilterInputStream.read(Unknown Source)
        at sun
.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
        at sun
.nio.cs.StreamDecoder.readBytes(Unknown Source)
        at sun
.nio.cs.StreamDecoder.implRead(Unknown Source)
        at sun
.nio.cs.StreamDecoder.read(Unknown Source)
        at java
.io.InputStreamReader.read(Unknown Source)
        at java
.io.BufferedReader.fill(Unknown Source)
        at java
.io.BufferedReader.readLine(Unknown Source)
        at java
.io.BufferedReader.readLine(Unknown Source)
        at
Youtube1.main(Youtube1.java:40)

So after asking a lot of people why my program was doing this, i got very few answers but many people said to use the API, as before i was just using the direct youtube URL (which i was recently told is against their TOS).

But when I use the Youtube API's comment feed URL:

http://gdata.youtube.com/feeds/api/videos/8aYQ_wjmxiQ/comments
  
it will only display about 25 comments of that video, I was wondering is there a way to access the all_comments part? and/or navigate through the Youtube Comment pages?

I hope I'm not missing something obvious. And im sorry if this sounds like a stupid question, I'm just new to programming s'all.

Thanks for your help! hopefully i can stop this darn error if i get this to work :).

--
You received this message because you are subscribed to the Google Groups "YouTube APIs Developer Forum" group.
To view this discussion on the web visit https://groups.google.com/d/msg/youtube-api-gdata/-/yXudSAFbxK8J.
To post to this group, send email to youtube-api-gdata@googlegroups.com.
To unsubscribe from this group, send email to youtube-api-gdata+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/youtube-api-gdata?hl=en.

No comments:

Post a Comment