# Using Plex API (Python) with Heroku won't initiate playback

**URL:** <https://forums.plex.tv/t/using-plex-api-python-with-heroku-wont-initiate-playback/216730>\
**Category:** Dev/API Corner\
**Tags:** other-dev\
**Created:** [December 7, 2017, 12:46am UTC](https://forums.plex.tv/t/using-plex-api-python-with-heroku-wont-initiate-playback/216730 "2017-12-07T00:46:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryaninbinary](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@ryaninbinary](https://forums.plex.tv/u/ryaninbinary)\
**Post date:** [December 7, 2017, 12:46am UTC](https://forums.plex.tv/t/using-plex-api-python-with-heroku-wont-initiate-playback/216730/1 "2017-12-07T00:46:53Z")

</div>

I’m trying to use this:

> **[pkkid/python-plexapi](https://github.com/pkkid/python-plexapi)**
>
> Python bindings for the Plex API. Contribute to pkkid/python-plexapi development by creating an account on GitHub.

When I test locally, everything works 10/10. As soon as I push the code to Heroku, log prints that it’s trying to play, but then eventually (at the 30s mark) throws a 500 because of the timeout. Anyone seen anything similar or know how to fix it?

```
cars = plex.library.section("Movies").get("Cars")
client = plex.client("Living Room")
client.playMedia(cars)

```

After being signed in. If I run this by hosting my python server locally, everything runs fine.

---

<div class="post-metadata">

**Author:** ![ryaninbinary](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@ryaninbinary](https://forums.plex.tv/u/ryaninbinary)\
**Post date:** [December 7, 2017, 12:58am UTC](https://forums.plex.tv/t/using-plex-api-python-with-heroku-wont-initiate-playback/216730/2 "2017-12-07T00:58:27Z")

</div>

I also just tried this…

```
cars = plex.library.section("Movies").get("Cars")
print("Found movie name")
client = plex.client(client_name)
print("Setup client")
client.playMedia(cars)
print("Client should be playing.")

```

The Heroku server prints

```
Found movie name
Setup client

```

Then nothing happens.

---

<div class="post-metadata">

**Author:** ![PKKid](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/pkkid/32/991_2.png) [@PKKid](https://forums.plex.tv/u/PKKid)\
**Post date:** [December 8, 2017, 2:16am UTC](https://forums.plex.tv/t/using-plex-api-python-with-heroku-wont-initiate-playback/216730/3 "2017-12-08T02:16:51Z")

</div>

What is the client you are trying to play to?

Also, if you post this question on the github page, you’ll get better help as it emails us when you ask. – [https://github.com/pkkid/python-plexapi](https://github.com/pkkid/python-plexapi)

---

<div class="post-metadata">

**Author:** ![ryaninbinary](https://avatars.discourse-cdn.com/v4/letter/r/df705f/32.png) [@ryaninbinary](https://forums.plex.tv/u/ryaninbinary)\
**Post date:** [December 11, 2017, 9:08pm UTC](https://forums.plex.tv/t/using-plex-api-python-with-heroku-wont-initiate-playback/216730/4 "2017-12-11T21:08:05Z")

</div>

The client is an Apple TV

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [January 8, 2020, 8:06pm UTC](https://forums.plex.tv/t/using-plex-api-python-with-heroku-wont-initiate-playback/216730/5 "2020-01-08T20:06:10Z")

</div>


