title: Download m3u8 from URL using Python
body: <p>I started learning web scraping with Python. Currently, I would like to download a video of the Japanese Diet. (<a href="https://www.shugiintv.go.jp/jp/index.php?ex=VL&amp;deli_id=40124&amp;media_type=" rel="nofollow noreferrer">https://www.shugiintv.go.jp/jp/index.php?ex=VL&amp;deli_id=40124&amp;media_type=</a>)</p>
  <p>The video seems to have a mechanism to call chunklist.m3u8 from playlist.m3u8 and then call the ts files described in chunklist.m3u8 in order.</p>
  <p>I want to download the contents from the playlist.m3u8 URL first, then call chunklist.m3u8 to download the ts files in order and concat.</p>
  <p>However, I tried to download Playlist.m3u8, but it didn't produce the text I expected.</p>
  <p>Also, the sample URL of playlist.m3u8 is here↓</p>
  <p><a href="http://hlsvod.shugiintv.go.jp/vod/_definst_/amlst:2011/2011-1207-0900-12/playlist.m3u8" rel="nofollow noreferrer">http://hlsvod.shugiintv.go.jp/vod/_definst_/amlst:2011/2011-1207-0900-12/playlist.m3u8</a></p>
  <p>code:</p>
  <pre><code>import requests
  
  url = &quot;http://hlsvod.shugiintv.go.jp/vod/_definst_/amlst:2011/2011-1207-0900-12/playlist.m3u8&quot;
  res = requests.get(url)
  print(res.text)
  </code></pre>
  <p>excepted text:</p>
  <pre><code>#EXTM3U
  #EXT-X-VERSION:3
  #EXT-X-STREAM-INF:BANDWIDTH=564000,NAME=&quot;500k&quot;,RESOLUTION=640x360
  chunklist_w60346572_b564000_t64NTAwaw==.m3u8
  </code></pre>
  <p>actual text:</p>
  <pre><code>&lt;html&gt;&lt;head&gt;&lt;title&gt;Wowza Streaming Engine 4 Perpetual Bundle Unlimited Edition 4.7.7 build20181108145350&lt;/title&gt;&lt;/head&gt;&lt;body&gt;Wowza Streaming Engine 4 Perpetual Bundle Unlimited Edition 4.7.7 build20181108145350&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  <p>I think there is a problem with the colon in the URL, but I don't have a clear solution. I would like to know how to avoid URL issues and successfully download the text in playlist.m3u8. Thanks.</p>
  <p>Version:</p>
  <p>Python 3.7.9</p>
  <p>requests 2.25.1</p>