Broken streaming URLs for Soundcloud API - soundcloud

I'm trying to play songs from the soundcloud api and there are a few that are not working. When I try to play the streaming url with my client id attached to it I get the following error in my console.
rack_24: Using HTML5 soundmanager2-jsmin.js?body=1:33
soundManager.stopAll() soundmanager2-jsmin.js?body=1:33
track_24: play(): Attempting to load soundmanager2-jsmin.js?body=1:33
track_24: load (http://api.soundcloud.com/tracks/104284258/stream?client_id=92a7061920c8cc8ab97038d2eba985cf) soundmanager2-jsmin.js?body=1:33
track_24: waiting soundmanager2-jsmin.js?body=1:33
track_24: loadstart soundmanager2-jsmin.js?body=1:33
track_24: HTML5 error, code 4 soundmanager2-jsmin.js?body=1:33
track_24: Failed to load / invalid sound? Zero-length duration reported. (http://api.soundcloud.com/tracks/104284258/stream?client_id=92a7061920c8cc8ab97038d2eba985cf)
If I click on the url it just takes me to a blank page. However if I click on a working url it will take me to an mp3 stream. Any ideas why this is happening? The song I am trying to play is Drake ~ Hold On, We're Going Home feat. Majid Jordan
I have more examples if you need.

I have had the same issue with some songs for few months now. If you use Soundcloud javascript SDK, problem seems to be resolved when you use new 2.0 sdk that became official on July 1st
https://developers.soundcloud.com/docs/api/javascript-sdk-2

Related

Picasa web albums - impossible to list all photos

I've uploaded about 40k photos using the Google Photos uploader tool, and now I'm trying to get a list of those photos using the Picasa Web Albums Data API (as there is no separate Google Photos API that I'm aware of).
So far, it appears impossible to get a complete list of all of the photos because you can list only 1000 photos at a time and then use the start-index parameter to do paging, but the server returns an error once you use a start-index above 11000. With a start-index of 11000 this occurs:
gdata.photos.service.GooglePhotosException: (500, 'Internal Server Error', 'Deprecated offset is too large for a stream ID query. Please switch to using resume tokens.')
(I'm using Python, but have confirmed that the error is independent of the language library)
I'd be happy to switch to using "resume tokens" like the error indicates... except that they are not mentioned in any documentation that I could find.
This is an authenticated request and the URL I'm using looks like this:
https://picasaweb.google.com/data/feed/api/user/[myUserID]/albumid/[myAlbumID]?kind=photo&max-results=1000&start-index=11000
Can anyone show me an example request using resume tokens or point me to documentation on them? Or, if anyone knows of some other way to get a complete list of all of the photos in a large album, that'd be great too. Thanks!
EDIT: the problem happens in any language, but in Python you can reproduce it consistently with:
startIndex = 1
while 1:
print '(fetching more photos)'
photos = client.GetFeed(ALBUM_URL, limit=1000, start_index=startIndex)
for photo in photos.entry:
print 'startIndex:', startIndex
startIndex += 1
where ALBUM_URL is like the URL I listed above and client is an authenticated instance of gdata.photos.service.PhotosService.

restfb: encountering 504 while uploading video sized 950 mb

Using restfb-1.6.12
Creating client as:
facebookClient = new DefaultFacebookClient(accessToken, new CustomWebRequestor(), new DefaultJsonMapper());
In CustomWebRequestor, customizeConnection() is overridden and following is specified:
connection.setChunkedStreamingMode(5242880);
Uploading video as:
facebookClient.publish("me/videos", FacebookType.class, BinaryAttachment.with(mediaFileName, mediaFileStream), Parameter.with("description", msg), Parameter.with("target_id", "me"), Parameter.with("metadata", 1));
Encountering following:
com.restfb.exception.FacebookNetworkException: A network error occurred while trying to communicate with Facebook: Facebook request failed (HTTP status code 504)
at com.restfb.DefaultFacebookClient.makeRequestAndProcessResponse(DefaultFacebookClient.java:625)
Upload happens as I can find the video on Facebook, but the reponse received from API doesn't tell me so. API works for videos of lesser size, like 400-500 MB. Recent change log doesn't mention any change around this either. Some help please.
Have you had a look at https://developers.facebook.com/docs/graph-api/reference/v2.0/user/videos#publish
There, Facebook states that
Videos must be encoded as multipart/form-data and published to
graph-video.facebook.com instead of the regular Graph API URL.
Also, other rules are
The aspect ratio of the video must be between 9x16 and 16x9, and the
video cannot exceed 1024MB or 180 minutes in length
Does RestFB use the correct endpoint?
Facebook fixed the problem under bug developers.facebook.com/bugs/791781120839901

Google Drive Sdk- Audio & Video Streaming in iOS Application

Hi Google Drive Staff,
I have tried to stream video files from Google Drive(Without Downloading). But I gets alerts that Sign In. I have went thoroughly with Dr. Edit sample App but i did not found any solution. I tried with downloadUrl , embedLink, webContentLink, alternateLink. All gives message to sign In. When i tried with exportsLinks i get a Null Message. What is the problem Here. If U have any suggestion Please Let me Know...
I have tried with Google Drive for iOS in iPod, there we can stream Video without Downloading.
Please suggest me to resolve this issue
Thanks in Advance...
I could solve it just by appending the access_token to the download url
audiofile.strPath=[NSString stringWithFormat#"%#&access_token=%#",downloadUrl,accessToken];
pass the strPath to your avplayer object to play music.
I did not try the video part. but i think a similar approach should work.
you can fetch the access token from the GTMOAuth2Authentication object
Note that you might need to refresh it if its expires.
Hope this helps you.
Regards
Nitesh
I think it depends what you mean by "stream". Last time I looked, the download links all had a content disposition: attachment header, which instructs the browser to download rather than render the content.
If you have your own client fetching the url, you can choose to ignore that header and do what you like with the content as it is fetched. imho, it would be nice if the client could add a parameter to the url to indicate to the Google servers that it wants the content to be rendered v. downloaded, but hey ho.
You need to authorize all requests to downloadLinks with an Authorization header. Read more about the authorization and learn how to retrieve your users an access token on https://developers.google.com/drive/about-auth

facebook chat on the iphone using xmppframework

Well i started of by following all the instructions here:
http://code.google.com/p/xmppframework/wiki/FacebookChatHowTo
I used the recommended fork of the facebook api and tried the latest from:
https://github.com/facebook/facebook-ios-sdk/
My problem starts with the following error:
< failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl">< not-authorized/></failure>
The error is a reply from facebook to xmppframework s response to a authentication challenge. The response that is made by the iphone is base64 encoded msg when i decode it i find 2 of the values are null:
api_key=(null)
and the
session_key=(null)
This is obviously the reason facebook is returning that error. But the problem i have is i cant seem to find any where to set these values in the framework. Besides i think the session_key should be pulled in from facebook anyway.
I guess what i want to know is a couple of things.
Has any one got the xmppframework working with facebook on a iDevice?
If you have got it working did you have to stray from the path of the instructions on http://code.google.com/p/xmppframework/wiki/FacebookChatHowTo ?
do you know of any other method to get facebook chat working on the iphone?
Any suggestions or help for my current dilemma would be appreciated. Happy to share my code if you want.
cheers
I wrote the Facebook integration for XMPPFramework. The api_key and session_key, come from a call to auth.PromoteSession. Facebook is trying to deprecate that call, so to enable it, you must follow step 7, in the HowTo:
Under Migrations, change Disable Deprecated Auth Methods from Enabled to Disabled and Save Changes.

Facebook old API Video upload

Our application uploads video to facebook (using the REST API video.upload method). Everything was working fine, but nearly 10 hours ago we started to receive the error "This method must run on api-video.facebook.com". We're already running it on api-video.facebook.com! The url is http://api-video.facebook.com/restserver.php?method=video.upload, it's hardcoded in the application, and never changed. What's happening? How can this be fixed?
Since Facebook doesn't seem to want to document this:
the call is to https://api-video.facebook.com/restserver.php
params:
access_token=...
method=video.upload
The rest of the params work as before.