-
Notifications
You must be signed in to change notification settings - Fork 128
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
Fail to fallback to "download the entire file" using remote URL's #7
Comments
This is definitely a bug, it should fetch the entire file when Range is not supported. |
That's great, I'm waiting for your new update, I have to say something, I'm really impressed by this library, I've tried almost EVERY JavaScript ID3 library out there, you have the best JavaScript ID3 library here. It's even memory-efficient, P.S. I've tried
|
Thank you so much for your kind words! |
I've just fixed both issues and published a new version on npm. |
I don't think the problem is fixed, I'm still not able to get tags from CORS-enabled remote URLs. I have a proposition for you: |
Or do try and catch for headers, inside catch statement do "fetch the entire file" method, that would work too |
Is this still an issue? It works well for me, I've tried it here: https://tonicdev.com/572393dd79f8ad120098dd9e/572393dd79f8ad120098dd9f |
It still doesn't work, try it in the browser, it will throw "Request header field If-Modified-Since is not allowed by Access-Control-Allow-Headers in preflight response." Anyway, I've chosen to remove anything related to "download the entire file", which is a bad experience for users, However the bug still exists. I recommend "try and catch" solution for headers. |
When you're not able to whitelist the needed headers on the server you need to disallow their usage: jsmediatags.Config.setDisallowedXhrHeaders(['If-Modified-Since', 'Range']); In this particular case it still doesn't work because the request never finishes, maybe crossorigin.me doesn't allow requests greater than 2MB? I'm not sure about the reason but it doesn't timeout so it keeps waiting for more data from the server. You're not able to try/catch these XHR errors, you can know about them with the |
I tried JavaScript ID3 Reader and this jsmediatags,js
They both fail to get tags from external websites that don't support HTTP Range feature or they don't allow If-Modified-Since header.
So I edited jsmediatags.js file:
#1977: Removed: xhr.setRequestHeader("If-Modified-Since", "Sat, 01 Jan 1970 00:00:00 GMT");
#1813: Replaced with: var contentLength = null;
What I did ? I forced to download the entire file, which this should be automatically If required headers are not supported on the remote URL's. please fix the fallback ASAP
Example URL: https://crossorigin.me/http://s3.amazonaws.com/static.noisetrade.com/w/8a6a64e5-5c2c-4584-ad46-bba625de301e/hey-tree-streaming.mp3
The text was updated successfully, but these errors were encountered: