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

Ignore white space at the start of argument / links #319

Closed
baryluk opened this issue Mar 23, 2012 · 0 comments
Closed

Ignore white space at the start of argument / links #319

baryluk opened this issue Mar 23, 2012 · 0 comments

Comments

@baryluk
Copy link
Contributor

baryluk commented Mar 23, 2012

I often copy links from browser or webpage, and use X=xclip -o; echo Downloading "$X"; youtube-dl -l "$X", or something like that. This make it possible, that if I copy a space before or after a URL, it will be not matched against regular expression, or when passed to be downloaded as webpage. This should fix it:

diff --git a/youtube-dl b/youtube-dl
index 5224611..b466c15 100755
--- a/youtube-dl
+++ b/youtube-dl
@@ -4563,6 +4563,7 @@ def _real_main():
                except IOError:
                        sys.exit(u'ERROR: batch file could not be read')
        all_urls = batchurls + args
+       all_urls = map(lambda url: url.strip(), all_urls)

        # General configuration
        cookie_processor = urllib2.HTTPCookieProcessor(jar)

Thanks.

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

2 participants