AutoWeb Spotify API play / pause

Discussion in 'AutoApps' started by Rich Wallace, Sep 18, 2017.

  1. Rich Wallace

    Rich Wallace Member

    Joined:
    Apr 10, 2015
    Messages:
    42
    Likes Received:
    1
    I'm trying to create a task to start playing Spotify automatically, given certain conditions.
    I think to use API action of "Start/Resume a users playback" the Spotify app first needs to be open?
    I seem to have mixed results with this action...sometimes it works, sometimes not.

    Im also trying to get, lets say a summary of my most listened to music, e.g. top artists.
    I think this is possible looking at the Spotify dev site, but I cant figure it out?
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,502
    Likes Received:
    720
    Did you try using Tasker's own Media Control Play action?
     
  3. Rich Wallace

    Rich Wallace Member

    Joined:
    Apr 10, 2015
    Messages:
    42
    Likes Received:
    1
    Yes I did and it does not work?

    Sent from my SM-G920F using Tapatalk
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,502
    Likes Received:
    720
    Sorry, I don't know of another way then :(
     
  5. Rich Wallace

    Rich Wallace Member

    Joined:
    Apr 10, 2015
    Messages:
    42
    Likes Received:
    1
    When I use the API action to resume playback I get an error....

    13.39.00/ActionArgBundle key: JoinOutputArray: replace <null> String value with null
    13.39.00/E FIRE PLUGIN: AutoWeb Web Service / com.twofortyfouram.locale.intent.action.FIRE_SETTING: 14 bundle keys
    13.39.00/E AutoWeb Web Service: plugin comp: com.joaomgcd.autoweb/com.joaomgcd.autoweb.broadcastreceiver.BroadcastReceiverFire
    13.39.00/E add wait type Plugin1 time 120
    13.39.00/E add wait type Plugin1 done
    13.39.00/E add wait task
    13.39.00/E Error: 1392894335
    13.39.00/E { "error" : { "status" : 403, "message" : "Forbidden." }}

    Sent from my SM-G950F using Tapatalk
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,502
    Likes Received:
    720
    Can you try re-authorizing the API in the main app by long clicking on it? Thanks
     
  7. Rich Wallace

    Rich Wallace Member

    Joined:
    Apr 10, 2015
    Messages:
    42
    Likes Received:
    1
    I tried this @joaomgcd and it did not help.
    The only work around I found was to have the tasker task open the Spotify app, wait for around 500ms then fire the autoweb action.
     
  8. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,502
    Likes Received:
    720
    Oh weird... so maybe the app needs to be in the foreground for the API to work? Sorry, nothing I can do about it in that case :/
     
  9. Komar004

    Komar004 New Member

    Joined:
    Oct 20, 2017
    Messages:
    2
    Likes Received:
    0
    message 403: no active device ID
    API (start/resume) to work needs a active device, so in my case enough spotify in notification.
    Maybe you can use 'send intent' to run spotify and play specific tracks/album/artists/playlist.
     
  10. Rich Wallace

    Rich Wallace Member

    Joined:
    Apr 10, 2015
    Messages:
    42
    Likes Received:
    1
    yeah I think its possible. but this way allows you to play a specific playlist, or artist or album for example.
    Im wanting to resume playback from where I left off, in most cases a suffle of my entire library
     
  11. Komar004

    Komar004 New Member

    Joined:
    Oct 20, 2017
    Messages:
    2
    Likes Received:
    0
    Ok, I guess have the solution.
    Code (Text):
    1. launch app
    2. wait 1s or 2s (just try)
    3. send intent:
       action: com.spotify.mobile.android.ui.widget.NEXT
      package: com.spotify.music
      target: broadcast receiver
    I tried similar action with "PLAY" but it doesn't work
     
: spotify, autoweb

Share This Page