.netrc on windows #119

Closed
opened 2026-02-20 21:02:58 -05:00 by deekerman · 9 comments
Owner

Originally created by @5shekel on GitHub (Sep 14, 2011).

on windows you cant create file starting with dot.
might be a problem with the module itself.
also it is not clear waht should be inside that netrc file.

youtube-dl.py -n http://www.youtube.com/watch?v=HO1OV5B_JDw
WARNING: parsing .netrc: [Errno 2] No such file or directory: 'd:\\bin\\.netrc'
Originally created by @5shekel on GitHub (Sep 14, 2011). on windows you cant create file starting with dot. might be a problem with the module itself. also it is not clear waht should be inside that netrc file. ``` youtube-dl.py -n http://www.youtube.com/watch?v=HO1OV5B_JDw WARNING: parsing .netrc: [Errno 2] No such file or directory: 'd:\\bin\\.netrc' ```
Author
Owner

@phihag commented on GitHub (Sep 14, 2011):

.netrc contains usernames and password for various network services, kind of like the password manager in your browser. Although the Python module for netrc is available on Windows, it's pretty much useless without cygwin or the Windows POSIX subsystem (haha).

The fix for your problem is simple: Don't use -n or --netrc unless you have a netrc file configured, which seems not to be the case on your Windows installation. If you need to specify a username and a password (and you don't for http://www.youtube.com/watch?v=HO1OV5B_JDw , which is public), use the --username and --password options.

I'm closing this issue because simply omitting -n should fix the problem. If that isn't the case, please comment and reopen.

@phihag commented on GitHub (Sep 14, 2011): `.netrc` contains usernames and password for various network services, kind of like the password manager in your browser. Although the Python module for netrc is available on Windows, it's pretty much useless without cygwin or the Windows POSIX subsystem (haha). The fix for your problem is simple: Don't use `-n` or `--netrc` unless you have a netrc file configured, which seems not to be the case on your Windows installation. If you need to specify a username and a password (and you don't for http://www.youtube.com/watch?v=HO1OV5B_JDw , which is public), use the `--username` and `--password` options. I'm closing this issue because simply omitting `-n` should fix the problem. If that isn't the case, please comment and reopen.
Author
Owner

@5shekel commented on GitHub (Nov 30, 2013):

hi there, can we take a second look at windows integration of netrc.
seems it can be done , or am i wrong
https://www.labkey.org/wiki/home/Documentation/page.view?name=netrc

@5shekel commented on GitHub (Nov 30, 2013): hi there, can we take a second look at windows integration of netrc. seems it can be done , or am i wrong https://www.labkey.org/wiki/home/Documentation/page.view?name=netrc
Author
Owner

@5shekel commented on GitHub (Jun 3, 2016):

bump

@5shekel commented on GitHub (Jun 3, 2016): bump
Author
Owner

@dstftw commented on GitHub (Jun 3, 2016):

.netrc works fine on Windows.

@dstftw commented on GitHub (Jun 3, 2016): .netrc works fine on Windows.
Author
Owner

@5shekel commented on GitHub (Jun 3, 2016):

but how? i'm probably missing something.
windows doesn't let me save a dot file (file starting with dot) and youtube-dl explicitly asks for .netrc.

youtube-dl.exe -v -n EYimjHuU99c
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-v', '-n', 'EYimjHuU99c']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2016.06.03
[debug] Python version 3.4.4 - Windows-10-10.0.10586
[debug] exe versions: ffmpeg 3.0.1, ffprobe 3.0.1
[debug] Proxy map: {}
WARNING: parsing .netrc: [Errno 2] No such file or directory: 'c:\\dir\\.netrc'
...
@5shekel commented on GitHub (Jun 3, 2016): but how? i'm probably missing something. windows doesn't let me save a dot file (file starting with dot) and youtube-dl explicitly asks for .netrc. ``` youtube-dl.exe -v -n EYimjHuU99c [debug] System config: [] [debug] User config: [] [debug] Command-line args: ['-v', '-n', 'EYimjHuU99c'] [debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252 [debug] youtube-dl version 2016.06.03 [debug] Python version 3.4.4 - Windows-10-10.0.10586 [debug] exe versions: ffmpeg 3.0.1, ffprobe 3.0.1 [debug] Proxy map: {} WARNING: parsing .netrc: [Errno 2] No such file or directory: 'c:\\dir\\.netrc' ... ```
Author
Owner
@dstftw commented on GitHub (Jun 3, 2016): http://superuser.com/questions/64471/create-rename-a-file-folder-that-begins-with-a-dot-in-windows
Author
Owner

@5shekel commented on GitHub (Jun 3, 2016):

amazing, tnx!

@5shekel commented on GitHub (Jun 3, 2016): amazing, tnx!
Author
Owner

@svefn commented on GitHub (Jun 17, 2019):

hi, i have trouble linking to the .netrc file in Windows with $home not set. i have manually set HOME="C:/Users/username/" and it can't find the .netrc file.

@svefn commented on GitHub (Jun 17, 2019): hi, i have trouble linking to the .netrc file in Windows with $home not set. i have manually set HOME="C:/Users/username/" and it can't find the .netrc file.
Author
Owner

@kapatz commented on GitHub (Jun 2, 2021):

same problem, i have manually set HOME="C:/Users/username/" and it can't find the .netrc file.

@kapatz commented on GitHub (Jun 2, 2021): same problem, i have manually set HOME="C:/Users/username/" and it can't find the .netrc file.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/youtube-dl#119
No description provided.