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

Auto search thinks queries with slash are URLs automatically #21842

Closed
stavlocker opened this issue Jul 20, 2019 · 0 comments
Closed

Auto search thinks queries with slash are URLs automatically #21842

stavlocker opened this issue Jul 20, 2019 · 0 comments

Comments

@stavlocker
Copy link

@stavlocker stavlocker commented Jul 20, 2019

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2019.07.16
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

λ youtube-dl --default-search=auto "Bud Powell - You go to my head / remastered" -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['--default-search=auto', 'Bud Powell - You go to my head / remastered', '-v']
[debug] Encodings: locale cp1252, fs utf-8, out utf-8, pref cp1252
[debug] youtube-dl version 2019.07.16
[debug] Python version 3.7.3 (CPython) - Windows-10-10.0.17134-SP0
[debug] exe versions: ffmpeg N-94300-gaf5f770113, ffprobe N-94300-gaf5f770113
[debug] Proxy map: {}
WARNING: The url doesn't specify the protocol, trying with http
[generic]  remastered: Requesting header
WARNING: Could not send HEAD request to http://Bud Powell - You go to my head / remastered: <urlopen error [Errno 11001] getaddrinfo failed>
[generic]  remastered: Downloading webpage
ERROR: Unable to download webpage: <urlopen error [Errno 11001] getaddrinfo failed> (caused by URLError(gaierror(11001, 'getaddrinfo failed')))
  File "c:\users\stavl\envs\spotify-queue-playlist\lib\site-packages\youtube_dl\extractor\common.py", line 627, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "c:\users\stavl\envs\spotify-queue-playlist\lib\site-packages\youtube_dl\YoutubeDL.py", line 2227, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "c:\users\stavl\appdata\local\programs\python\python37-32\Lib\urllib\request.py", line 525, in open
    response = self._open(req, data)
  File "c:\users\stavl\appdata\local\programs\python\python37-32\Lib\urllib\request.py", line 543, in _open
    '_open', req)
  File "c:\users\stavl\appdata\local\programs\python\python37-32\Lib\urllib\request.py", line 503, in _call_chain
    result = func(*args)
  File "c:\users\stavl\envs\spotify-queue-playlist\lib\site-packages\youtube_dl\utils.py", line 2568, in http_open
    req)
  File "c:\users\stavl\appdata\local\programs\python\python37-32\Lib\urllib\request.py", line 1319, in do_open
    raise URLError(err)

Description

Whenever you try to download a song using the --default-search=auto feature, everything works fine and it detects if the query given is not a URL, and if so it searches it.

But, if there's a slash character in the query, it automatically thinks the given string is a URL (as shown in my example wih "Bud Powell - You Go To My Head / Remastered". It thinks a URL was given, tries to append http:// to the query, and gets a very invalid URL.

Possible workaround until this is fixed:

  • Specify the search option explicitly
  • Strip the queries of slashes if they aren't URLs
@dstftw dstftw closed this in 9c1da4a Jul 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.