Browse Source

Expanduser for more options with input files

Sergey M․ 9 năm trước cách đây
mục cha
commit
3e169233da
2 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 1 0
      youtube_dl/YoutubeDL.py
  2. 1 1
      youtube_dl/__init__.py

+ 1 - 0
youtube_dl/YoutubeDL.py

@@ -2018,6 +2018,7 @@ class YoutubeDL(object):
         if opts_cookiefile is None:
         if opts_cookiefile is None:
             self.cookiejar = compat_cookiejar.CookieJar()
             self.cookiejar = compat_cookiejar.CookieJar()
         else:
         else:
+            opts_cookiefile = compat_expanduser(opts_cookiefile)
             self.cookiejar = compat_cookiejar.MozillaCookieJar(
             self.cookiejar = compat_cookiejar.MozillaCookieJar(
                 opts_cookiefile)
                 opts_cookiefile)
             if os.access(opts_cookiefile, os.R_OK):
             if os.access(opts_cookiefile, os.R_OK):

+ 1 - 1
youtube_dl/__init__.py

@@ -406,7 +406,7 @@ def _real_main(argv=None):
 
 
         try:
         try:
             if opts.load_info_filename is not None:
             if opts.load_info_filename is not None:
-                retcode = ydl.download_with_info_file(opts.load_info_filename)
+                retcode = ydl.download_with_info_file(compat_expanduser(opts.load_info_filename))
             else:
             else:
                 retcode = ydl.download(all_urls)
                 retcode = ydl.download(all_urls)
         except MaxDownloadsReached:
         except MaxDownloadsReached: