Skip to content

Commit 8026b01

Browse files
committed
Add comments; Remove unuseless code
1 parent 1be11b1 commit 8026b01

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

baidupcs_py/baidupcs/pcs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from pathlib import Path
66
from urllib.parse import urlparse, quote_plus
7-
from urllib.error import URLError, HTTPError
7+
from urllib.error import HTTPError
88
from base64 import standard_b64encode
99
import re
1010
import json
@@ -1007,8 +1007,8 @@ def download_link(self, remotepath: str, pcs: bool = False) -> Optional[str]:
10071007
else:
10081008
# return info["urls"][0]["url"].replace("&htype=", "")
10091009
return info["urls"][0]["url"]
1010-
except urllib.error.HTTPError as e:
1011-
print(f"Error Code:{e.code}")
1010+
except HTTPError:
1011+
# 403 code could occor at unavailable downloading url, #97
10121012
return None
10131013

10141014
def file_stream(

0 commit comments

Comments
 (0)