title: How to use ffmpeg-python library to download a Twitch VOD with a link retrieved using the streamlink library
body: <p>This is the whole code, for easy reference:</p>
  <pre><code>import urllib.request
  import streamlink
  import ffmpeg
  stream_url = streamlink.streams(&quot;https://www.twitch.tv/videos/783301562&quot;)['best'].url
  print(stream_url)
  
  try:
      urllib.request.urlretrieve(stream_url, &quot;vod.m3u8&quot;)
  except Exception as e:
      print(e)
  
  stream = (
      ffmpeg
      .input('vod.m3u8')
      .output('output.mp4')
      .run
  )
  print(stream)
  </code></pre>
  <p>I am looking at a way of downloading Twitch VODs. I started with the link to a VOD: <a href="https://www.twitch.tv/videos/783301562" rel="nofollow noreferrer">https://www.twitch.tv/videos/783301562</a> . I then used the code:</p>
  <pre><code>stream_url = streamlink.streams(&quot;https://www.twitch.tv/videos/783301562&quot;)['best'].url
  print(stream_url)
  </code></pre>
  <p>This gave me a new link which, when I go to this link it downloaded a file with a '.m3u8' extension. This link is: <a href="https://dqrpb9wgowsf5.cloudfront.net/ab3654a5992fbfa52ccb_briziana_40240109614_1603789265/chunked/index-dvr.m3u8" rel="nofollow noreferrer">https://dqrpb9wgowsf5.cloudfront.net/ab3654a5992fbfa52ccb_briziana_40240109614_1603789265/chunked/index-dvr.m3u8</a></p>
  <p>From here, I first tried to put the link directly into the following code:</p>
  <pre><code>stream = (
      ffmpeg
      .input(stream_url)
      .output('output.mp4')
      .run
  )
  print(stream)
  </code></pre>
  <p>This didn't output any mp4 file but did give the output:</p>
  <blockquote>
  <p>&lt;bound method run of output(filename='output.mp4')[None] &lt;2606681a&gt;&gt;</p>
  </blockquote>
  <p>I then added the following code to download the file, I also change the ffmpeg code to use the downloaded file rather then the url:</p>
  <pre><code>try:
      urllib.request.urlretrieve(stream_url, &quot;vod.m3u8&quot;)
  except Exception as e:
      print(e)
  
  stream = (
      ffmpeg
      .input('vod.m3u8')
      .output('output.mp4')
      .run
  )
  print(stream)
  </code></pre>
  <p>This gave the same result, no mp4 file with the same output as above. Any help would be greatly appreciated!</p>