Greyh4t / m3u8-Downloader-Go

m3u8 downloader with golang
47 stars 25 forks source link

#EXTM3U absent when #EXTM3U exists #1

Closed imthaghost closed 4 years ago

imthaghost commented 4 years ago

You probably won't be able to replicate this bug unless you know how the SoundCloud API works. (The url becomes exhausted after 5 minutes) Furthermore when I am sending a request to the API using a query string. I am returned with the Error [-] Parse m3u8 file failed: #EXTM3U absent. However when I do a simple GET request inside of Postman to the API with a query string. We can clearly see #EXTM3U exists.

Screen Shot 2020-06-03 at 1 06 26 AM

Example SoundCloud Query string that contains m3u8 file:


https://cf-hls-media.sndcdn.com/playlist/kAfUa7gGIe33.128.mp3/playlist.m3u8\?Policy\=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiKjovL2NmLWhscy1tZWRpYS5zbmRjZG4uY29tL3BsYXlsaXN0L2tBZlVhN2dHSWUzMy4xMjgubXAzL3BsYXlsaXN0Lm0zdTgiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE1OTExNzEzNTZ9fX1dfQ__\&Signature\=YO-FUO8dqXao-0aTR80mA8EI1-yu6OIsvzGu1owHsHQYEz-ccicPpBMKoOB3FBh7ebkAkF3IMvnqYpjAKsRXA3qDeJIgnAQ2TORxtcnnMwpAkpCu3bPIoSDWgFotoTQpgsjulcrMC\~R746Wl9Y3eItvBPeVhv\~8XXjIcrzajB0w82B6cKn3KAxOJJP4HOxbaotn8Dk04osSz0EWVF4\~VItkMzk1SjoooHgY-eaFfZj3YrYeDLQpQtpbhs76JuMr6m94OheDl5pvTsL3zdOYFmLOIK5ADalrwcihyYVDinh6fpeQPpHLcyN-F7bt6TMn0HbJq4wQtrpFwjmarvHedUA__\&Key-Pair-Id\=APKAI6TU7MMXM5DG6EPQ
Greyh4t commented 4 years ago

You probably won't be able to replicate this bug unless you know how the SoundCloud API works. (The url becomes exhausted after 5 minutes) Furthermore when I am sending a request to the API using a query string. I am returned with the Error [-] Parse m3u8 file failed: #EXTM3U absent. However when I do a simple GET request inside of Postman to the API with a query string. We can clearly see #EXTM3U exists.

Screen Shot 2020-06-03 at 1 06 26 AM

Example SoundCloud Query string that contains m3u8 file:

https://cf-hls-media.sndcdn.com/playlist/kAfUa7gGIe33.128.mp3/playlist.m3u8\?Policy\=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiKjovL2NmLWhscy1tZWRpYS5zbmRjZG4uY29tL3BsYXlsaXN0L2tBZlVhN2dHSWUzMy4xMjgubXAzL3BsYXlsaXN0Lm0zdTgiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE1OTExNzEzNTZ9fX1dfQ__\&Signature\=YO-FUO8dqXao-0aTR80mA8EI1-yu6OIsvzGu1owHsHQYEz-ccicPpBMKoOB3FBh7ebkAkF3IMvnqYpjAKsRXA3qDeJIgnAQ2TORxtcnnMwpAkpCu3bPIoSDWgFotoTQpgsjulcrMC\~R746Wl9Y3eItvBPeVhv\~8XXjIcrzajB0w82B6cKn3KAxOJJP4HOxbaotn8Dk04osSz0EWVF4\~VItkMzk1SjoooHgY-eaFfZj3YrYeDLQpQtpbhs76JuMr6m94OheDl5pvTsL3zdOYFmLOIK5ADalrwcihyYVDinh6fpeQPpHLcyN-F7bt6TMn0HbJq4wQtrpFwjmarvHedUA__\&Key-Pair-Id\=APKAI6TU7MMXM5DG6EPQ

Can you share the m3u8 file with me, the link is broken

Greyh4t commented 4 years ago

I found that it is the website that forbids your ip to download m3u8 files, so it prompts that the parsing failed, please try to use the -p parameter to download through the proxy. In addition, the error prompt has been optimized image

imthaghost commented 4 years ago

The link isn't broken, the link only stays active for about 5 minutes before the link throws a 403 response code on SoundCloud's servers. Here's how you can replicate the bug. Make a GET request to the API using this URL:

https://api-v2.soundcloud.com/media/soundcloud:tracks:805856467/ddfb7463-50f1-476c-9010-729235958822/stream/hls?client_id=iY8sfHHuO2UsXy1QOlxthZoMJEY9v0eI

this URL will return you a URL of the m3u8 file which only stays active for 5 minutes. Meaning you would have to make another request with the provided query string to receive an updated m3u8 file.

gergre

If you do need an example of the m3u8 file that gets returned but only stays active for about 5 minutes Heres the Link to one of the files