Skip to content

Commit 75f2806

Browse files
committed
nico: hotfix: add default value for --proxy
1 parent b040008 commit 75f2806

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

nico.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def validate_cookie(cookies):
6565
self.session.headers.update(self.HEADERS)
6666

6767
# proxy settings
68-
if proxy.lower() == 'none' or proxy is None:
68+
if proxy is None or proxy.lower() == 'none':
6969
proxy = None
7070
elif proxy == 'auto':
7171
proxies = getproxies()
@@ -309,9 +309,11 @@ def _split_lines(self, text, width):
309309
parser.add_argument('--thumb', action='store_true', help='Download thumbnail only. Only works for video type (not live type).')
310310
parser.add_argument('--cookies', '-c', default='chrome', help='R|Cookie source. [Default: chrome]\nProvide either:\n - A browser name to fetch from;\n - The value of "user_session";\n - A Netscape-style cookie file.')
311311
parser.add_argument('--comments', '-d', default='yes', choices=['yes', 'no', 'only'], help='Control if comments (danmaku) are downloaded. [Default: yes]')
312-
parser.add_argument('--proxy', help='Specify a proxy, "none", or "auto" (automatically detects system proxy settings). [Default: auto]')
312+
parser.add_argument('--proxy', default='auto', help='Specify a proxy, "none", or "auto" (automatically detects system proxy settings). [Default: auto]')
313313
args = parser.parse_args()
314314

315+
print(args)
316+
315317
nico_downloader = NicoDownloader(args.url, args.cookies, args.proxy)
316318

317319
if args.thumb:

0 commit comments

Comments
 (0)