Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
too_many_recent_calls
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  13 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
r3try  
View profile  
 More options May 18 2009, 10:20 am
From: r3try <daniel_thal...@gmx.at>
Date: Mon, 18 May 2009 07:20:25 -0700 (PDT)
Local: Mon, May 18 2009 10:20 am
Subject: too_many_recent_calls
hi people!  (sorry for my bad english in advance .. :) )
im new to this and i hope this is the right place to put my question
to...

im writing a java program, that tries to find similarities between
artists based on occurrences of special words in the youtube-comments
of a video.
i have a list of songs and albums of every artist and based on that
information i search for the corresponding videos and get the feeds
for them to get the information that i need.

here are two methods where i run into the trouble:

        public void getYoutubeSongs(String artist_name, YouTubeService
service) throws IOException,
                        ServiceException {

                System.out.println("... getting songs-infos from Youtube ...");

                YouTubeQuery query = new YouTubeQuery(new URL(
                "http://gdata.youtube.com/feeds/api/videos"));
                // order results by the number of views (most viewed first)
                query.setOrderBy(YouTubeQuery.OrderBy.VIEW_COUNT);
                VideoFeed videoFeed;
                Query.CategoryFilter categoryFilter1 = new Query.CategoryFilter();

                // this restricts to videos in the category of "Music".
                categoryFilter1.addCategory(new Category(
                                YouTubeNamespace.CATEGORY_SCHEME, "Music"));

                // multiple filters mean "AND" in a category query
                query.addCategoryFilter(categoryFilter1);
                // query.addCategoryFilter(categoryFilter2);

                for (String song : this.songs) {
                        query.setFullTextQuery(artist_name + " " + song);
                        videoFeed = service.query(query, VideoFeed.class);
                        // iterate over each videoEntry and fetch comments and tags
                        this.fetchYoutubeCommentsAndTags(videoFeed, service);
                }
        }

/**
         * fetches all keywords and comments from the given video-feed.
         * the tag-occurrences are counted.
         * @param videoFeed the videoFeed to iterate over
         * @param service the service to operate on
         */
        public void fetchYoutubeCommentsAndTags(VideoFeed videoFeed,
                        YouTubeService service) throws IOException, ServiceException {
                int oldVal;

                // iterate over each videoEntry
                CommentFeed commentFeed;
                for (VideoEntry videoEntry : videoFeed.getEntries()) {
                        YouTubeMediaGroup mediaGroup = videoEntry.getMediaGroup();
                        MediaKeywords keywords = mediaGroup.getKeywords();

                        // fetch all keywords of the videoEntry (and count the occurrences)
                        for (String keyword : keywords.getKeywords()) {
                                keyword = Stuff.normalizeKeyword(keyword.toLowerCase());
                                if (!youtubeTags.containsKey(keyword)) {
                                        youtubeTags.put(keyword, 1);// first occurrence
                                } else {
                                        oldVal = youtubeTags.get(keyword);
                                        youtubeTags.put(keyword, oldVal + 1);// tag already inserted
                                }
                        }

                        // Kommentare extrahieren (wenn vorhanden)
                        if (videoEntry.getComments() != null) {
                                String commentUrl = videoEntry.getComments().getFeedLink()
                                                .getHref();
                                commentFeed = service.getFeed(new URL(commentUrl),
                                                CommentFeed.class);

                                // only store different comments
                                for (CommentEntry comment : commentFeed.getEntries()) {
                                        if (!youtubeComments
                                                        .contains(comment.getPlainTextContent())) {
                                                youtubeComments.add(comment.getPlainTextContent());
                                        }
                                }
                        }
                }
        }

at the moment im only trying my program with 1 artist. for every
artist there are about 20 albums and 50 songs. (just to give you a
dimension...)
for getting the information for the artist itself and for the albums
there is another method pretty similar to the getYoutubeSongs() -
method

i hope someone can tell me where the problem is. i mean the error-msg
seems quite clear, but i cannot imagine that there is really no way to
realize what im planning to do...

im grateful for every help!

kind regards,
daniel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Fisher  
View profile  
 More options May 18 2009, 5:03 pm
From: Jeff Fisher <jfis...@youtube.com>
Date: Mon, 18 May 2009 14:03:08 -0700
Local: Mon, May 18 2009 5:03 pm
Subject: Re: [YouTube-API] too_many_recent_calls

Throw in some Thread.sleep() statements perhaps? :)

Cheers,
-Jeff


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Thaller  
View profile  
 More options May 19 2009, 3:57 am
From: Daniel Thaller <daniel_thal...@gmx.at>
Date: Tue, 19 May 2009 09:57:05 +0200
Local: Tues, May 19 2009 3:57 am
Subject: Re: [YouTube-API] Re: too_many_recent_calls
Jeff Fisher schrieb:

thanks for the reply!

[quote]Throw in some Thread.sleep() statements perhaps? :)[/quote]
where should i put them and how long should the thread sleep ... i dont
really get what exactly causes my problems....

kind regards,
daniel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phot Sirch  
View profile  
 More options May 19 2009, 4:29 am
From: Phot Sirch <Photsi...@gmail.com>
Date: Tue, 19 May 2009 10:29:07 +0200
Local: Tues, May 19 2009 4:29 am
Subject: Re: [YouTube-API] Re: too_many_recent_calls

The rate to fire requests to YouTube is too high. Try to lower it. I
am not sure, but perhaps setting the developer key and the client id
helps (http://code.google.com/apis/youtube/dashboard/).

Double the timeout when you receive the error. Lower the timeout a
tiny bit when you did not receive an error...

Cheers


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Thaller  
View profile  
 More options May 19 2009, 5:02 am
From: Daniel Thaller <daniel_thal...@gmx.at>
Date: Tue, 19 May 2009 11:02:30 +0200
Local: Tues, May 19 2009 5:02 am
Subject: Re: [YouTube-API] Re: too_many_recent_calls
Phot Sirch schrieb:

the developer key and the client id are set using the command:
YouTubeService service = new YouTubeService("xxx", "xxx");
the service-object is then passed to the methods as you can see in the
example code i posted...

@rate of firing requests: what is the maximum rate that is allowed? i
mean, i dont know if i have to wait some milliseconds, seconds, minutes,
hours?!?

ahh, and 1 point i was wondering about: today the first time i ran the
program, it ended without any error. (is there a cap for a whole day
eventually? for example: 1000 requests per day --> in that case the
thread.sleep() statements wouldnt help, right?(at least if i dont want
my program to run the whole day :-) ) )

kind regards,
daniel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Thaller  
View profile  
 More options May 19 2009, 6:10 am
From: Daniel Thaller <daniel_thal...@gmx.at>
Date: Tue, 19 May 2009 12:10:29 +0200
Local: Tues, May 19 2009 6:10 am
Subject: Re: [YouTube-API] Re: too_many_recent_calls
Phot Sirch schrieb:

hmm.. now i added the thread.sleep() command like you suggested. i dont
get the old error anymore, but i get a service-unavailable error in
following line in the fetchYoutubeCommentsAndTags()-method

commentFeed = service.getFeed(new URL(commentUrl),CommentFeed.class);

any ideas?

kind regards,
daniel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Fisher  
View profile  
 More options May 19 2009, 3:56 pm
From: Jeff Fisher <jfis...@youtube.com>
Date: Tue, 19 May 2009 12:56:46 -0700
Local: Tues, May 19 2009 3:56 pm
Subject: Re: [YouTube-API] Re: too_many_recent_calls

Service unavailable is usually a temporary service outage.

On Tue, May 19, 2009 at 3:10 AM, Daniel Thaller <daniel_thal...@gmx.at>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Thaller  
View profile  
 More options May 20 2009, 2:47 am
From: Daniel Thaller <daniel_thal...@gmx.at>
Date: Wed, 20 May 2009 08:47:37 +0200
Local: Wed, May 20 2009 2:47 am
Subject: Re: [YouTube-API] Re: too_many_recent_calls
Jeff Fisher schrieb:

... so i can not do anything against that service unavailable-exception?!

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Fisher  
View profile  
 More options May 21 2009, 4:30 pm
From: Jeff Fisher <jfis...@youtube.com>
Date: Thu, 21 May 2009 13:30:41 -0700
Local: Thurs, May 21 2009 4:30 pm
Subject: Re: [YouTube-API] Re: too_many_recent_calls

Not really. Maybe pray to the deity of your choice? :)

Seriously though, these are meant to be temporary and happen very rarely. We
don't ever plan on having service interruptions of no API service  at all
(really!)

Cheers,
-Jeff

On Tue, May 19, 2009 at 11:47 PM, Daniel Thaller <daniel_thal...@gmx.at>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
r3try  
View profile  
 More options May 22 2009, 12:58 pm
From: r3try <daniel_thal...@gmx.at>
Date: Fri, 22 May 2009 09:58:02 -0700 (PDT)
Local: Fri, May 22 2009 12:58 pm
Subject: Re: too_many_recent_calls
hmm.. my program is now running for about 1 hour (because of the
thread.sleep commands) and by now i got 3 times the exception

com.google.gdata.util.ServiceException: Service Unavailable
<errors xmlns='http://schemas.google.com/g/2005'>
<error>
<domain>GData</domain>
<code>ServiceUnavailableException</code>
<internalReason>Service Unavailable</internalReason>
</error>
</errors>

        at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse
(HttpGDataRequest.java:533)
        at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse
(GoogleGDataRequest.java:562)
        at com.google.gdata.client.http.HttpGDataRequest.checkResponse
(HttpGDataRequest.java:481)
        at com.google.gdata.client.http.HttpGDataRequest.execute
(HttpGDataRequest.java:460)
        at com.google.gdata.client.http.GoogleGDataRequest.execute
(GoogleGDataRequest.java:534)
        at com.google.gdata.client.Service.getFeed(Service.java:962)
        at com.google.gdata.client.Service.getFeed(Service.java:819)
        at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:
593)
        at com.google.gdata.client.Service.getFeed(Service.java:838)
        at compareTags.CompArtist.fetchYoutubeCommentsAndTags(CompArtist.java:
293)
        at compareTags.CompArtist.getYoutubeSongs(CompArtist.java:221)
        at compareTags.CompArtist.fetchData(CompArtist.java:334)
        at compareTags.Analysis.main(Analysis.java:35)

--> i dont consider this rare... :P

On 21 Mai, 22:30, Jeff Fisher <jfis...@youtube.com> wrote:

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jeff Fisher  
View profile  
 More options May 22 2009, 2:10 pm
From: Jeff Fisher <jfis...@youtube.com>
Date: Fri, 22 May 2009 11:10:15 -0700
Local: Fri, May 22 2009 2:10 pm
Subject: Re: [YouTube-API] Re: too_many_recent_calls

Okay, but is this reproducible with a small bit of sample code and doing
only a few operations or is this like 3 exceptions in an hour when
performing hundreds of requests?

Cheers,
-Jeff

...

read more »


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
r3try  
View profile  
 More options May 23 2009, 3:30 am
From: r3try <daniel_thal...@gmx.at>
Date: Sat, 23 May 2009 00:30:23 -0700 (PDT)
Local: Sat, May 23 2009 3:30 am
Subject: Re: too_many_recent_calls

> Okay, but is this reproducible with a small bit of sample code and doing
> only a few operations

--> semms to be random...

>or is this like 3 exceptions in an hour when
> performing hundreds of requests?

--> yes (but i was wondering that this happens so frequently...)

is there a possibility to find out if the service is available, and
only if it is available to start my request.. i mean to find out
before i send my request, so that i dont run into this error....?

sorry for bothering you guys so long...

best regards,
daniel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phot Sirch  
View profile  
 More options May 23 2009, 3:22 pm
From: Phot Sirch <Photsi...@gmail.com>
Date: Sat, 23 May 2009 21:22:44 +0200
Local: Sat, May 23 2009 3:22 pm
Subject: Re: [YouTube-API] Re: too_many_recent_calls
If the error appears randomly, it may be difficult to foresee, right?

But the good part about errors that appear randomly is, that if you
try the same request a second time, it might work...

Depending on you application you can either queue it up again, do some
other stuff in the meantime, or if a user is waiting for the request
to succeed, retry with a increasing timeout several times (like 3
times). First wait 20 seconds, then 40 seconds, and it is still
failing 80 seconds.

Cheers,


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »