Adding Favorite Error 400

16 views
Skip to first unread message

Mr. Gecko

unread,
Apr 23, 2009, 10:28:53 PM4/23/09
to Google Data APIs Objective-C Client Library Discussion
I'm trying to add a video to the users Favorites and I'm getting error
code 501.

Here is the output in the console.
2009-04-23 21:00:34.021: Error Error
Domain=com.google.GDataServiceDomain Code=400 UserInfo=0x17a9deb0
"Operation could not be completed. (com.google.GDataServiceDomain
error 400.)"
2009-04-23 21:00:34.028: *** Assertion failure in -[NSTextFieldCell
_objectValue:forString:errorDescription:], /SourceCache/AppKit/
AppKit-949.43/AppKit.subproj/NSCell.m:1338
2009-04-23 21:00:34.030: Invalid parameter not satisfying: aString !=
nil

and this is how I'm adding.
GDataEntryYouTubeVideo *object = [results objectAtIndex:[resultsTable
selectedRow]];
[youTubeService fetchEntryByInsertingEntry:object forFeedURL:[NSURL
URLWithString:@"http://gdata.youtube.com/feeds/api/users/default/
favorites"] delegate:self didFinishSelector:nil
didFailSelector:@selector(entryListFetchTicket:failedWithError:)];

And this is the xml of entry
<entry>
<content type="text">Follow Googler Maile Ohye as she goes through
her day at Webmaster Central, our one-stop shop for webmaster support
and resources. Check out interviews with Googlers </content>
<id>http://gdata.youtube.com/feeds/api/videos/gSbZMeh_69w</id>
<author><name>Google</name><uri>http://gdata.youtube.com/feeds/api/
users/google</uri></author>
<published>2008-07-30T18:36:44.000Z</published>
<updated>2009-04-23T02:09:52.000Z</updated>
<gd:rating average="4.53" max="5" numRaters="118" min="1"></
gd:rating>
<category term="Tech" label="Science &amp; Technology" scheme="http://
gdata.youtube.com/schemas/2007/categories.cat"></category>
<category term="Central" scheme="http://gdata.youtube.com/schemas/
2007/keywords.cat"></category>
<category term="http://gdata.youtube.com/schemas/2007#video"
scheme="http://schemas.google.com/g/2005#kind"></category>
<category term="Webmaster" scheme="http://gdata.youtube.com/schemas/
2007/keywords.cat"></category>
<category term="Google" scheme="http://gdata.youtube.com/schemas/2007/
keywords.cat"></category>
<media:group>
<yt:duration seconds="387"></yt:duration>
<media:thumbnail width="120" url="http://i.ytimg.com/vi/gSbZMeh_69w/
2.jpg" height="90" time="00:03:13.500"></media:thumbnail>
<media:thumbnail width="120" url="http://i.ytimg.com/vi/gSbZMeh_69w/
1.jpg" height="90" time="00:01:36.750"></media:thumbnail>
<media:thumbnail width="120" url="http://i.ytimg.com/vi/gSbZMeh_69w/
3.jpg" height="90" time="00:04:50.250"></media:thumbnail>
<media:thumbnail width="320" url="http://i.ytimg.com/vi/gSbZMeh_69w/
0.jpg" height="240" time="00:03:13.500"></media:thumbnail>
<media:player url="http://www.youtube.com/watch?v=gSbZMeh_69w"></
media:player>
<media:category scheme="http://gdata.youtube.com/schemas/2007/
categories.cat" label="Science &amp; Technology">Tech</media:category>
<media:description type="plain">Follow Googler Maile Ohye as she
goes through her day at Webmaster Central, our one-stop shop for
webmaster support and resources. Check out interviews with Googlers </
media:description>
<media:content isDefault="true" url="http://www.youtube.com/v/
gSbZMeh_69w&amp;f=videos&amp;d=4rLQF9mefVQygkIEQIYUdmD9LlbsOl3qUImVMV6ramM&amp;app=youtube_gdata"
type="application/x-shockwave-flash" expression="full" medium="video"
duration="387" format="5"></media:content>
<media:content expression="full" url="rtsp://rtsp2.youtube.com/
CkQLENy73wIaOwnc63_oMdkmgRMYDSANFEgGUgZ2aWRlb3NyIOKy0BfZnn1UMoJCBECGFHZg_S5W7Dpd6lCJlTFeq2pjDA==/
0/0/0/video.3gp" type="video/3gpp" duration="387" medium="video"
format="1"></media:content>
<media:content expression="full" url="rtsp://rtsp2.youtube.com/
CkQLENy73wIaOwnc63_oMdkmgRMYESARFEgGUgZ2aWRlb3NyIOKy0BfZnn1UMoJCBECGFHZg_S5W7Dpd6lCJlTFeq2pjDA==/
0/0/0/video.3gp" type="video/3gpp" duration="387" medium="video"
format="6"></media:content>
<media:keywords>Webmaster, Central, Google</media:keywords>
<media:title type="plain">A day in the life of webmaster support</
media:title>
</media:group>
<title type="text">A day in the life of webmaster support</title>
<yt:statistics viewCount="21083" favoriteCount="70"></yt:statistics>
<link rel="alternate" href="http://www.youtube.com/watch?
v=gSbZMeh_69w" type="text/html"></link>
<link rel="http://gdata.youtube.com/schemas/2007#video.ratings"
href="http://gdata.youtube.com/feeds/api/videos/gSbZMeh_69w/ratings"
type="application/atom+xml"></link>
<link rel="http://gdata.youtube.com/schemas/2007#video.complaints"
href="http://gdata.youtube.com/feeds/api/videos/gSbZMeh_69w/
complaints" type="application/atom+xml"></link>
<link rel="http://gdata.youtube.com/schemas/2007#video.related"
href="http://gdata.youtube.com/feeds/api/videos/gSbZMeh_69w/related"
type="application/atom+xml"></link>
<link rel="http://gdata.youtube.com/schemas/2007#mobile" href="http://
m.youtube.com/details?v=gSbZMeh_69w" type="text/html"></link>
<link rel="self" href="http://gdata.youtube.com/feeds/api/videos/
gSbZMeh_69w" type="application/atom+xml"></link>
<gd:comments>
<gd:feedLink href="http://gdata.youtube.com/feeds/api/videos/
gSbZMeh_69w/comments" countHint="89"></gd:feedLink>
</gd:comments>
</entry>

I've tried to get the current gdata-objective-c from svn and it didn't
fix it.

Thanks for the help,
Mr. Gecko

Mr. Gecko

unread,
Apr 24, 2009, 5:34:18 PM4/24/09
to Google Data APIs Objective-C Client Library Discussion
Ok, so I downloaded the latest svn and I get error 501 now.
2009-04-24 16:20:42.681 YouView[9560:10b] Error Error
Domain=com.google.GDataServiceDomain Code=501 UserInfo=0x17a5e7e0
"Operation could not be completed. (GData error noPostConcurrency:
"POST method does not support concurrency")"
2009-04-24 16:20:42.687 YouView[9560:10b] *** Assertion failure in -
[NSTextFieldCell _objectValue:forString:errorDescription:], /
SourceCache/AppKit/AppKit-949.43/AppKit.subproj/NSCell.m:1338
2009-04-24 16:20:42.688 YouView[9560:10b] Invalid parameter not
satisfying: aString != nil

XML
<entry gd:etag="W/&quot;D0cCSX47eCp7ImA9WxJTFU4.&quot;">
<published>2008-07-30T18:36:44.000Z</published>
<category term="Tech" label="Science &amp; Technology" scheme="http://
gdata.youtube.com/schemas/2007/categories.cat"></category>
<category term="Central" scheme="http://gdata.youtube.com/schemas/
2007/keywords.cat"></category>
<category term="http://gdata.youtube.com/schemas/2007#video"
scheme="http://schemas.google.com/g/2005#kind"></category>
<category term="Webmaster" scheme="http://gdata.youtube.com/schemas/
2007/keywords.cat"></category>
<category term="Google" scheme="http://gdata.youtube.com/schemas/2007/
keywords.cat"></category>
<link rel="alternate" href="http://www.youtube.com/watch?
v=gSbZMeh_69w" type="text/html"></link>
<link rel="http://gdata.youtube.com/schemas/2007#video.ratings"
href="http://gdata.youtube.com/feeds/api/videos/gSbZMeh_69w/ratings"
type="application/atom+xml"></link>
<link rel="http://gdata.youtube.com/schemas/2007#video.complaints"
href="http://gdata.youtube.com/feeds/api/videos/gSbZMeh_69w/
complaints" type="application/atom+xml"></link>
<link rel="http://gdata.youtube.com/schemas/2007#video.related"
href="http://gdata.youtube.com/feeds/api/videos/gSbZMeh_69w/related"
type="application/atom+xml"></link>
<link rel="http://gdata.youtube.com/schemas/2007#mobile" href="http://
m.youtube.com/details?v=gSbZMeh_69w" type="text/html"></link>
<link rel="self" href="http://gdata.youtube.com/feeds/api/videos/
gSbZMeh_69w" type="application/atom+xml"></link>
<id>tag:youtube.com,2008:video:gSbZMeh_69w</id>
<title>A day in the life of webmaster support</title>
<media:group>
<media:keywords>Webmaster, Central, Google</media:keywords>
<yt:videoid>gSbZMeh_69w</yt:videoid>
<media:credit scheme="urn:youtube" role="uploader"
yt:type="partner">Google</media:credit>
<yt:duration seconds="387"></yt:duration>
<media:category scheme="http://gdata.youtube.com/schemas/2007/
categories.cat" label="Science &amp; Technology">Tech</media:category>
<yt:uploaded>2008-07-30T18:36:44.000Z</yt:uploaded>
<media:content isDefault="true" url="http://www.youtube.com/v/
gSbZMeh_69w&amp;f=videos&amp;d=4rLQF9mefVQygkIEQIYUdmD9LlbsOl3qUImVMV6ramM&amp;app=youtube_gdata"
type="application/x-shockwave-flash" expression="full" medium="video"
duration="387" yt:format="5"></media:content>
<media:content expression="full" url="rtsp://rtsp2.youtube.com/
CkQLENy73wIaOwnc63_oMdkmgRMYDSANFEgGUgZ2aWRlb3NyIOKy0BfZnn1UMoJCBECGFHZg_S5W7Dpd6lCJlTFeq2pjDA==/
0/0/0/video.3gp" type="video/3gpp" duration="387" medium="video"
yt:format="1"></media:content>
<media:content expression="full" url="rtsp://rtsp2.youtube.com/
CkQLENy73wIaOwnc63_oMdkmgRMYESARFEgGUgZ2aWRlb3NyIOKy0BfZnn1UMoJCBECGFHZg_S5W7Dpd6lCJlTFeq2pjDA==/
0/0/0/video.3gp" type="video/3gpp" duration="387" medium="video"
yt:format="6"></media:content>
<media:thumbnail width="120" url="http://i.ytimg.com/vi/gSbZMeh_69w/
2.jpg" height="90" time="00:03:13.500"></media:thumbnail>
<media:thumbnail width="120" url="http://i.ytimg.com/vi/gSbZMeh_69w/
1.jpg" height="90" time="00:01:36.750"></media:thumbnail>
<media:thumbnail width="120" url="http://i.ytimg.com/vi/gSbZMeh_69w/
3.jpg" height="90" time="00:04:50.250"></media:thumbnail>
<media:thumbnail width="480" url="http://i.ytimg.com/vi/gSbZMeh_69w/
hqdefault.jpg" height="360"></media:thumbnail>
<media:title type="plain">A day in the life of webmaster support</
media:title>
<media:description type="plain">Follow Googler Maile Ohye as she
goes through her day at Webmaster Central, our one-stop shop for
webmaster support and resources. Check out interviews with Googlers </
media:description>
<media:player url="http://www.youtube.com/watch?v=gSbZMeh_69w"></
media:player>
</media:group>
<yt:statistics viewCount="21089" favoriteCount="71"></yt:statistics>
<gd:comments>
<gd:feedLink href="http://gdata.youtube.com/feeds/api/videos/
gSbZMeh_69w/comments" countHint="89"></gd:feedLink>
</gd:comments>
<content src="http://www.youtube.com/v/
gSbZMeh_69w&amp;f=videos&amp;d=4rLQF9mefVQygkIEQIYUdmD9LlbsOl3qUImVMV6ramM&amp;app=youtube_gdata"
type="application/x-shockwave-flash"></content>
<gd:rating average="4.53" max="5" numRaters="118" min="1"></
gd:rating>
<updated>2009-04-24T01:04:28.000Z</updated>
<author>
<uri>http://gdata.youtube.com/feeds/api/users/google</uri>
<name>Google</name>
</author>
</entry>

Thomas Van Lenten

unread,
Apr 24, 2009, 11:10:23 PM4/24/09
to gdata-objec...@googlegroups.com
On Fri, Apr 24, 2009 at 5:34 PM, Mr. Gecko <GRMr...@gmail.com> wrote:

Ok, so I downloaded the latest svn and I get error 501 now.

If I'm remembering right there are some updates to the YT classes for newer features, so updating could have cause slightly different request to trigger the change in result code.

I can't say I'm very familiar with the YT api, you might want to try also posting your XML to the YT API group, as they can better speak to specifics of the server and API.

TVL

Mr. Gecko

unread,
Apr 25, 2009, 12:24:25 AM4/25/09
to Google Data APIs Objective-C Client Library Discussion
Ok, thanks.

On Apr 24, 10:10 pm, Thomas Van Lenten <thoma...@gmail.com> wrote:

Greg Robbins

unread,
Apr 27, 2009, 10:09:35 PM4/27/09
to gdata-objec...@googlegroups.com
The code in this message for adding a YouTube favorite still works for me:

http://groups.google.com/group/gdata-objectivec-client/msg/be6c031a17790535


The "noPostConcurrency" error message is surprising. It implies that there is a header for the POST specifying that the ETag string should of the new entry be compared to the ETag of an entry already on the server, but that makes no sense for an insert operation, because a new entry is being uploaded. The http log included above does not also include the headers for the XML being posted, however, so I'm not certain what is being sent to the server.

I'd set a breakpoint in GDataServiceBase's method -requestForURL:ETag:httpMethod: to see what is being added to the POST header.

Fabio Nisci

unread,
Feb 16, 2013, 11:31:37 AM2/16/13
to gdata-objec...@googlegroups.com
confirm. still working solution! great!
Is there any way to check if a video is in favorite playlist?
I don't want to to scan the entire feed looking for a videoID.... 
Reply all
Reply to author
Forward
0 new messages