Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse url failed: request m3u8 URL failed: http error: status code 403 #2

Open
Sei969 opened this issue Apr 24, 2020 · 7 comments
Open

Comments

@Sei969
Copy link

Sei969 commented Apr 24, 2020

Hello, I'm trying to download a SiriusXM stream and got the following error:

.\m3u8-windows-10-x64 -u="https://siriusxm-priprodlive.akamaized.net/AAC_Data/metropolitanopera/metropolitanopera_variant_large_v3.m3u8?token=1587734244_df40af36598eb6b72bd08d0470d1f78d&consumer=k2&gupId=3BDA15C5F23ADEEFE7B02D01A66968D4" -o="C:\downloads" Panic: parse url failed: request m3u8 URL failed: http error: status code 403

Is it related to the wrong master.m3u8 parsed?

To try it by yourself please go here with USA Vpn:
https://player.siriusxm.com/home/foryou > start free preview > all channels > and choose channel 75 (Met Opera Radio).

Thanks for looking into this!

@zackmark29
Copy link

Same problem I'm about to ask this as well

Is there any way to add headers?

@BRUHItsABunny
Copy link

hi, I'm not too familiar with the code just yet and am barely about to use it myself this week.

Error 403 means you didn't have any access to the resource you requested, you probably need authorization headers like zackmark29 hinted.

If you know how to generate the authorization header value, or know where to scrape it, it shouldn't be too hard for me modify this code so you can pass it through

@titibandit
Copy link

I've been able to download protected video by setting two headers: Cookie and User-Agent.
First, find the right values for that by using the developer tools of your browser. Then I could integrate them by changing the Func Get in the http.go file:

func Get(url string) (io.ReadCloser, error) {
    req, err := http.NewRequest("GET", url, nil)
    if err != nil {
    }
    req.Header.Set("Cookie", "...your cookie that makes it work")
    req.Header.Set("User-Agent", "...your user agent...")

	c := http.Client{
		Timeout: time.Duration(60) * time.Second,
	}
	resp, err := c.Do(req)
	if err != nil {
		return nil, err
	}
	if resp.StatusCode != 200 {
		return nil, fmt.Errorf("http error: status code %d", resp.StatusCode)
	}
	return resp.Body, nil
}

You might need other headers depending on how the website you're downloading from works

@llychao
Copy link

llychao commented Nov 20, 2020

see here: https://github.com/llychao/m3u8-downloader

@dave9123
Copy link

dave9123 commented Feb 2, 2022

the ?token after the .m3u8 probably confuses the m3u8 reader

@zackmark29
Copy link

the ?token after the .m3u8 probably confuses the m3u8 reader

Bro. That was 2020 =D

@dave9123
Copy link

dave9123 commented Feb 2, 2022

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants