-2

This link leads to an m3u8 file that I would like to obtain through a command terminal:

https://desktopsecurehls-vh.akamaihd.net/i/srch_universalmusic/music/,128,64,32,320,/1580779255/srch_universalmusic_00602508789052-INUM72000004.mp4.csmil/master.m3u8?hdnts=exp=1581043986~acl=*/srch_universalmusic/music/*/1580779255/srch_universalmusic_00602508789052-INUM72000004.mp4.csmil*~hmac=baed482be6c0b6ba362d6a102b55978e78971fc94db34e2071825d12a56223b4

However, if I omit everything after "master.m3u8" I get an "Access Denied" error as I'm missing the cookie to authenticate myself. What would I have to do on python to send a request to the file through a command terminal and receive a 200 response?

Skyleft
  • 35
  • 8

1 Answers1

0

You would need to modify the server to not require the extra url parameters. I’m going to assume you don’t work for universal music, or administer the server, so there is nothing you can do. URL parameters are not the same thing as cookies BTW.

szatmary
  • 29,969
  • 8
  • 44
  • 57
  • The second half of the URL is the hdnts cookie that I get when I access the link through a browser. Once I have it, if I omit everything after "master.m3u8" the file is given to me. That's why I'm asking if there's a way to obtain the cookie (which would naturally be a different value every time it's refreshed) through a command in order to obtain the file using it. – Skyleft Feb 08 '20 at 05:59
  • Are you asking how to parse http headers? – szatmary Feb 08 '20 at 07:18