I want to download the m3u8 file as mp4 file from a website to my computer. So I start by requesting for the m3u8 file, but I receive status code 204 everytime I did that.
import requests
import time
url = "https://vpx13.myself-bbs.com/vpx/41950/011_v01/720p.m3u8"
r = requests.get(url)
while r.status_code == 204:
r = requests.get(url)
time.sleep(1)
print("loop")
print(r)
The while loop continue for 5 minutes. It would be 200 if I replace the url to other m3u8 file such as https://hlsvod.shugiintv.go.jp/vod/definst/amlst:2011/2011-1207-0900-12/playlist.m3u8. Are there anything special with the m3u8 file I would like to download?
Here’s the information of the request when I’m requesting from the website itself.
Request URL: https://vpx13.myself-bbs.com/vpx/41950/011_v01/720p.m3u8
Request Method: GET
Status Code: 200 OK
Remote Address: 88.198.62.181:443
Referrer Policy: strict-origin-when-cross-origin
Accept-Ranges: bytes
Access-Control-Allow-Origin: https://v.myself-bbs.com
Access-Control-Expose-Headers: X-Cache-Status
Cache-Control: max-age=315360000
:authority: vpx13.myself-bbs.com
Referer: https://v.myself-bbs.com/
I can directly download the ts file of the m3u8 file in my web browser, it works everytime.
Is there really something special about the url I’m requesting or it’s just my fault? Thanks in advance for looking.