Skip to content
This repository has been archived by the owner on Mar 11, 2022. It is now read-only.

URIError: URI malformed #89

Open
fullerlee opened this issue Jul 28, 2021 · 2 comments
Open

URIError: URI malformed #89

fullerlee opened this issue Jul 28, 2021 · 2 comments

Comments

@fullerlee
Copy link

I'm unable to get any URLs on iOS SImulator.

const youtubeURL = 'http://www.youtube.com/watch?v=04GiqLjRO3A';
const urls = await ytdl(youtubeURL, { quality: 'highestaudio' });
console.log(urls);

Getting:

ERROR URIError: URI malformed
    at decodeURIComponent (<anonymous>)
    at Object.module.exports (decode.js:68)
    at _callee9$ (info.js:340)
    at tryCatch (runtime.js:63)
    at Generator.invoke [as _invoke] (runtime.js:294)
    at Generator.next (runtime.js:119)
    at tryCatch (runtime.js:63)
    at invoke (runtime.js:155)
    at runtime.js:165
    at tryCallOne (core.js:37)
@fullerlee
Copy link
Author

I've fixed this. Will put a PR up shortly

@fullerlee
Copy link
Author

fullerlee commented Aug 27, 2021

I've fixed this in my fork here: https://github.com/fullerlee/react-native-ytdl

I found that the miniget polyfill wasn't handling redirects in a suitable way. This meant my initial request wasn't getting past a particular warning screen (I've forgotten the exact content) displayed by youtube.

I've changed the miniget polyfill to use axios instead of fetch and it seems to work now. However, I'm not sure if adding a new dependency is acceptable to people using this library, so haven't raised a PR yet.

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

No branches or pull requests

1 participant