标签: spotify

通过Web API或libspotify获取Spotify播放历史记录

有没有办法使用他们的js或C API获取我的Spotify游戏历史记录?我看了几个例子,但那是他们过时的API版本.

javascript c spotify facebook-graph-api libspotify

6
推荐指数
2
解决办法
3380
查看次数

如何向iOS控制中心添加功能

今天使用Spotify Radio并注意到他们已在控制中心上替换了"<<"的菜单按钮.当你按下它时,你会看到右边的菜单.我之前通过MPNowPlayingInfoCenter类与Control Center合作过,但在文档中没有提到这种功能.谁知道他们是怎么做到的?

这是在iOS7上运行所以(理论上)它不是扩展.

带Spotify的iOS控制中心

controls center spotify ios ios7

6
推荐指数
1
解决办法
2073
查看次数

如何在Spotify SDK for Android上刷新访问令牌?

我正在使用Spotify SDK和来自kaaes的Spotify Web Api Android制作Android的应用程序.刷新访问令牌的最佳方法是什么?因为我需要保持用户登录.

每次用户打开应用程序时,我都不希望我的应用程序要求登录.

我怎么处理这个?

retrofit.RetrofitError: 401 Unauthorized
Login to Spotify failed because of invalid credentials
Run Code Online (Sandbox Code Playgroud)

感谢您的时间和帮助!问候.

android token spotify asp.net-web-api

6
推荐指数
1
解决办法
2338
查看次数

将EchoNest API分析器迁移到Spotify

我使用echonest分析器上传曲目并从中获取一些音频特征.

我通过发送卷曲请求来做到这一点.

我意识到现在API已经减少到了Spotify,我想知道我是否仍然可以上传曲目进行分析,而不是仅仅根据他们的Spotify ID分析曲目.

我曾经使用过这种方法:

$post = array(
     "url"=>$title,
     "api_key"=>"myAPI",
     "format"=>"json"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, "http://developer.echonest.com/api/v4/track/upload");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post); 
$response = curl_exec($ch);

$result=json_decode($response,true);

$status=$result['response']['track']['status'];
Run Code Online (Sandbox Code Playgroud)

使用Spotify有类似的方法吗?谢谢.

我可以使用离线功能分析仪,但我已经使用EchoNest分析仪训练我原来的模式在这里.

spotify echonest

6
推荐指数
1
解决办法
509
查看次数

React-Native Spotify SDK iOS:关闭身份验证窗口

我一直在使用以下模块开发一个react-native应用程序:

https://github.com/viestat/react-native-spotify

目前,应用程序打开认证窗口以登录到spotify.我确实得到了成功的回报,但我很困惑,我现在如何摆脱弹出登录的窗口.我知道它应该重定向回我的应用程序,但它只是与logout /我的帐户按钮保持在同一个窗口.

如何在退回的成功消息上关闭此窗口的任何想法?

SpotifyAuth.setClientID('*****','*****', ['streaming', 'playlist-read-private'], (error)=>{
          if(error){
            console.log(error);
          } else {
            console.log('success');
          }
        });
Run Code Online (Sandbox Code Playgroud)

这是我在xcode中的设置...

我在Spotify应用程序中的重定向URI

spotify ios reactjs react-native

6
推荐指数
1
解决办法
425
查看次数

口吃和曲目开始多次播放

每当使用Spotify播放器时,我们会遇到持续大约十秒钟的口吃.虽然有一些方面对我来说似乎不正常但是它发生的最一致的标志是我们didStartPlayingTrack不止一次地击中委托方法,即使我们只告诉玩家玩一次.有没有人有任何想法会导致这种情况发生?

重要提示:这是 spotify-ios-sdk version 0.21

日志样本:

audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyTrackDelivered") // Last track ended
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyAudioDeliveryDone")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyPause")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyMetadataChanged")
movePlayerPosition(_:completion:)[L:180]: seek successful to 0.842
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyMetadataChanged")
13:13:50 audioStreaming(_:didStartPlayingTrack:)[L:377]: didStartPlayingTrack: Optional("So Far Away (Live) - Live")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyTrackChanged")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackEventAudioFlush")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyPlay")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyMetadataChanged")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyMetadataChanged")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyContextChanged")
13:14:01 audioStreaming(_:didStartPlayingTrack:)[L:377]: didStartPlayingTrack: Optional("So Far Away (Live) - Live")
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackNotifyTrackChanged")
audioStreaming(_:didSeekToPosition:)[L:474]: did seek to position: 0.001
audioStreaming(_:didReceive:withName:)[L:412]: didReceiveEvent: Optional("SPPlaybackEventAudioFlush") …
Run Code Online (Sandbox Code Playgroud)

spotify ios swift

6
推荐指数
1
解决办法
146
查看次数

Spotify API {'error': 'invalid_client'} 授权代码流 [400]

这是我向https://accounts.spotify.com/api/token发出 POST 请求的众多尝试之一。

范围设置为“播放列表-修改-公共,播放列表-修改-私有”。

我使用的是 Python 3.7,Django 2.1.3。

无论我做什么, response_data 都会返回 {'error': 'invalid_client'}

我已经尝试了很多事情,包括根据此特定请求的官方 Spotify 文档在请求正文中传递 client_id/client_secret ......无济于事。

请帮忙!

def callback(request):

    auth_token = request.GET.get('code')     # from the URL after user has clicked accept
    code_payload = {
        'grant_type': 'authorization_code',
        'code': str(auth_token),
        'redirect_uri': REDIRECT_URI,
    }

    auth_str = '{}:{}'.format(CLIENT_ID, CLIENT_SECRET)
    b64_auth_str = base64.b64encode(auth_str.encode()).decode()

    headers = {
        'Content-Type': 'application/x-www-form-urlencoded',
        'Authorization': 'Basic {}'.format(b64_auth_str)
    }

    post_request = requests.post(SPOTIFY_TOKEN_URL, data=code_payload, headers=headers)

    response_data = json.loads(post_request.text)
        # ==> {'error': 'invalid_client'}
Run Code Online (Sandbox Code Playgroud)

python django spotify

6
推荐指数
2
解决办法
5282
查看次数

缺少有关 Spotify 开发人员“曲目音频分析”的信息

在 Spotify Developer 上,有对“获取曲目的音频分析”返回的 JSON 格式的描述。但是,没有关于“track.codestring”、“track.echoprintstring”和“track.rhythmstring”的信息。有谁知道隐藏在这些长字符串中的信息的定义?

我目前正在着手应用于音乐信息检索的机器/深度学习。

似乎没有办法直接在 developer.spotify 上解决这个问题。所以我在网上漫游,但找不到答案。

这是在“ https://developer.spotify.com/documentation/web-api/reference/tracks/get-audio-analysis/ ”上的 JSON 示例中

"codestring": "eJxVnAmS5DgOBL-ST-B9_P9j4x7M6qoxW9tpsZQSCeI...",
"code_version": 3.15,

"echoprintstring": "eJzlvQmSHDmStHslxw4cB-v9j_A-tahhVKV0IH9...",
"echoprint_version": 4.12,

"synchstring": "eJx1mIlx7ToORFNRCCK455_YoE9Dtt-vmrKsK3EBsTY...",
"synch_version": 1,

"rhythmstring": "eJyNXAmOLT2r28pZQuZh_xv7g21Iqu_3pCd160xV...",
"rhythm_version": 1
Run Code Online (Sandbox Code Playgroud)

audio json spotify

6
推荐指数
1
解决办法
614
查看次数

是否可以连接到 Spotify 的 MediaBrowserService?

我正在编写语音助手,希望能够在 Spotify 中启动搜索结果。为了了解如何连接到 Spotify 和其他应用程序,我正在使用Google 的媒体控制器测试应用程序,它被描述为执行以下操作:

创建一个连接到 MediaBrowserService 的简单 MediaController 以测试应用间媒体控件。

此应用程序可与通用 Android 音乐播放器示例或任何其他实现媒体 API 的应用程序配合使用。

当我运行该应用程序时,它将 Spotify 标识为提供MediaBrowserService,但是当我尝试通过该应用程序连接到 Spotify 时出现错误:

包含错误的 Android 屏幕截图:“Spotify 的 MediaBrowser 连接失败”

这是连接代码

mBrowser = new MediaBrowserCompat(this, mMediaAppDetails.componentName,
        new MediaBrowserCompat.ConnectionCallback() {
             @Override
             public void onConnected() {
                 setupMediaController();
                 mBrowseMediaItemsAdapter.setRoot(mBrowser.getRoot());
             }

             @Override
             public void onConnectionSuspended() {
                 //TODO(rasekh): shut down browser.
                 mBrowseMediaItemsAdapter.setRoot(null);
             }

             @Override
             public void onConnectionFailed() {
                 showToastAndFinish(getString(
                         R.string.connection_failed_msg, mMediaAppDetails.appName));
             }

         }, null);
mBrowser.connect();
Run Code Online (Sandbox Code Playgroud)

具体来说,在调用之后不久mBrowser.connect(),回调的onConnectionFailed()方法被调用。

这是否意味着Spotify的拒绝MediaBrowserService来自非白名单中的应用程序请求(如描述在这里),并有没有办法让一个单独的应用程序的作家连接到Spotify的MediaBrowserService,或者是有一些其他的方式来连接?FWIW,Google Play …

android spotify android-service google-music mediabrowserservice

6
推荐指数
1
解决办法
604
查看次数

在未聚焦时将键盘输入发送到 Spotify

我有一个 AHK 脚本(如下),它在后台向 Spotify 桌面应用程序全局发送各种命令以执行各种操作,但是我玩了一个 MMO,它具有始终运行的反作弊功能,当它检测到 AHK 时会关闭游戏,因为人们可以将它用于宏等。

; "CTRL + Alt + UP"  Increase the volume.
^!Up::
DetectHiddenWindows, On
WinGet, winInfo, List, ahk_exe Spotify.exe
Loop, %winInfo%
{
    thisID := winInfo%A_Index%
    ControlFocus , , ahk_id %thisID%
    ControlSend, , ^{up}, ahk_id %thisID%
}
return
Run Code Online (Sandbox Code Playgroud)

反作弊不会检测/关心 C# 程序/应用程序,因此我将代码移植到 C# 并找到了一种方法将命令发送到 Spotify 应用程序以通过SendMessage执行我想要的大部分内容:

private const int WM_KEYDOWN = 0x0100;
private const int WM_KEYUP = 0x0101; //Tried using these to no avail
private const int WM_KEYSYS = 0x0104;
private const int WM_ACTIVATEAPP …
Run Code Online (Sandbox Code Playgroud)

c# autohotkey sendkeys spotify

6
推荐指数
1
解决办法
513
查看次数