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

[404] Error getting Key-File when string has & #81

Open
finelikewine opened this issue Jul 28, 2020 · 3 comments
Open

[404] Error getting Key-File when string has & #81

finelikewine opened this issue Jul 28, 2020 · 3 comments

Comments

@finelikewine
Copy link

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:5
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-KEY:METHOD=AES-128,URI="https://websiteurl.com?id=DF4s$t%FvsdEdc&fadk=couk"

Error: Getting key-file [https://websiteurl.com?id=DF4s$t%FvsdEdc&fadk=couk] failed http_code[404]

Not sure if it's a website issue, IP issue, or if it has to do with the & which is preventing HLSDL from getting the key.

@Pfuenzle
Copy link

Pfuenzle commented Dec 1, 2020

nope, same error for me.
Havent look into the code yet, but I hope I will be able to fix it, or at least make it possible to supply a keyfile via terminal

@glgoose
Copy link

glgoose commented Dec 7, 2020

nope, same error for me.
Havent look into the code yet, but I hope I will be able to fix it, or at least make it possible to supply a keyfile via terminal

Yes, it would be great to have the ability to supply a keyfile via terminal

@xavave
Copy link

xavave commented Dec 7, 2020

hi,
I've already made a few fixes and upgrades on my fork https://github.com/xavave/hlsdl-vs2019, but not this one
1- I would like now to be able to reproduce the issue with '&' key file, would you have a key file within a http(s) url example please? (I would need the m3u8 url)
2- for supplying a keyfile via terminal, what would you suggest ? this provided keyfile would override the original keyfile url?

maybe you could try with this fix in hls.c method fill_key_value:

replace:

           http_code = get_hls_data_from_url(key_url, &key_value, &size, BINKEY, NULL);
           if (es->key_url != key_url) {
               free(key_url);
           }

           if (http_code != 200 || size == 0) {
               MSG_ERROR("Getting key-file [%s] failed http_code[%d].\n", es->key_url, http_code);
               return 1;
           }
[test_winX64.zip](https://github.com/selsta/hlsdl/files/5655285/test_winX64.zip)

with;

          char* oldurl = key_url;
           char* newurl = repl_str(oldurl, "&", "&");

           http_code = get_hls_data_from_url(newurl , &key_value, &size, BINKEY, NULL);
           // http_code = get_hls_data_from_url(key_url, &key_value, &size, BINKEY, NULL);
           if (es->key_url != key_url) {
               free(key_url);
           }

           if (http_code != 200 || size == 0) {
               MSG_ERROR("Getting key-file [%s] failed http_code[%d].\n", es->key_url, http_code);
               return 1;
           }

In
test_winX64.zip
attachment: I've zipped a windows 64 compiled version of hlsdl with this fix test

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

4 participants