Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Double-quotes causing invalid URL error ? #22764
Comments
|
URL string literal must not contain any quotes. Yours contains single quotes. |
|
OK many thanks. The youtube-dl/README.md says:
I thought I was following that advice. My script uses the third formulation above i.e. I put the whole URL in quotes. Perhaps my mistake is to use quotes in all cases instead of just those where the URL contains an ampersand. I'll try to limit using quotes to the ampersand case. Cheers. |
|
Again: this is for passing arguments from shell. You must not use any quotation in string literals in code. |
Checklist
Question
Context: macOS 10.13, youtube-dl v.2019.09.28 (and earlier – not confirmed in latest)
I am invoking youtube-dl programmatically in AppleScript which sends the command to sh shell. Because of possible special characters in URLs, the code always puts single quotes around URLs. It has been working for 18 months or so. But, on rare occasions, youtube-dl reports an invalid URL. The debug report shows double-quotes around the URL. The debug reports look like this:
The double-quotes can be seen in the "Command-line args:" line. After encountering this error, I have re-run the script to download the same video and there has been no error.
I have tested various formulations of the youtube-dl command trying to get double-quotes to show as they do in the above log, but failed:
youtube-dl copes extremely well with the variety of formulations but, as mentioned, my code always encloses URLs in single quotes.
I'm not seeking help with my script but, I do need help to understand what could cause the double-quotes to appear in the log and/or whether the double-quotes indicate something else is going on.
Thanks.