This commit is contained in:
@ -1,13 +1,13 @@
|
|||||||
import os
|
import os
|
||||||
from webdav3.client import Client
|
from webdav3.client import Client
|
||||||
from webdav3.exceptions import LocalResourceNotFound, RemoteResourceNotFound
|
from webdav3.exceptions import LocalResourceNotFound, RemoteResourceNotFound, ResponseErrorCode
|
||||||
|
|
||||||
def sync():
|
def sync():
|
||||||
options = {
|
options = {
|
||||||
'webdav_hostname': 'https://pan.liliyamol.cn:8081/webdav/',
|
'webdav_hostname': 'https://pan.liliyamol.cn:8081/webdav/',
|
||||||
'webdav_login': 'fan@yunying.com',
|
'webdav_login': 'fan@yunying.com',
|
||||||
'webdav_password': 'm%Bn$w5jgiNsNC',
|
'webdav_password': 'm%Bn$w5jgiNsNC',
|
||||||
'disable_check': False,
|
'disable_check': True,
|
||||||
}
|
}
|
||||||
|
|
||||||
client = Client(options)
|
client = Client(options)
|
||||||
@ -18,6 +18,8 @@ def sync():
|
|||||||
client.clean('Music/#playlist')
|
client.clean('Music/#playlist')
|
||||||
except RemoteResourceNotFound as exception:
|
except RemoteResourceNotFound as exception:
|
||||||
print('clean failed!')
|
print('clean failed!')
|
||||||
|
except ResponseErrorCode as exception:
|
||||||
|
print('error')
|
||||||
|
|
||||||
for fileName in playlists:
|
for fileName in playlists:
|
||||||
path = os.path.join(tempPath, fileName)
|
path = os.path.join(tempPath, fileName)
|
||||||
|
Reference in New Issue
Block a user