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

Vimeo embed-only video behind basic auth #18276

Closed
5 of 9 tasks
diogocampos opened this issue Nov 22, 2018 · 2 comments · Fixed by #28801
Closed
5 of 9 tasks

Vimeo embed-only video behind basic auth #18276

diogocampos opened this issue Nov 22, 2018 · 2 comments · Fixed by #28801

Comments

@diogocampos
Copy link

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like this: [x])
  • Use the Preview tab to see what your issue will actually look like

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.11.18. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2018.11.18

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

Description of your issue, suggested solution and other information

I'm trying to download an embed-only video, hosted on Vimeo and embedded on a page protected by basic auth. I have the username and password and am able to access the page and play the video normally on a browser. I've tried the following approaches, all of which have resulted in errors.

1. Using the video embed URL

$ youtube-dl -v https://player.vimeo.com/video/VIDEOID
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://player.vimeo.com/video/VIDEOID']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.11.18
[debug] Python version 2.7.15 (CPython) - Darwin-17.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.1, ffprobe 4.1
[debug] Proxy map: {}
[vimeo] VIDEOID: Downloading webpage
ERROR: Cannot download embed-only video without embedding URL. Please call youtube-dl with the URL of the page that embeds this video.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/vimeo.py", line 488, in _real_extract
    webpage, urlh = self._download_webpage_handle(request, video_id)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 638, in _download_webpage_handle
    urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query, expected_status=expected_status)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 623, in _request_webpage
    raise ExtractorError(errmsg, sys.exc_info()[2], cause=err)
ExtractorError: Unable to download webpage: HTTP Error 403: Forbidden (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 792, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 508, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/vimeo.py", line 503, in _real_extract
    expected=True)
ExtractorError: Cannot download embed-only video without embedding URL. Please call youtube-dl with the URL of the page that embeds this video.

2. Using the URL of the page that embeds the video

$ youtube-dl -v http://PROTECTED-PAGE.EXAMPLE.com
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'http://PROTECTED-PAGE.EXAMPLE.com']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.11.18
[debug] Python version 2.7.15 (CPython) - Darwin-17.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.1, ffprobe 4.1
[debug] Proxy map: {}
[generic] PROTECTED-PAGE.EXAMPLE: Requesting header
WARNING: Could not send HEAD request to http://PROTECTED-PAGE.EXAMPLE.com: HTTP Error 401: Authorization Required
[generic] PROTECTED-PAGE.EXAMPLE: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 401: Authorization Required (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 605, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2211, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

3. Adding --username and --password options to the command line

$ youtube-dl -v --username THEUSERNAME --password THEPASSWORD http://PROTECTED-PAGE.EXAMPLE.com
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'--username', u'PRIVATE', u'--password', u'PRIVATE', u'http://PROTECTED-PAGE.EXAMPLE.com']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.11.18
[debug] Python version 2.7.15 (CPython) - Darwin-17.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.1, ffprobe 4.1
[debug] Proxy map: {}
[generic] PROTECTED-PAGE.EXAMPLE: Requesting header
WARNING: Could not send HEAD request to http://PROTECTED-PAGE.EXAMPLE.com: HTTP Error 401: Authorization Required
[generic] PROTECTED-PAGE.EXAMPLE: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 401: Authorization Required (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 605, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2211, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 435, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 548, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 473, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 556, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

4. Adding username:password to the page's URL

$ youtube-dl -v http://THEUSERNAME:THEPASSWORD@PROTECTED-PAGE.EXAMPLE.com
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'http://THEUSERNAME:THEPASSWORD@PROTECTED-PAGE.EXAMPLE.com']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.11.18
[debug] Python version 2.7.15 (CPython) - Darwin-17.7.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 4.1, ffprobe 4.1
[debug] Proxy map: {}
[generic] THEUSERNAME:THEPASSWORD@PROTECTED-PAGE.EXAMPLE: Requesting header
WARNING: Could not send HEAD request to http://THEUSERNAME:THEPASSWORD@PROTECTED-PAGE.EXAMPLE.com: nonnumeric port: 'THEPASSWORD@PROTECTED-PAGE.EXAMPLE.com'
[generic] THEUSERNAME:THEPASSWORD@PROTECTED-PAGE.EXAMPLE: Downloading webpage
ERROR: Unable to download webpage: nonnumeric port: 'THEPASSWORD@PROTECTED-PAGE.EXAMPLE.com' (caused by InvalidURL(u"nonnumeric port: 'THEPASSWORD@PROTECTED-PAGE.EXAMPLE.com'",)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 605, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 2211, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 429, in open
    response = self._open(req, data)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 447, in _open
    '_open', req)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 407, in _call_chain
    result = func(*args)
  File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 983, in http_open
    req)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1167, in do_open
    h = http_class(host, timeout=req.timeout, **http_conn_args)
  File "/usr/local/bin/youtube-dl/youtube_dl/utils.py", line 882, in _create_http_connection
    hc = http_class(*args, **compat_kwargs(kwargs))
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 736, in __init__
    (self.host, self.port) = self._get_hostport(host, port)
  File "/usr/local/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 777, in _get_hostport
    raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
@remitamine
Copy link
Collaborator

youtube-dl --referer http://PROTECTED-PAGE.EXAMPLE.com https://player.vimeo.com/video/VIDEOID

@diogocampos
Copy link
Author

Using --referer worked. Thanks!

hhirtz added a commit to hhirtz/youtube-dl that referenced this issue Apr 19, 2021
Fixes ytdl-org#18276 (point 4)
Fixes ytdl-org#20258
Fixes ytdl-org#26211 (see comment)
hhirtz added a commit to hhirtz/youtube-dl that referenced this issue Apr 19, 2021
Fixes "nonnumeric port" errors when youtube-dl is given URLs with
usernames and passwords such as:

    http://username:password@example.com/myvideo.mp4

Refs:
- https://en.wikipedia.org/wiki/Basic_access_authentication
- https://tools.ietf.org/html/rfc1738#section-3.1
- https://docs.python.org/3.8/library/urllib.parse.html#urllib.parse.urlsplit

Fixes ytdl-org#18276 (point 4)
Fixes ytdl-org#20258
Fixes ytdl-org#26211 (see comment)
hhirtz added a commit to hhirtz/youtube-dl that referenced this issue Apr 19, 2021
Fixes "nonnumeric port" errors when youtube-dl is given URLs with
usernames and passwords such as:

    http://username:password@example.com/myvideo.mp4

Refs:
- https://en.wikipedia.org/wiki/Basic_access_authentication
- https://tools.ietf.org/html/rfc1738#section-3.1
- https://docs.python.org/3.8/library/urllib.parse.html#urllib.parse.urlsplit

Fixes ytdl-org#18276 (point 4)
Fixes ytdl-org#20258
Fixes ytdl-org#26211 (see comment)
hhirtz added a commit to hhirtz/youtube-dl that referenced this issue Apr 19, 2021
Fixes "nonnumeric port" errors when youtube-dl is given URLs with
usernames and passwords such as:

    http://username:password@example.com/myvideo.mp4

Refs:
- https://en.wikipedia.org/wiki/Basic_access_authentication
- https://tools.ietf.org/html/rfc1738#section-3.1
- https://docs.python.org/3.8/library/urllib.parse.html#urllib.parse.urlsplit

Fixes ytdl-org#18276 (point 4)
Fixes ytdl-org#20258
Fixes ytdl-org#26211 (see comment)
hhirtz added a commit to hhirtz/youtube-dl that referenced this issue Jul 2, 2021
Fixes "nonnumeric port" errors when youtube-dl is given URLs with
usernames and passwords such as:

    http://username:password@example.com/myvideo.mp4

Refs:
- https://en.wikipedia.org/wiki/Basic_access_authentication
- https://tools.ietf.org/html/rfc1738#section-3.1
- https://docs.python.org/3.8/library/urllib.parse.html#urllib.parse.urlsplit

Fixes ytdl-org#18276 (point 4)
Fixes ytdl-org#20258
Fixes ytdl-org#26211 (see comment)
hhirtz added a commit to hhirtz/youtube-dl that referenced this issue Jul 6, 2021
Fixes "nonnumeric port" errors when youtube-dl is given URLs with
usernames and passwords such as:

    http://username:password@example.com/myvideo.mp4

Refs:
- https://en.wikipedia.org/wiki/Basic_access_authentication
- https://tools.ietf.org/html/rfc1738#section-3.1
- https://docs.python.org/3.8/library/urllib.parse.html#urllib.parse.urlsplit

Fixes ytdl-org#18276 (point 4)
Fixes ytdl-org#20258
Fixes ytdl-org#26211 (see comment)
dirkf added a commit that referenced this issue Mar 4, 2024
* Handle user:pass in URLs

Fixes "nonnumeric port" errors when youtube-dl is given URLs with
usernames and passwords such as:

    http://username:password@example.com/myvideo.mp4

Refs:
- https://en.wikipedia.org/wiki/Basic_access_authentication
- https://tools.ietf.org/html/rfc1738#section-3.1
- https://docs.python.org/3.8/library/urllib.parse.html#urllib.parse.urlsplit

Fixes #18276 (point 4)
Fixes #20258
Fixes #26211 (see comment)

* Align code with yt-dlp

---------

Co-authored-by: dirkf <fieldhouse@gmx.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants