title: Downloading past twitch broadcasts in python
body: <p>I have been trying to download past broadcasts for a streamer on twitch using python. I found this python code online:</p>
  
  <p><a href="https://gist.github.com/baderj/8340312" rel="nofollow noreferrer">https://gist.github.com/baderj/8340312</a></p>
  
  <p>However, when I try to call the functions I am getting errors giving me a status 400 message.
  Unsure if this is the code I want to download the video (as an mp4) or how to use it properly.</p>
  
  <p>And by video I mean something like this as an example: <code>www(dot)twitch.tv/imaqtpie/v/108909385</code>  //note cant put more than 3 links since I don't have 10 reputation</p>
  
  <p>Any tips on how i should go about doing this?</p>
  
  <p>Here's an example of running it in cmd: </p>
  
  <p>python twitch_past_broadcast_downloader.py 108909385</p>
  
  <p>After running it, it gave me this:</p>
  
  <pre><code>Exception API returned 400
  </code></pre>
  
  <p>This is where i got the information on running it:
  <a href="https://www.johannesbader.ch/2014/01/find-video-url-of-twitch-tv-live-streams-or-past-broadcasts/" rel="nofollow noreferrer">https://www.johannesbader.ch/2014/01/find-video-url-of-twitch-tv-live-streams-or-past-broadcasts/</a></p>