@@ -266,8 +266,8 @@ def get_default_threads():
266266
267267
268268__use_pysftp__ = False
269- __upload_proto_support__ = "^(ftp|ftps|sftp):\\ /\\ /"
270- __download_proto_support__ = "^(http|https|ftp|ftps|sftp):\\ /\\ /"
269+ __upload_proto_support__ = "^(ftp|ftps|sftp|scp ):\\ /\\ /"
270+ __download_proto_support__ = "^(http|https|ftp|ftps|sftp|scp ):\\ /\\ /"
271271if (not havepysftp ):
272272 __use_pysftp__ = False
273273__use_http_lib__ = "httpx"
@@ -9399,7 +9399,7 @@ def download_file_from_ftp_file(url):
93999399 ftp = FTP_TLS ()
94009400 else :
94019401 return False
9402- if (urlparts .scheme == "sftp" ):
9402+ if (urlparts .scheme == "sftp" or urlparts . scheme == "scp" ):
94039403 if (__use_pysftp__ ):
94049404 return download_file_from_pysftp_file (url )
94059405 else :
@@ -9497,7 +9497,7 @@ def upload_file_to_ftp_file(ftpfile, url):
94979497 ftp = FTP_TLS ()
94989498 else :
94999499 return False
9500- if (urlparts .scheme == "sftp" ):
9500+ if (urlparts .scheme == "sftp" or urlparts . scheme == "scp" ):
95019501 if (__use_pysftp__ ):
95029502 return upload_file_to_pysftp_file (url )
95039503 else :
@@ -9612,7 +9612,7 @@ def download_file_from_http_file(url, headers=None, usehttp=__use_http_lib__):
96129612 urlparts .params , urlparts .query , urlparts .fragment ))
96139613
96149614 # Handle SFTP/FTP
9615- if urlparts .scheme == "sftp" :
9615+ if urlparts .scheme == "sftp" or urlparts . scheme == "scp" :
96169616 if __use_pysftp__ :
96179617 return download_file_from_pysftp_file (url )
96189618 else :
@@ -9714,7 +9714,7 @@ def download_file_from_sftp_file(url):
97149714 return download_file_from_ftp_file (url )
97159715 elif (urlparts .scheme == "http" or urlparts .scheme == "https" ):
97169716 return download_file_from_http_file (url )
9717- if (urlparts .scheme != "sftp" ):
9717+ if (urlparts .scheme != "sftp" and urlparts . scheme != "scp" ):
97189718 return False
97199719 ssh = paramiko .SSHClient ()
97209720 ssh .load_system_host_keys ()
@@ -9775,7 +9775,7 @@ def upload_file_to_sftp_file(sftpfile, url):
97759775 return upload_file_to_ftp_file (sftpfile , url )
97769776 elif (urlparts .scheme == "http" or urlparts .scheme == "https" ):
97779777 return False
9778- if (urlparts .scheme != "sftp" ):
9778+ if (urlparts .scheme != "sftp" and urlparts . scheme != "scp" ):
97799779 return False
97809780 ssh = paramiko .SSHClient ()
97819781 ssh .load_system_host_keys ()
@@ -9836,7 +9836,7 @@ def download_file_from_pysftp_file(url):
98369836 return download_file_from_ftp_file (url )
98379837 elif (urlparts .scheme == "http" or urlparts .scheme == "https" ):
98389838 return download_file_from_http_file (url )
9839- if (urlparts .scheme != "sftp" ):
9839+ if (urlparts .scheme != "sftp" and urlparts . scheme != "scp" ):
98409840 return False
98419841 try :
98429842 sftp = pysftp .Connection (urlparts .hostname , port = sftp_port ,
@@ -9893,7 +9893,7 @@ def upload_file_to_pysftp_file(sftpfile, url):
98939893 return upload_file_to_ftp_file (sftpfile , url )
98949894 elif (urlparts .scheme == "http" or urlparts .scheme == "https" ):
98959895 return False
9896- if (urlparts .scheme != "sftp" ):
9896+ if (urlparts .scheme != "sftp" and urlparts . scheme != "scp" ):
98979897 return False
98989898 try :
98999899 sftp = pysftp .Connection (urlparts .hostname , port = sftp_port ,
@@ -9933,7 +9933,7 @@ def download_file_from_internet_file(url, headers=geturls_headers_pyfile_python_
99339933 return download_file_from_http_file (url , headers , usehttp )
99349934 elif (urlparts .scheme == "ftp" or urlparts .scheme == "ftps" ):
99359935 return download_file_from_ftp_file (url )
9936- elif (urlparts .scheme == "sftp" ):
9936+ elif (urlparts .scheme == "sftp" or urlparts . scheme == "scp" ):
99379937 if (__use_pysftp__ and havepysftp ):
99389938 return download_file_from_pysftp_file (url )
99399939 else :
@@ -9958,7 +9958,7 @@ def download_file_from_internet_string(url, headers=geturls_headers_pyfile_pytho
99589958 return download_file_from_http_string (url , headers )
99599959 elif (urlparts .scheme == "ftp" or urlparts .scheme == "ftps" ):
99609960 return download_file_from_ftp_string (url )
9961- elif (urlparts .scheme == "sftp" ):
9961+ elif (urlparts .scheme == "sftp" or urlparts . scheme == "scp" ):
99629962 if (__use_pysftp__ and havepysftp ):
99639963 return download_file_from_pysftp_string (url )
99649964 else :
@@ -9985,7 +9985,7 @@ def upload_file_to_internet_file(ifp, url):
99859985 return False
99869986 elif (urlparts .scheme == "ftp" or urlparts .scheme == "ftps" ):
99879987 return upload_file_to_ftp_file (ifp , url )
9988- elif (urlparts .scheme == "sftp" ):
9988+ elif (urlparts .scheme == "sftp" or urlparts . scheme == "scp" ):
99899989 if (__use_pysftp__ and havepysftp ):
99909990 return upload_file_to_pysftp_file (ifp , url )
99919991 else :
@@ -10010,7 +10010,7 @@ def upload_file_to_internet_string(ifp, url):
1001010010 return False
1001110011 elif (urlparts .scheme == "ftp" or urlparts .scheme == "ftps" ):
1001210012 return upload_file_to_ftp_string (ifp , url )
10013- elif (urlparts .scheme == "sftp" ):
10013+ elif (urlparts .scheme == "sftp" or urlparts . scheme == "scp" ):
1001410014 if (__use_pysftp__ and havepysftp ):
1001510015 return upload_file_to_pysftp_string (ifp , url )
1001610016 else :
0 commit comments