1

I am trying to use youtube-dl , using the bellow command, in windows 7.

youtube-dl.exe --proxy "http://a12345:A@[email protected]:8080/" https://www.youtube.com/watch?v=XzZJuEDQ1a0

username:a12345

password:A@1

proxy: proxy.com

The bellow is the response I am getting.

  [youtube] Confirming age
    WARNING: Unable to confirm age: <urlopen error [Errno 10013] An attempt was made
     to access a socket in a way forbidden by its access permissions>
    [youtube] XzZJuEDQ1a0: Downloading webpage
    ERROR: Unable to download webpage: <urlopen error [Errno 10013] An attempt was m
    ade to access a socket in a way forbidden by its access permissions> (caused by
    URLError(error(10013, 'An attempt was made to access a socket in a way forbidden
     by its access permissions'),))

I suspect that its the @ sign in the password, but I cant seem to escape it that it is treated as a normal character.

with verbose

[debug] System config: [] [debug] User config: [] [debug] Command-line

args: ['--proxy', 'http://a12345:A%[email protected]:8080/',

'https://www.youtube.com/watch?v=2bZd5r0iPGc', '--verbose'] [debug]

Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252 [debug]

youtube-dl version 2014.11.27 [debug] Python version 2.7.8 -

Windows-7-6.1.7601-SP1 [debug] exe versions: ffmpeg N-68102-, ffprobe N-68102- [debug] Proxy map: {u'http': 'http://a12345:A%[email protected]:8080/', u'https':

'http://a12345:A%[email protected]:8080/'} [youtube] Confirming age

WARNING: Unable to confirm age:

attempt was made to access a socket in a way forbidden by its access

permissions> [youtube] 2bZd5r0iPGc: Downloading webpage ERROR: Unable

to download webpage:

to access a socket in a way forbidden by its access permissions>

(caused by URLError(error(10013, 'An attempt was made to access a

socket in a way forbidden by its access permissions'),))

File "youtube_dl\extractor\common.pyo", line 273, in _request_webpage

File "youtube_dl\YoutubeDL.pyo", line 1321, in urlopen
File "urllib2.pyo", line 404, in open > File "urllib2.pyo", line 422, in _open
File "urllib2.pyo", line 382, in _call_chain
File "youtube_dl\utils.pyo", line 410, in https_open File "urllib2.pyo", line 1184, in do_open

2
  • nope, does not work. Apr 23, 2015 at 12:27
  • Sorry, I just removed the comment to put it as answer. And since it does work for wget, I assume it's a bug in youtube-dl Apr 23, 2015 at 12:29

2 Answers 2

1

You should encode the @ character in your password as %40 in conformance with URI standard:

http://a12345:A%[email protected]:8080/

Since you report this doesn't work in youtube-dl, I suppose the only workaround is to avoid URI special characters in your password. Change your password to include ALPHA / DIGIT / "-" / "." / "_" / "~" if you can.

I'm not sure where the problem is, since urllib2 unquotes the password before passing it to the proxy:

    if '@' in host:
        user_pass, host = host.split('@', 1)
        user_pass = base64.encodestring(unquote(user_pass)).strip()
        req.add_header('Proxy-Authorization', 'Basic '+user_pass)

and urllib2.unquote("A%401") returns A@1 as expected. Perhaps you should report this to youtube-dl devs.

4
  • sorry mate, it did not work. Apr 23, 2015 at 12:40
  • workaround: change your password
    – Skaperen
    Apr 23, 2015 at 12:56
  • 1
    haha, ok will try that, its connected to may other application, part of domain account ..etc. Apr 24, 2015 at 8:08
  • I can confirm this system of encoding the @ as %40 in a username does work with my proxy and youtube-dl. The issue must lie on the server's end. Now if only I could get https working.
    – gmlime
    Nov 10, 2015 at 3:00
-2

Check if Youtube-dl is blocked by your firewall, if you use an application level firewall. Since it's not digitally signed, some firewalls may block it by default

The error showing up as a file system access issue has to do with the fact that its an app ported from unix, where network access may be represented as files (I assume you've made no changes to your filesystem permisssions)

See https://unix.stackexchange.com/questions/157351/why-are-tcp-ip-sockets-considered-open-files

4
  • I had this issue and this fixed it for me Oct 23, 2015 at 7:28
  • Because youtube-dl is written in Python, what you said about "network access may be represented as files" is most likely incorrect.
    – geek1011
    Oct 23, 2015 at 13:10
  • i had this very error today, accidentally blocked the app using a firewall, restarted my computer several times, i'm using windows 10 Oct 23, 2015 at 21:18
  • i think it's a linux first app, if you use windows, you can try blocking the app at your firewall and reading the output. YOu can checkk my edit for the link: from a comment there , Sockets are files. They provide access to streams of bytes through the read/write interface, which is the heart of what it means to be a file Oct 23, 2015 at 21:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .